Combinatorics - How many ways to partition an integer n into k bins with values 0 - 5 and restrictions
$begingroup$
I have been struggling with this brain teaser for some time now. I looked at some combinatorics and partition equations but I can't find the one that captures the solution entirely.
Frame
I have a set with 6 elements (bins) { a , b , c , d , e , f }.
Each element in the set can take an integer value in the range (0,5).
The value N is given by N = a + b + c + d + e + f: The total range for N is (0,30).
Question
For each value of N in the range (0,30) how many unique combinations of elements can I have in the set without repetition.
e.g. if N = 30 there is only 1 possible unique combination {5,5,5,5,5,5}
also for N = 0 there is only 1 possible unique combination {0,0,0,0,0,0}
for N = 1 there are 6 possible unique combinations {1,0,0,0,0,0}
{0,1,0,0,0,0}
{0,0,1,0,0,0}
{0,0,0,1,0,0}
{0,0,0,0,1,0}
{0,0,0,0,0,1}
Therefore N can be described as a discrete normally distributed integer random variable in the range (0,30).
Please help.
combinatorics permutations combinations balls-in-bins
$endgroup$
add a comment |
$begingroup$
I have been struggling with this brain teaser for some time now. I looked at some combinatorics and partition equations but I can't find the one that captures the solution entirely.
Frame
I have a set with 6 elements (bins) { a , b , c , d , e , f }.
Each element in the set can take an integer value in the range (0,5).
The value N is given by N = a + b + c + d + e + f: The total range for N is (0,30).
Question
For each value of N in the range (0,30) how many unique combinations of elements can I have in the set without repetition.
e.g. if N = 30 there is only 1 possible unique combination {5,5,5,5,5,5}
also for N = 0 there is only 1 possible unique combination {0,0,0,0,0,0}
for N = 1 there are 6 possible unique combinations {1,0,0,0,0,0}
{0,1,0,0,0,0}
{0,0,1,0,0,0}
{0,0,0,1,0,0}
{0,0,0,0,1,0}
{0,0,0,0,0,1}
Therefore N can be described as a discrete normally distributed integer random variable in the range (0,30).
Please help.
combinatorics permutations combinations balls-in-bins
$endgroup$
4
$begingroup$
If you are familiar with generating functions, you want the coefficient of $N$ in the expansion of $(1 + x + x^2 + x^3 + x^4 + x^5)^6$.
$endgroup$
– N. F. Taussig
Dec 16 '18 at 22:13
2
$begingroup$
This is equivalent to asking how many ways there are to roll $n$ with $k$ dice, see math.stackexchange.com/questions/970523/…
$endgroup$
– Mike Earnest
Dec 16 '18 at 22:17
add a comment |
$begingroup$
I have been struggling with this brain teaser for some time now. I looked at some combinatorics and partition equations but I can't find the one that captures the solution entirely.
Frame
I have a set with 6 elements (bins) { a , b , c , d , e , f }.
Each element in the set can take an integer value in the range (0,5).
The value N is given by N = a + b + c + d + e + f: The total range for N is (0,30).
Question
For each value of N in the range (0,30) how many unique combinations of elements can I have in the set without repetition.
e.g. if N = 30 there is only 1 possible unique combination {5,5,5,5,5,5}
also for N = 0 there is only 1 possible unique combination {0,0,0,0,0,0}
for N = 1 there are 6 possible unique combinations {1,0,0,0,0,0}
{0,1,0,0,0,0}
{0,0,1,0,0,0}
{0,0,0,1,0,0}
{0,0,0,0,1,0}
{0,0,0,0,0,1}
Therefore N can be described as a discrete normally distributed integer random variable in the range (0,30).
Please help.
combinatorics permutations combinations balls-in-bins
$endgroup$
I have been struggling with this brain teaser for some time now. I looked at some combinatorics and partition equations but I can't find the one that captures the solution entirely.
Frame
I have a set with 6 elements (bins) { a , b , c , d , e , f }.
Each element in the set can take an integer value in the range (0,5).
The value N is given by N = a + b + c + d + e + f: The total range for N is (0,30).
Question
For each value of N in the range (0,30) how many unique combinations of elements can I have in the set without repetition.
e.g. if N = 30 there is only 1 possible unique combination {5,5,5,5,5,5}
also for N = 0 there is only 1 possible unique combination {0,0,0,0,0,0}
for N = 1 there are 6 possible unique combinations {1,0,0,0,0,0}
{0,1,0,0,0,0}
{0,0,1,0,0,0}
{0,0,0,1,0,0}
{0,0,0,0,1,0}
{0,0,0,0,0,1}
Therefore N can be described as a discrete normally distributed integer random variable in the range (0,30).
Please help.
combinatorics permutations combinations balls-in-bins
combinatorics permutations combinations balls-in-bins
edited Dec 16 '18 at 22:04
Emmanuel Uwechue
asked Dec 16 '18 at 21:52
Emmanuel UwechueEmmanuel Uwechue
163
163
4
$begingroup$
If you are familiar with generating functions, you want the coefficient of $N$ in the expansion of $(1 + x + x^2 + x^3 + x^4 + x^5)^6$.
$endgroup$
– N. F. Taussig
Dec 16 '18 at 22:13
2
$begingroup$
This is equivalent to asking how many ways there are to roll $n$ with $k$ dice, see math.stackexchange.com/questions/970523/…
$endgroup$
– Mike Earnest
Dec 16 '18 at 22:17
add a comment |
4
$begingroup$
If you are familiar with generating functions, you want the coefficient of $N$ in the expansion of $(1 + x + x^2 + x^3 + x^4 + x^5)^6$.
$endgroup$
– N. F. Taussig
Dec 16 '18 at 22:13
2
$begingroup$
This is equivalent to asking how many ways there are to roll $n$ with $k$ dice, see math.stackexchange.com/questions/970523/…
$endgroup$
– Mike Earnest
Dec 16 '18 at 22:17
4
4
$begingroup$
If you are familiar with generating functions, you want the coefficient of $N$ in the expansion of $(1 + x + x^2 + x^3 + x^4 + x^5)^6$.
$endgroup$
– N. F. Taussig
Dec 16 '18 at 22:13
$begingroup$
If you are familiar with generating functions, you want the coefficient of $N$ in the expansion of $(1 + x + x^2 + x^3 + x^4 + x^5)^6$.
$endgroup$
– N. F. Taussig
Dec 16 '18 at 22:13
2
2
$begingroup$
This is equivalent to asking how many ways there are to roll $n$ with $k$ dice, see math.stackexchange.com/questions/970523/…
$endgroup$
– Mike Earnest
Dec 16 '18 at 22:17
$begingroup$
This is equivalent to asking how many ways there are to roll $n$ with $k$ dice, see math.stackexchange.com/questions/970523/…
$endgroup$
– Mike Earnest
Dec 16 '18 at 22:17
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Your problem in general reads as
$$N_{,b} (s,r,m) = text{No}text{. of solutions to};left{ begin{gathered}
0 leqslant text{integer }x_{,j} leqslant r hfill \
x_{,1} + x_{,2} + cdots + x_{,m} = s hfill \
end{gathered} right.$$
where $N_b$ is expressed through the sum
$$
N_b (s,r,m)quad left| {;0 leqslant text{integers }s,m,r} right.quad =
sumlimits_{left( {0, leqslant } right),,k,,left( { leqslant ,frac{s}{r+1}, leqslant ,m} right)}
{left( { - 1} right)^k binom{m}{k}
binom
{ s + m - 1 - kleft( {r + 1} right) }
{ s - kleft( {r + 1} right)} }
$$
and whose o.g.f. in $s$ is as already suggested by N.F. Taussig
$$
F_b (x,r,m) = sumlimits_{0,, leqslant ,,s,,left( { leqslant ,,r,m} right)} {N_b (s,r,m);x^{,s} }
= left( {1 + x + cdots + x^{,r} } right)^m = left( {frac{{1 - x^{,r + 1} }}{{1 - x}}} right)^m
$$
The above is thoroughly explained in this related post and in this paper.
In your case, you just have to put $m=6,;r=5,; s=N$.
$endgroup$
$begingroup$
Thank you very much. This solves it perfectly. I can use this for analysis immediately although it will take further time to understand it.
$endgroup$
– Emmanuel Uwechue
Dec 17 '18 at 15:11
$begingroup$
@EmmanuelUwechue: glad it helps. A further explanation of how it is built is the "inclusion-exclusion" principle described by S.F. Cheong, which is better grasped if you read the "geometric" interpretation given in the other cited post.
$endgroup$
– G Cab
Dec 17 '18 at 16:51
add a comment |
$begingroup$
You could as suggested by N. F. Taussig use the generating function $(1 + x + x^2 + x^3 + x^4 + x^5)^6$ and the answer will be the coefficient of $x^N$ of the expanded function.
Otherwise This question can be solved using the technique described here
Let there be $N$ stars. Since you want to separate them into $6$ bins, you will need to use $5$ bars. The $5$ bars will "split" the balls into 6 bins. The permutation will always be of the form $${(bin~a)|(bin~b)|(bin~c)|(bin~d)|(bin~e)|(bin~f)}$$ Any permutation of the $N$ stars and $5$ bars will result in a unique solution. The number of ways that it can be arranged where $a, b, c, d, e$ and $f$ non-negative is $N+5choose 5$.
However, this will include cases where the bins can be more than 5. We will need to exclude the cases where $a, b, c, d, e$ or $f$ is greater than 5. This can be achieved by the Principle of Inclusion-Exclusion. We would first subtract the case where only one of $a, b, c, d, e$ or $f$ is greater than 5. This is equivalent to doing the above but with $N-6$ instead of $N$. There are ${6choose 1}$ ways for a bin to be more than 5. Hence you would subtract ${6choose 1}{N-6choose 5}$ from the total number of ways. However in this you will also notice that the case where 2 of the bins is greater than 5 was included twice. You would repeat the steps until the number of ways to have more than 5 balls in $j$ bins become zero.
The general formula would hence be $$sum_{j=0}^{floor(frac{N}{6})} (-1)^jbinom{6}{j}binom{N+5-6j}{5}$$.
$endgroup$
2
$begingroup$
Be careful. Your solution includes those cases in which there are more than five stars in a bin.
$endgroup$
– N. F. Taussig
Dec 17 '18 at 10:24
1
$begingroup$
Oops sorry I will correct it.
$endgroup$
– Sik Feng Cheong
Dec 17 '18 at 11:46
$begingroup$
Still .. another correction to do : the limit of summation is $leftlfloor N/6 rightrfloor $ and not $leftlfloor (N+5)/6 rightrfloor $: See my answer above.
$endgroup$
– G Cab
Dec 17 '18 at 16:57
$begingroup$
Thanks for the correction. forgot that $N+5-6j >= 5$ not $0$
$endgroup$
– Sik Feng Cheong
Dec 17 '18 at 17:26
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2fmath.stackexchange.com%2fquestions%2f3043222%2fcombinatorics-how-many-ways-to-partition-an-integer-n-into-k-bins-with-values%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Your problem in general reads as
$$N_{,b} (s,r,m) = text{No}text{. of solutions to};left{ begin{gathered}
0 leqslant text{integer }x_{,j} leqslant r hfill \
x_{,1} + x_{,2} + cdots + x_{,m} = s hfill \
end{gathered} right.$$
where $N_b$ is expressed through the sum
$$
N_b (s,r,m)quad left| {;0 leqslant text{integers }s,m,r} right.quad =
sumlimits_{left( {0, leqslant } right),,k,,left( { leqslant ,frac{s}{r+1}, leqslant ,m} right)}
{left( { - 1} right)^k binom{m}{k}
binom
{ s + m - 1 - kleft( {r + 1} right) }
{ s - kleft( {r + 1} right)} }
$$
and whose o.g.f. in $s$ is as already suggested by N.F. Taussig
$$
F_b (x,r,m) = sumlimits_{0,, leqslant ,,s,,left( { leqslant ,,r,m} right)} {N_b (s,r,m);x^{,s} }
= left( {1 + x + cdots + x^{,r} } right)^m = left( {frac{{1 - x^{,r + 1} }}{{1 - x}}} right)^m
$$
The above is thoroughly explained in this related post and in this paper.
In your case, you just have to put $m=6,;r=5,; s=N$.
$endgroup$
$begingroup$
Thank you very much. This solves it perfectly. I can use this for analysis immediately although it will take further time to understand it.
$endgroup$
– Emmanuel Uwechue
Dec 17 '18 at 15:11
$begingroup$
@EmmanuelUwechue: glad it helps. A further explanation of how it is built is the "inclusion-exclusion" principle described by S.F. Cheong, which is better grasped if you read the "geometric" interpretation given in the other cited post.
$endgroup$
– G Cab
Dec 17 '18 at 16:51
add a comment |
$begingroup$
Your problem in general reads as
$$N_{,b} (s,r,m) = text{No}text{. of solutions to};left{ begin{gathered}
0 leqslant text{integer }x_{,j} leqslant r hfill \
x_{,1} + x_{,2} + cdots + x_{,m} = s hfill \
end{gathered} right.$$
where $N_b$ is expressed through the sum
$$
N_b (s,r,m)quad left| {;0 leqslant text{integers }s,m,r} right.quad =
sumlimits_{left( {0, leqslant } right),,k,,left( { leqslant ,frac{s}{r+1}, leqslant ,m} right)}
{left( { - 1} right)^k binom{m}{k}
binom
{ s + m - 1 - kleft( {r + 1} right) }
{ s - kleft( {r + 1} right)} }
$$
and whose o.g.f. in $s$ is as already suggested by N.F. Taussig
$$
F_b (x,r,m) = sumlimits_{0,, leqslant ,,s,,left( { leqslant ,,r,m} right)} {N_b (s,r,m);x^{,s} }
= left( {1 + x + cdots + x^{,r} } right)^m = left( {frac{{1 - x^{,r + 1} }}{{1 - x}}} right)^m
$$
The above is thoroughly explained in this related post and in this paper.
In your case, you just have to put $m=6,;r=5,; s=N$.
$endgroup$
$begingroup$
Thank you very much. This solves it perfectly. I can use this for analysis immediately although it will take further time to understand it.
$endgroup$
– Emmanuel Uwechue
Dec 17 '18 at 15:11
$begingroup$
@EmmanuelUwechue: glad it helps. A further explanation of how it is built is the "inclusion-exclusion" principle described by S.F. Cheong, which is better grasped if you read the "geometric" interpretation given in the other cited post.
$endgroup$
– G Cab
Dec 17 '18 at 16:51
add a comment |
$begingroup$
Your problem in general reads as
$$N_{,b} (s,r,m) = text{No}text{. of solutions to};left{ begin{gathered}
0 leqslant text{integer }x_{,j} leqslant r hfill \
x_{,1} + x_{,2} + cdots + x_{,m} = s hfill \
end{gathered} right.$$
where $N_b$ is expressed through the sum
$$
N_b (s,r,m)quad left| {;0 leqslant text{integers }s,m,r} right.quad =
sumlimits_{left( {0, leqslant } right),,k,,left( { leqslant ,frac{s}{r+1}, leqslant ,m} right)}
{left( { - 1} right)^k binom{m}{k}
binom
{ s + m - 1 - kleft( {r + 1} right) }
{ s - kleft( {r + 1} right)} }
$$
and whose o.g.f. in $s$ is as already suggested by N.F. Taussig
$$
F_b (x,r,m) = sumlimits_{0,, leqslant ,,s,,left( { leqslant ,,r,m} right)} {N_b (s,r,m);x^{,s} }
= left( {1 + x + cdots + x^{,r} } right)^m = left( {frac{{1 - x^{,r + 1} }}{{1 - x}}} right)^m
$$
The above is thoroughly explained in this related post and in this paper.
In your case, you just have to put $m=6,;r=5,; s=N$.
$endgroup$
Your problem in general reads as
$$N_{,b} (s,r,m) = text{No}text{. of solutions to};left{ begin{gathered}
0 leqslant text{integer }x_{,j} leqslant r hfill \
x_{,1} + x_{,2} + cdots + x_{,m} = s hfill \
end{gathered} right.$$
where $N_b$ is expressed through the sum
$$
N_b (s,r,m)quad left| {;0 leqslant text{integers }s,m,r} right.quad =
sumlimits_{left( {0, leqslant } right),,k,,left( { leqslant ,frac{s}{r+1}, leqslant ,m} right)}
{left( { - 1} right)^k binom{m}{k}
binom
{ s + m - 1 - kleft( {r + 1} right) }
{ s - kleft( {r + 1} right)} }
$$
and whose o.g.f. in $s$ is as already suggested by N.F. Taussig
$$
F_b (x,r,m) = sumlimits_{0,, leqslant ,,s,,left( { leqslant ,,r,m} right)} {N_b (s,r,m);x^{,s} }
= left( {1 + x + cdots + x^{,r} } right)^m = left( {frac{{1 - x^{,r + 1} }}{{1 - x}}} right)^m
$$
The above is thoroughly explained in this related post and in this paper.
In your case, you just have to put $m=6,;r=5,; s=N$.
edited Dec 17 '18 at 14:17
answered Dec 17 '18 at 12:35
G CabG Cab
19.3k31238
19.3k31238
$begingroup$
Thank you very much. This solves it perfectly. I can use this for analysis immediately although it will take further time to understand it.
$endgroup$
– Emmanuel Uwechue
Dec 17 '18 at 15:11
$begingroup$
@EmmanuelUwechue: glad it helps. A further explanation of how it is built is the "inclusion-exclusion" principle described by S.F. Cheong, which is better grasped if you read the "geometric" interpretation given in the other cited post.
$endgroup$
– G Cab
Dec 17 '18 at 16:51
add a comment |
$begingroup$
Thank you very much. This solves it perfectly. I can use this for analysis immediately although it will take further time to understand it.
$endgroup$
– Emmanuel Uwechue
Dec 17 '18 at 15:11
$begingroup$
@EmmanuelUwechue: glad it helps. A further explanation of how it is built is the "inclusion-exclusion" principle described by S.F. Cheong, which is better grasped if you read the "geometric" interpretation given in the other cited post.
$endgroup$
– G Cab
Dec 17 '18 at 16:51
$begingroup$
Thank you very much. This solves it perfectly. I can use this for analysis immediately although it will take further time to understand it.
$endgroup$
– Emmanuel Uwechue
Dec 17 '18 at 15:11
$begingroup$
Thank you very much. This solves it perfectly. I can use this for analysis immediately although it will take further time to understand it.
$endgroup$
– Emmanuel Uwechue
Dec 17 '18 at 15:11
$begingroup$
@EmmanuelUwechue: glad it helps. A further explanation of how it is built is the "inclusion-exclusion" principle described by S.F. Cheong, which is better grasped if you read the "geometric" interpretation given in the other cited post.
$endgroup$
– G Cab
Dec 17 '18 at 16:51
$begingroup$
@EmmanuelUwechue: glad it helps. A further explanation of how it is built is the "inclusion-exclusion" principle described by S.F. Cheong, which is better grasped if you read the "geometric" interpretation given in the other cited post.
$endgroup$
– G Cab
Dec 17 '18 at 16:51
add a comment |
$begingroup$
You could as suggested by N. F. Taussig use the generating function $(1 + x + x^2 + x^3 + x^4 + x^5)^6$ and the answer will be the coefficient of $x^N$ of the expanded function.
Otherwise This question can be solved using the technique described here
Let there be $N$ stars. Since you want to separate them into $6$ bins, you will need to use $5$ bars. The $5$ bars will "split" the balls into 6 bins. The permutation will always be of the form $${(bin~a)|(bin~b)|(bin~c)|(bin~d)|(bin~e)|(bin~f)}$$ Any permutation of the $N$ stars and $5$ bars will result in a unique solution. The number of ways that it can be arranged where $a, b, c, d, e$ and $f$ non-negative is $N+5choose 5$.
However, this will include cases where the bins can be more than 5. We will need to exclude the cases where $a, b, c, d, e$ or $f$ is greater than 5. This can be achieved by the Principle of Inclusion-Exclusion. We would first subtract the case where only one of $a, b, c, d, e$ or $f$ is greater than 5. This is equivalent to doing the above but with $N-6$ instead of $N$. There are ${6choose 1}$ ways for a bin to be more than 5. Hence you would subtract ${6choose 1}{N-6choose 5}$ from the total number of ways. However in this you will also notice that the case where 2 of the bins is greater than 5 was included twice. You would repeat the steps until the number of ways to have more than 5 balls in $j$ bins become zero.
The general formula would hence be $$sum_{j=0}^{floor(frac{N}{6})} (-1)^jbinom{6}{j}binom{N+5-6j}{5}$$.
$endgroup$
2
$begingroup$
Be careful. Your solution includes those cases in which there are more than five stars in a bin.
$endgroup$
– N. F. Taussig
Dec 17 '18 at 10:24
1
$begingroup$
Oops sorry I will correct it.
$endgroup$
– Sik Feng Cheong
Dec 17 '18 at 11:46
$begingroup$
Still .. another correction to do : the limit of summation is $leftlfloor N/6 rightrfloor $ and not $leftlfloor (N+5)/6 rightrfloor $: See my answer above.
$endgroup$
– G Cab
Dec 17 '18 at 16:57
$begingroup$
Thanks for the correction. forgot that $N+5-6j >= 5$ not $0$
$endgroup$
– Sik Feng Cheong
Dec 17 '18 at 17:26
add a comment |
$begingroup$
You could as suggested by N. F. Taussig use the generating function $(1 + x + x^2 + x^3 + x^4 + x^5)^6$ and the answer will be the coefficient of $x^N$ of the expanded function.
Otherwise This question can be solved using the technique described here
Let there be $N$ stars. Since you want to separate them into $6$ bins, you will need to use $5$ bars. The $5$ bars will "split" the balls into 6 bins. The permutation will always be of the form $${(bin~a)|(bin~b)|(bin~c)|(bin~d)|(bin~e)|(bin~f)}$$ Any permutation of the $N$ stars and $5$ bars will result in a unique solution. The number of ways that it can be arranged where $a, b, c, d, e$ and $f$ non-negative is $N+5choose 5$.
However, this will include cases where the bins can be more than 5. We will need to exclude the cases where $a, b, c, d, e$ or $f$ is greater than 5. This can be achieved by the Principle of Inclusion-Exclusion. We would first subtract the case where only one of $a, b, c, d, e$ or $f$ is greater than 5. This is equivalent to doing the above but with $N-6$ instead of $N$. There are ${6choose 1}$ ways for a bin to be more than 5. Hence you would subtract ${6choose 1}{N-6choose 5}$ from the total number of ways. However in this you will also notice that the case where 2 of the bins is greater than 5 was included twice. You would repeat the steps until the number of ways to have more than 5 balls in $j$ bins become zero.
The general formula would hence be $$sum_{j=0}^{floor(frac{N}{6})} (-1)^jbinom{6}{j}binom{N+5-6j}{5}$$.
$endgroup$
2
$begingroup$
Be careful. Your solution includes those cases in which there are more than five stars in a bin.
$endgroup$
– N. F. Taussig
Dec 17 '18 at 10:24
1
$begingroup$
Oops sorry I will correct it.
$endgroup$
– Sik Feng Cheong
Dec 17 '18 at 11:46
$begingroup$
Still .. another correction to do : the limit of summation is $leftlfloor N/6 rightrfloor $ and not $leftlfloor (N+5)/6 rightrfloor $: See my answer above.
$endgroup$
– G Cab
Dec 17 '18 at 16:57
$begingroup$
Thanks for the correction. forgot that $N+5-6j >= 5$ not $0$
$endgroup$
– Sik Feng Cheong
Dec 17 '18 at 17:26
add a comment |
$begingroup$
You could as suggested by N. F. Taussig use the generating function $(1 + x + x^2 + x^3 + x^4 + x^5)^6$ and the answer will be the coefficient of $x^N$ of the expanded function.
Otherwise This question can be solved using the technique described here
Let there be $N$ stars. Since you want to separate them into $6$ bins, you will need to use $5$ bars. The $5$ bars will "split" the balls into 6 bins. The permutation will always be of the form $${(bin~a)|(bin~b)|(bin~c)|(bin~d)|(bin~e)|(bin~f)}$$ Any permutation of the $N$ stars and $5$ bars will result in a unique solution. The number of ways that it can be arranged where $a, b, c, d, e$ and $f$ non-negative is $N+5choose 5$.
However, this will include cases where the bins can be more than 5. We will need to exclude the cases where $a, b, c, d, e$ or $f$ is greater than 5. This can be achieved by the Principle of Inclusion-Exclusion. We would first subtract the case where only one of $a, b, c, d, e$ or $f$ is greater than 5. This is equivalent to doing the above but with $N-6$ instead of $N$. There are ${6choose 1}$ ways for a bin to be more than 5. Hence you would subtract ${6choose 1}{N-6choose 5}$ from the total number of ways. However in this you will also notice that the case where 2 of the bins is greater than 5 was included twice. You would repeat the steps until the number of ways to have more than 5 balls in $j$ bins become zero.
The general formula would hence be $$sum_{j=0}^{floor(frac{N}{6})} (-1)^jbinom{6}{j}binom{N+5-6j}{5}$$.
$endgroup$
You could as suggested by N. F. Taussig use the generating function $(1 + x + x^2 + x^3 + x^4 + x^5)^6$ and the answer will be the coefficient of $x^N$ of the expanded function.
Otherwise This question can be solved using the technique described here
Let there be $N$ stars. Since you want to separate them into $6$ bins, you will need to use $5$ bars. The $5$ bars will "split" the balls into 6 bins. The permutation will always be of the form $${(bin~a)|(bin~b)|(bin~c)|(bin~d)|(bin~e)|(bin~f)}$$ Any permutation of the $N$ stars and $5$ bars will result in a unique solution. The number of ways that it can be arranged where $a, b, c, d, e$ and $f$ non-negative is $N+5choose 5$.
However, this will include cases where the bins can be more than 5. We will need to exclude the cases where $a, b, c, d, e$ or $f$ is greater than 5. This can be achieved by the Principle of Inclusion-Exclusion. We would first subtract the case where only one of $a, b, c, d, e$ or $f$ is greater than 5. This is equivalent to doing the above but with $N-6$ instead of $N$. There are ${6choose 1}$ ways for a bin to be more than 5. Hence you would subtract ${6choose 1}{N-6choose 5}$ from the total number of ways. However in this you will also notice that the case where 2 of the bins is greater than 5 was included twice. You would repeat the steps until the number of ways to have more than 5 balls in $j$ bins become zero.
The general formula would hence be $$sum_{j=0}^{floor(frac{N}{6})} (-1)^jbinom{6}{j}binom{N+5-6j}{5}$$.
edited Dec 17 '18 at 17:25
answered Dec 17 '18 at 9:55
Sik Feng CheongSik Feng Cheong
1579
1579
2
$begingroup$
Be careful. Your solution includes those cases in which there are more than five stars in a bin.
$endgroup$
– N. F. Taussig
Dec 17 '18 at 10:24
1
$begingroup$
Oops sorry I will correct it.
$endgroup$
– Sik Feng Cheong
Dec 17 '18 at 11:46
$begingroup$
Still .. another correction to do : the limit of summation is $leftlfloor N/6 rightrfloor $ and not $leftlfloor (N+5)/6 rightrfloor $: See my answer above.
$endgroup$
– G Cab
Dec 17 '18 at 16:57
$begingroup$
Thanks for the correction. forgot that $N+5-6j >= 5$ not $0$
$endgroup$
– Sik Feng Cheong
Dec 17 '18 at 17:26
add a comment |
2
$begingroup$
Be careful. Your solution includes those cases in which there are more than five stars in a bin.
$endgroup$
– N. F. Taussig
Dec 17 '18 at 10:24
1
$begingroup$
Oops sorry I will correct it.
$endgroup$
– Sik Feng Cheong
Dec 17 '18 at 11:46
$begingroup$
Still .. another correction to do : the limit of summation is $leftlfloor N/6 rightrfloor $ and not $leftlfloor (N+5)/6 rightrfloor $: See my answer above.
$endgroup$
– G Cab
Dec 17 '18 at 16:57
$begingroup$
Thanks for the correction. forgot that $N+5-6j >= 5$ not $0$
$endgroup$
– Sik Feng Cheong
Dec 17 '18 at 17:26
2
2
$begingroup$
Be careful. Your solution includes those cases in which there are more than five stars in a bin.
$endgroup$
– N. F. Taussig
Dec 17 '18 at 10:24
$begingroup$
Be careful. Your solution includes those cases in which there are more than five stars in a bin.
$endgroup$
– N. F. Taussig
Dec 17 '18 at 10:24
1
1
$begingroup$
Oops sorry I will correct it.
$endgroup$
– Sik Feng Cheong
Dec 17 '18 at 11:46
$begingroup$
Oops sorry I will correct it.
$endgroup$
– Sik Feng Cheong
Dec 17 '18 at 11:46
$begingroup$
Still .. another correction to do : the limit of summation is $leftlfloor N/6 rightrfloor $ and not $leftlfloor (N+5)/6 rightrfloor $: See my answer above.
$endgroup$
– G Cab
Dec 17 '18 at 16:57
$begingroup$
Still .. another correction to do : the limit of summation is $leftlfloor N/6 rightrfloor $ and not $leftlfloor (N+5)/6 rightrfloor $: See my answer above.
$endgroup$
– G Cab
Dec 17 '18 at 16:57
$begingroup$
Thanks for the correction. forgot that $N+5-6j >= 5$ not $0$
$endgroup$
– Sik Feng Cheong
Dec 17 '18 at 17:26
$begingroup$
Thanks for the correction. forgot that $N+5-6j >= 5$ not $0$
$endgroup$
– Sik Feng Cheong
Dec 17 '18 at 17:26
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
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%2fmath.stackexchange.com%2fquestions%2f3043222%2fcombinatorics-how-many-ways-to-partition-an-integer-n-into-k-bins-with-values%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
4
$begingroup$
If you are familiar with generating functions, you want the coefficient of $N$ in the expansion of $(1 + x + x^2 + x^3 + x^4 + x^5)^6$.
$endgroup$
– N. F. Taussig
Dec 16 '18 at 22:13
2
$begingroup$
This is equivalent to asking how many ways there are to roll $n$ with $k$ dice, see math.stackexchange.com/questions/970523/…
$endgroup$
– Mike Earnest
Dec 16 '18 at 22:17