Find the k-th entry of the n-th row of a α-number triangle
up vote
-2
down vote
favorite
This question basically asks you to pull elements from Pascal's triangle however also applying to triangles with different values of α, meaning the first and last number of every row can be any number. the values are created by adding the numbers above it to the left and right.
This what I have so far:
f_nt <- function(n, k, alpha) {
if (k<0|k>n) {
return(0)
}
if (k==0 | k==n) {
return(alpha)
}
else {
return(alpha*(n-1))
}
}
I know the second part is incorrect however I am having trouble figuring out what the equation should be. Can anyone help?
r
New contributor
add a comment |
up vote
-2
down vote
favorite
This question basically asks you to pull elements from Pascal's triangle however also applying to triangles with different values of α, meaning the first and last number of every row can be any number. the values are created by adding the numbers above it to the left and right.
This what I have so far:
f_nt <- function(n, k, alpha) {
if (k<0|k>n) {
return(0)
}
if (k==0 | k==n) {
return(alpha)
}
else {
return(alpha*(n-1))
}
}
I know the second part is incorrect however I am having trouble figuring out what the equation should be. Can anyone help?
r
New contributor
Not exactly sure what you mean when the first and last number can be any number. Do these all have the value alpha? If you want the coefficient in Pascal's triangle, ischoose(n,k)
not what you're looking for?
– mickey
2 days ago
basically the first and last number of every row are a set number, alpha. Now that I am thinking about it more I think this problem revolves more around creating a list with sublists. the larger list being the triangle and each sublist being each row of the triangle. and basically each element in the row, beside the first and last element, is the sum of the elements above it in the previous row.
– er427lts
yesterday
I still don't follow. Are you trying to get k-th entry from the polynomial(alpha*x + alpha*y)^n
? Are you trying to create an R object that has all of these coefficients?
– mickey
yesterday
add a comment |
up vote
-2
down vote
favorite
up vote
-2
down vote
favorite
This question basically asks you to pull elements from Pascal's triangle however also applying to triangles with different values of α, meaning the first and last number of every row can be any number. the values are created by adding the numbers above it to the left and right.
This what I have so far:
f_nt <- function(n, k, alpha) {
if (k<0|k>n) {
return(0)
}
if (k==0 | k==n) {
return(alpha)
}
else {
return(alpha*(n-1))
}
}
I know the second part is incorrect however I am having trouble figuring out what the equation should be. Can anyone help?
r
New contributor
This question basically asks you to pull elements from Pascal's triangle however also applying to triangles with different values of α, meaning the first and last number of every row can be any number. the values are created by adding the numbers above it to the left and right.
This what I have so far:
f_nt <- function(n, k, alpha) {
if (k<0|k>n) {
return(0)
}
if (k==0 | k==n) {
return(alpha)
}
else {
return(alpha*(n-1))
}
}
I know the second part is incorrect however I am having trouble figuring out what the equation should be. Can anyone help?
r
r
New contributor
New contributor
edited 2 days ago
m0nhawk
14.9k83160
14.9k83160
New contributor
asked 2 days ago
er427lts
1
1
New contributor
New contributor
Not exactly sure what you mean when the first and last number can be any number. Do these all have the value alpha? If you want the coefficient in Pascal's triangle, ischoose(n,k)
not what you're looking for?
– mickey
2 days ago
basically the first and last number of every row are a set number, alpha. Now that I am thinking about it more I think this problem revolves more around creating a list with sublists. the larger list being the triangle and each sublist being each row of the triangle. and basically each element in the row, beside the first and last element, is the sum of the elements above it in the previous row.
– er427lts
yesterday
I still don't follow. Are you trying to get k-th entry from the polynomial(alpha*x + alpha*y)^n
? Are you trying to create an R object that has all of these coefficients?
– mickey
yesterday
add a comment |
Not exactly sure what you mean when the first and last number can be any number. Do these all have the value alpha? If you want the coefficient in Pascal's triangle, ischoose(n,k)
not what you're looking for?
– mickey
2 days ago
basically the first and last number of every row are a set number, alpha. Now that I am thinking about it more I think this problem revolves more around creating a list with sublists. the larger list being the triangle and each sublist being each row of the triangle. and basically each element in the row, beside the first and last element, is the sum of the elements above it in the previous row.
– er427lts
yesterday
I still don't follow. Are you trying to get k-th entry from the polynomial(alpha*x + alpha*y)^n
? Are you trying to create an R object that has all of these coefficients?
– mickey
yesterday
Not exactly sure what you mean when the first and last number can be any number. Do these all have the value alpha? If you want the coefficient in Pascal's triangle, is
choose(n,k)
not what you're looking for?– mickey
2 days ago
Not exactly sure what you mean when the first and last number can be any number. Do these all have the value alpha? If you want the coefficient in Pascal's triangle, is
choose(n,k)
not what you're looking for?– mickey
2 days ago
basically the first and last number of every row are a set number, alpha. Now that I am thinking about it more I think this problem revolves more around creating a list with sublists. the larger list being the triangle and each sublist being each row of the triangle. and basically each element in the row, beside the first and last element, is the sum of the elements above it in the previous row.
– er427lts
yesterday
basically the first and last number of every row are a set number, alpha. Now that I am thinking about it more I think this problem revolves more around creating a list with sublists. the larger list being the triangle and each sublist being each row of the triangle. and basically each element in the row, beside the first and last element, is the sum of the elements above it in the previous row.
– er427lts
yesterday
I still don't follow. Are you trying to get k-th entry from the polynomial
(alpha*x + alpha*y)^n
? Are you trying to create an R object that has all of these coefficients?– mickey
yesterday
I still don't follow. Are you trying to get k-th entry from the polynomial
(alpha*x + alpha*y)^n
? Are you trying to create an R object that has all of these coefficients?– mickey
yesterday
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
er427lts is a new contributor. Be nice, and check out our Code of Conduct.
er427lts is a new contributor. Be nice, and check out our Code of Conduct.
er427lts is a new contributor. Be nice, and check out our Code of Conduct.
er427lts is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53402770%2ffind-the-k-th-entry-of-the-n-th-row-of-a-%25ce%25b1-number-triangle%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Not exactly sure what you mean when the first and last number can be any number. Do these all have the value alpha? If you want the coefficient in Pascal's triangle, is
choose(n,k)
not what you're looking for?– mickey
2 days ago
basically the first and last number of every row are a set number, alpha. Now that I am thinking about it more I think this problem revolves more around creating a list with sublists. the larger list being the triangle and each sublist being each row of the triangle. and basically each element in the row, beside the first and last element, is the sum of the elements above it in the previous row.
– er427lts
yesterday
I still don't follow. Are you trying to get k-th entry from the polynomial
(alpha*x + alpha*y)^n
? Are you trying to create an R object that has all of these coefficients?– mickey
yesterday