Presents for all!

There are 4 4 children awaiting their presents. 7 7 elves come one-by-one and each of them gives 1 1 present to exactly 1 1 child. Every elf chooses the child randomly.

The probability that each child receives at least one present is of the form A B \dfrac{A}{B} where A A and B B are co-prime positive integers. Find the value of B A . B-A.

Assumptions \textbf{Assumptions}

  • Each elf has a different present.


The answer is 499.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

4 solutions

I'll assume that each elf has a different present, so essentially we are looking for the probability that, when 7 7 distinct presents are distributed at random to 4 4 children, each child receives at least one present.

Now without restrictions the 7 7 presents can be distributed in 4 7 = 16384 4^{7} = 16384 ways. To find the number of ways in which each child receives at least one present, I will first find the number of ways in which just 1 , 2 1, 2 and 3 3 children get all the presents, and then subtract the sum of these values from 4 7 4^{7} .

There are 4 4 ways to distribute the presents so that all the presents go to one child.

There are ( 4 2 ) ( 2 7 2 ) = 756 \binom{4}{2} * (2^{7} - 2) = 756 ways in which all the presents can be distributed to just 2 2 children. That is, we can choose 2 2 of the children in ( 4 2 ) \binom{4}{2} ways, and then in each of these cases there are 2 7 2^{7} ways in which the presents can be distributed, 2 2 of which would result in all the presents going to just one child, (hence the need to subtract 2 2 from 2 7 2^{7} ).

There are ( 4 3 ) [ 3 7 3 ( 3 2 ) ( 2 7 2 ) ] = 7224 \binom{4}{3}*[3^{7} - 3 - \binom{3}{2}(2^{7} - 2)] = 7224 ways in which all the presents can be distributed to just 3 3 children. That is, we can choose 3 3 of the children in ( 4 3 ) \binom{4}{3} ways, and then in each of these cases there are 3 7 3^{7} ways in which the presents can be distributed, 3 3 of which would result in all the presents going to just one child, and ( 3 2 ) ( 2 7 2 ) \binom{3}{2}(2^{7} - 2) of which would result in all the presents going to just two children, (where each of the two would receive at least one present).

Thus the number of ways in which the presents can be distributed so that each child gets at least one present is 16384 4 756 7224 = 8400 16384 - 4 - 756 - 7224 = 8400 .

The desired probability is then 8400 16384 = 525 1024 \dfrac{8400}{16384} = \dfrac{525}{1024} .

Thus A = 525 , B = 1024 A = 525, B = 1024 and B A = 499 B - A = \boxed{499} .

(Apologies for my long-winded explanation, but this problem is easy to mess up on so I felt the need to be as deliberate as possible.)

The probability that every child gets a gift is not dependent on whether or not the gifts are different from each other. Thinking they are makes it easier for us to see the problem, but it does not change the outcome.

Marta Reece - 4 years, 5 months ago
Abhishek Sinha
Nov 22, 2014

An easier way to solve the problem is to use the principle of inclusion and exclusion .

For this, let A i A_i be the event that the i i th child does not receive any present, i = 1 , 2 , 3 , 4 i=1,2,3,4 . We require the probability of the complement of the event E = A 1 A 2 A 3 A 4 E=A_1\cup A_2\cup A_3 \cup A_4 . We have, P ( A 1 A 2 A 3 A 4 ) = i = 1 4 P ( A i ) 1 i < j 4 P ( A i A j ) + 1 i < j < k 4 P ( A i A j A k ) P ( A 1 A 2 A 3 A 4 ) \mathbb{P}( A_1\cup A_2\cup A_3 \cup A_4)=\sum_{i=1}^{4}\mathbb{P}(A_i)- \sum_{1\leq i<j\leq 4}\mathbb{P}(A_i\cap A_j)+ \\\sum_{1\leq i<j<k\leq 4}\mathbb{P}(A_i\cap A_j\cap A_k)- \mathbb{P}(A_1\cap A_2\cap A_3 \cap A_4) = 4 ( 3 4 ) 7 ( 4 2 ) ( 2 4 ) 7 + ( 4 3 ) ( 1 4 ) 7 0 = 499 1024 =4 \big(\frac{3}{4}\big)^7-\binom{4}{2}\big(\frac{2}{4}\big)^7 + \binom{4}{3}\big(\frac{1}{4}\big)^7-0 = \frac{499}{1024} where each of the above probability terms should be self-explanatory. Thus the required probability is 1 499 1024 = 525 1024 1-\frac{499}{1024}=\frac{525}{1024} .

