How many ways are there to pass out 20 pencils (assume all the pencils are identical the same) to six children?
Based on the following condition:
a) No restriction. ( i.e. each kid may receive zero to 20 pencils.)
b) Every child receives at least one pencil.
c) None of child receives the same number of pencils.
d) If the pencils are given out randomly. What is the probability that there are at least two kids receive the same number of pencils if every kids receives at least one pencil?
I have calculated a) using C(25,20) = 53,130
I calculated b) using C(19,14) = 11,628
for c) I get answer 840 using the following program
class final34{
public static void main(String[] args){
int u,v,x,y,z;
int count = 0;
int last=0;
for(u =1;u<11;u++){
for(v = 1;v<11; v++)
if(u!=v)
for(x = 1;x<11;x++)
if(x!=u && x!=v)
for(y = 1; y<11;y++)
if(y!=u && y!=v && y!=x)
for(z=1;z<11;z++)
if(z!=u && z!=v && z!=x && z!=y)
if(u+v+x+y+z == 20){
System.out.println(u+" "+v+" "+x+" "+y+" "+z);
count++;
}
System.out.println("Count after iteration "+u+": "+(count-last));
last = count;
}
System.out.println("Total Count: "+count);
}
}
I see the output:
Count after iteration 1: 144
Count after iteration 2: 144
Count after iteration 3: 120
Count after iteration 4: 120
Count after iteration 5: 96
Count after iteration 6: 72
Count after iteration 7: 48
Count after iteration 8: 48
Count after iteration 9: 24
Count after iteration 10: 24
Total Count: 840
But I don't know how to prove this using discrete mathematics.
Also I need help on d).
I realized that there is no way to generalize the answer for question c). it needs a special solution.
First of all, out of 6 children, 1 child has to get 0 pencils. After that 5 children are remaining. So, there are just 7 ways to distribute 20 pencils among them, which are:
(1,2,3,4,10)
(1,2,3,5,9)
(1,2,3,6,8)
(1,2,4,5,8)
(1,2,4,6,7)
(1,3,4,5,7)
(2,3,4,5,6)
Now, with these 7 cases, there are 5! ways to arrange them in order.
Therefore, we get 120*7 = 840 ways.
So, 840*6 = 5040 is the final answer.
I could found the first 5 cases by myself, but, as anyone can see that the last two cases are too far and so many cases need to be checked before one can figure those two out. that's why I used a program to compute these. I am also providing that here so that it is helpful for others.