Stephen Tosh
Oct 20, 2014

Say you are watching the elves come one-by-one, and are counting how many children have gifts after each one has come.

If there is currently 1 child with a present, then there is a 1 4 \frac{1}{4} chance that the next elf will give the present to that child, and a 3 4 \frac{3}{4} chance that the elf will give the present to a new child.

If there are currently 2 children with presents, then there is a 2 4 \frac{2}{4} chance that the next present will go to a child who already has a present, and a 2 4 \frac{2}{4} chance it will go to a new child.

Similarly, with 3 children, the chance of one of them receiving the next present is 3 4 \frac{3}{4} and the chance of the present going to the last child 1 4 \frac{1}{4} . If all 4 children have presents, then a new present will not change the number of children with presents.

We summarize these results in this matrix. [ 1 4 0 0 0 3 4 2 4 0 0 0 2 4 3 4 0 0 0 1 4 1 ] \begin{bmatrix} \frac{1}{4} & 0 & 0 & 0 \\ \frac{3}{4} & \frac{2}{4} & 0 & 0 \\ 0 & \frac{2}{4} & \frac{3}{4} & 0 \\ 0 & 0 & \frac{1}{4} & 1 \end{bmatrix} Now say we know the probabilities p n p_n that n n children have a present at some point, n = 1 , 2 , 3 , 4 n=1,2,3,4 . We can use the matrix to calculate the probabilities after the next elf by the following multiplication. [ 1 4 0 0 0 3 4 2 4 0 0 0 2 4 3 4 0 0 0 1 4 1 ] [ p 1 p 2 p 3 p 4 ] = [ 1 4 p 1 3 4 p 1 + 2 4 p 2 2 4 p 2 + 3 4 p 3 1 4 p 3 + p 4 ] \begin{bmatrix} \frac{1}{4} & 0 & 0 & 0 \\ \frac{3}{4} & \frac{2}{4} & 0 & 0 \\ 0 & \frac{2}{4} & \frac{3}{4} & 0 \\ 0 & 0 & \frac{1}{4} & 1 \end{bmatrix}\begin{bmatrix} p_1 \\ p_2 \\ p_3 \\ p_4 \end{bmatrix}=\begin{bmatrix} \frac{1}{4}p_1 \\ \frac{3}{4}p_1 + \frac{2}{4}p_2 \\ \frac{2}{4}p_2 + \frac{3}{4}p_3 \\ \frac{1}{4}p_3 + p_4 \end{bmatrix} We know that after the first elf has come, exactly 1 child has a present. Therefore, the probability of n n children having a present after 6 more elves come is [ 1 4 0 0 0 3 4 2 4 0 0 0 2 4 3 4 0 0 0 1 4 1 ] 6 [ 1 0 0 0 ] = [ 1 4096 189 4096 1806 4096 2100 4096 ] \begin{bmatrix} \frac{1}{4} & 0 & 0 & 0 \\ \frac{3}{4} & \frac{2}{4} & 0 & 0 \\ 0 & \frac{2}{4} & \frac{3}{4} & 0 \\ 0 & 0 & \frac{1}{4} & 1 \end{bmatrix}^6\begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix}=\begin{bmatrix} \frac{1}{4096} \\ \frac{189}{4096} \\ \frac{1806}{4096} \\ \frac{2100}{4096} \end{bmatrix} The probability of 4 children each having at least one present is 2100 4096 = 525 1024 \dfrac{2100}{4096}=\dfrac{525}{1024} .

This gives A = 525 A=525 , B = 1024 B=1024 , and B A = 499 B-A=\boxed{499} .

wow!!! I am seeing a solution using matrices for the first time on Brilliant.

Mayank Khetan - 6 years, 7 months ago
Prakhar Bindal
Nov 2, 2016

Total number of distributions is 4^7

Now will use the concept of grouping

The possible number of gifts that can be distributed to each child such that each gets atleast one are

(4,1,1,1) (3,2,1,1)(2,2,2,1)

Using the grouping formula we can find the number of ways of grouping which will be 350.

Now these groups can be distributed among children is 24 ways.

So our answer is 24*350/4^7

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...