# Thread: 15 blueberries and 6 pancakes problem

1. ## 15 blueberries and 6 pancakes problem

My kids had this question and I was and remain stumped: You have 15 blueberries and will make 6 pancakes. What is the probability that each pancake will have at least two blueberries?

I know we need to find the probability of zero or one blueberry and subtract that from 1 to get the probability of "at least 2." But that's about it. Can someone please help and explain to me how to do this? I'm pretty sure this is a combinatorics problem, but it's been a while since I was in college. :/

Thank you!

2. ## Re: 15 blueberries and 6 pancakes problem

Let's break it down into outcomes. We have 15 blueberries (we will represent them by .) We have six pancakes. We want to create strings that will represent the distribution of blueberries onto pancakes. We will use | for a divider. So, the following string:
...............|||||
means the first pancake has 15 blueberries and the remaining five have 0.

..|..|..|..|..|.....
means the first five pancakes each have 2 blueberries and the last one has 5.

Using this method, we can represent every outcome exactly once. So, the total number of possible outcomes is the number of ways to permute ...............|||||. There are 20 symbols. If we permute just the |'s, the remaining spots must all be .'s. There are

$$\dbinom{20}{5}$$

total outcomes. Next, we want to find the number of outcomes where every pancake has at least two blueberries. We place 2 blueberries on each pancake. This leaves 3 blueberries we have left to distribute. We want the number of permutations of ...||||| to find the number of ways to distribute the remaining blueberries:

$$\dbinom{8}{5}$$

So, the probability that every pancake will wind up with at least two blueberries is:

$$\dfrac{ \dbinom{8}{5} }{ \dbinom{20}{5} } = \dfrac{\tfrac{8!}{3!5!}}{\tfrac{20!}{15!5!}}$$

3. ## Re: 15 blueberries and 6 pancakes problem

*slaps forehead* It's so simple when you put it like that! Thank you so much!!

4. ## Re: 15 blueberries and 6 pancakes problem

I worked it out, and it comes to ~5.8%. Wouldn't it be 1 minus that to get the probability at least 2 blueberries per pancake?

5. ## Re: 15 blueberries and 6 pancakes problem

Originally Posted by Soop
*slaps forehead* It's so simple when you put it like that! Thank you so much!!
That is only one possible solution. That assumes every outcome has an equal probability if occurring. If the blueberries are randomly distributed among the pancakes, then the outcomes are not equally likely. In that case, we would calculate the probability as follows:
Probability that at least one pancake has no blueberries:
$$\dbinom{6}{1}\left(\dfrac{5}{6}\right)^{15} - \dbinom{6}{2}\left(\dfrac{4}{6} \right)^{15} + \dbinom{6}{3}\left( \dfrac{3}{6} \right)^{15} - \dbinom{6}{4}\left( \dfrac{2}{6}\right)^{15} + \dbinom{6}{5} \left( \dfrac{1}{6} \right)^{15}$$

Probability that at least one pancake has exactly one blueberry:
$$\dbinom{6}{1}\left( \dfrac{1}{6} \right) \left( \dfrac{5}{6} \right)^{14} - \dbinom{6}{2}\left( \dfrac{1}{6} \right)^2 \left( \dfrac{4}{6} \right)^{13} + \dbinom{6}{3}\left( \dfrac{1}{6} \right)^3 \left( \dfrac{3}{6} \right)^{12} - \dbinom{6}{4} \left( \dfrac{1}{6} \right)^4\left( \dfrac{2}{6} \right)^{11} + \dbinom{6}{5} \left( \dfrac{1}{6}\right)^{15}$$

Probability that at least one pancake has 0 or exactly 1 blueberry:
\begin{align*}\dbinom{6}{1}\left( \dfrac{5}{6} \right)^{15} & + \dbinom{6}{1}\left( \dfrac{1}{6} \right) \left( \dfrac{5}{6} \right)^{14} \\ & - \dbinom{6}{2}\dbinom{2}{0}\left( \dfrac{4}{6} \right)^{15} \\ & - \dbinom{6}{2}\dbinom{2}{1} \left( \dfrac{1}{6} \right) \left( \dfrac{4}{6} \right)^{14} \\ & - \dbinom{6}{2}\dbinom{2}{2}\left( \dfrac{1}{6} \right)^2\left( \dfrac{4}{6} \right)^{13} \\ & + \dbinom{6}{3}\dbinom{3}{0}\left( \dfrac{3}{6} \right)^{15} \\ & + \dbinom{6}{3}\dbinom{3}{1}\left( \dfrac{1}{6} \right)\left( \dfrac{3}{6} \right)^{14} \\ & + \dbinom{6}{3}\dbinom{3}{2}\left( \dfrac{1}{6} \right)^2\left( \dfrac{3}{6} \right)^{13} \\ & + \dbinom{6}{3}\dbinom{3}{3}\left( \dfrac{1}{6} \right)^3 \left( \dfrac{3}{6} \right)^{12} \\ & - \dbinom{6}{4}\dbinom{4}{0}\left( \dfrac{2}{6} \right)^{15} \\ & - \dbinom{6}{4}\dbinom{4}{1}\left( \dfrac{1}{6} \right)\left( \dfrac{2}{6} \right)^{14} \\ & - \dbinom{6}{4} \dbinom{4}{2}\left( \dfrac{1}{6} \right)^2\left( \dfrac{2}{6} \right)^{13} \\ & - \dbinom{6}{4} \dbinom{4}{3} \left( \dfrac{1}{6} \right)^3 \left( \dfrac{2}{6} \right)^{12} \\ & - \dbinom{6}{4} \dbinom{4}{4} \left( \dfrac{1}{6} \right)^4 \left( \dfrac{2}{6} \right)^{11} \\ & + \dbinom{6}{5}\left( \dbinom{5}{0} + \dbinom{5}{1} + \dbinom{5}{2} + \dbinom{5}{3} + \dbinom{5}{4} + \dbinom{5}{5} \right) \left( \dfrac{1}{6} \right)^{15} \\ & = \sum_{i=1}^5 \sum_{j=0}^i (-1)^{i+1}\dbinom{6}{i}\dbinom{i}{j}\left( \dfrac{1}{6} \right)^j \left( \dfrac{6-i}{6} \right)^{15-j}\end{align*}

You want the complement of that (1 minus that):
http://www.wolframalpha.com/input/?i...%7Bi,1,5%7D%5D

This is a very different outcome to the first solution, though. This is the outcome if the blueberries are randomly distributed. The first solution only finds the probability that an outcome occurs if all outcomes have equal probabilities (which does not occur when the blueberries are randomly distributed).

6. ## Re: 15 blueberries and 6 pancakes problem

You lost me here: "That assumes every outcome has an equal probability if occurring. If the blueberries are randomly distributed among the pancakes, then the outcomes are not equally likely."

Why are the outcomes no longer equally likely if the blueberries are randomly distributed? According to the Wolfram equation, the probability of at least 2 blueberries on each pancake is less than 60%. That doesn't sound right to me.

Is the complement of the first solution you presented not correct?

7. ## Re: 15 blueberries and 6 pancakes problem

Originally Posted by Soop
I worked it out, and it comes to ~5.8%. Wouldn't it be 1 minus that to get the probability at least 2 blueberries per pancake?
With all outcomes having equal probability (the first solution), that already was the probability of every pancake getting at least two blueberries
$$\dfrac{\tfrac{8!}{5!3!}}{\tfrac{20!}{15!5!}} = \dfrac{8!15! \cancel{5!} }{20! \cancel{5!} 3!} = \dfrac{8!15!}{20!3!} = \dfrac{8!}{3!} \dfrac{15!}{20!} = \dfrac{8\cdot 7\cdot 6\cdot 5\cdot 4}{1} \dfrac{1}{20\cdot 19\cdot 18\cdot 17\cdot 16} \approx 0.36\%$$

8. ## Re: 15 blueberries and 6 pancakes problem

Originally Posted by Soop
You lost me here: "That assumes every outcome has an equal probability if occurring. If the blueberries are randomly distributed among the pancakes, then the outcomes are not equally likely."

Why are the outcomes no longer equally likely if the blueberries are randomly distributed? According to the Wolfram equation, the probability of at least 2 blueberries on each pancake is less than 60%. That doesn't sound right to me.

Is the complement of the first solution you presented not correct?
No, the complement of the first solution is not correct. The first solution says that every pancake will have at least two blueberries with probability about 0.36% of the time.
The second solution (which is probably more accurate) says that every pancake will have at least two blueberries with probability about 58.5%. That is a "better" estimate, as it assumes the blueberries are randomly distributed.
If you randomly distribute the blueberries, then the probability of this outcome:
...............|||||
is FAR less likely than the probability of this outcome:
..|..|..|..|..|.....

My first solution treats those two outcomes as equally probable.

9. ## Re: 15 blueberries and 6 pancakes problem

If you want to model this for figuring it out where the blueberries are randomly distributed, you have 15 random variables (the blueberries) getting assigned to one of six pancakes (numbers 1 through 6). The total sample space is $6^{15}$. So, a single outcome may look like this:
(3,4,1,6,3,6,5,2,6,2,6,5,1,6,4)
This yields the outcome:
..|..|..|..|..|..... (a valid outcome)
Another outcome:
(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
yields this:
...............|||||

The probability of the first occurring is:
$$\dfrac{\dfrac{15!}{2!2!2!2!2!5!}}{6^{15}} \approx 0.72\%$$

The probability of the second occurring is:
$$\dfrac{1}{6^{15}} \approx 2.13\times 10^{-10}\%$$

This clearly shows that if the blueberries are randomly distributed among the pancakes, the outcomes found in solution #1 are not equally probable.

10. ## Re: 15 blueberries and 6 pancakes problem

Originally Posted by Soop
My kids had this question and I was and remain stumped: You have 15 blueberries and will make 6 pancakes. What is the probability that each pancake will have at least two blueberries?
I hope that this is not of the methods already given.
We can just think of putting two of the 15 blueberries on each of the pancakes. Now each pancake has at least two berries.
So we have three blueberries left. How many ways can we put three objects into six cells?
$\dfrac{\dbinom{3+6-1}{3}}{\dbinom{15+6-1}{15}}$

11. ## Re: 15 blueberries and 6 pancakes problem

Originally Posted by Plato
I hope that this is not of the methods already given.
We can just think of putting two of the 15 blueberries on each of the pancakes. Now each pancake has at least two berries.
So we have three blueberries left. How many ways can we put three objects into six cells?
$\dfrac{\dbinom{3+6-1}{3}}{\dbinom{15+6-1}{15}}$
This was the first method given. Apparently my second method was flawed.

Here is a test to see how accurate we are:
Open Excel
In cell A1, put the formula =RANDBETWEEN(1,6)
Copy that formula to cells B1 through O1 (15 columns worth).
This represents which pancake a blueberry winds up in.
In Q1, put the formula =COUNTIF(A1:O1,1)
In R1, put the formula =COUNTIF(A1:O1,2)
In S1, put the formula =COUNTIF(A1:O1,3)
T1: =COUNTIF(A1:O1,4)
U1: =COUNTIF(A1:O1,5)
V1: =COUNTIF(A1:O1,6)

In cell X1, put the formula =COUNTIF(Q1:V1,"<2")=0

Copy this row for 1000 lines. Now, check how many times you get a TRUE in column X and divide by 1000. That should be approximately the probability. It comes to about 8%.

12. ## Re: 15 blueberries and 6 pancakes problem

R to the rescue!
I ran this code to calculate the probability:

prob <- 0
for(a in 2:5) {
for(b in 2: (7-a)) {
for(c in 2: (9-a-b)) {
for(d in 2: (11-a-b-c)) {
for(e in 2: (13-a-b-c-d)) {
f <- 15-a-b-c-d-e
prob <- prob + factorial(15)/(factorial(a)*factorial(b)*factorial(c)*factorial( d)*factorial(e)*factorial(f))
} } } } }
prob/6^15

What this does: a-f are the number of blueberries in pancake 1-6 respectively.
$\dfrac{15!}{a!b!c!d!e!f!}$ is the number of ways of getting the specific numbers of blueberries when the blueberries are randomly distributed (so each blueberry can go into any one of the six pancakes with equal probability).

Written out in math code:
$$\dfrac{1}{6^{15}}\sum_{a_1=2}^5 \sum_{a_2=2}^{7-a_1} \sum_{a_3=2}^{9-a_1-a_2} \sum_{a_4=2}^{11-a_1-a_2-a_3} \sum_{a_5=2}^{13-a_1-a_2-a_3-a_4} \dfrac{15!}{a_1!a_2!a_3!a_4!a_5!(15-a_1-a_2-a_3-a_4-a_5)!} \approx 7.27\%$$

Yeah, this solution is definitely not the correct solution for a 5th grade math class. The solution they are looking for (which is only dubiously meaningful) is the 0.36% found from my first method and Plato's method.

While this is not a proof, I do have some evidence that this works:

$$\dfrac{1}{6^{15}}\sum_{\displaystyle \begin{matrix}\sum_{i=1}^6 a_i = 15 \\ \forall i, a_i \in \mathbb{Z} \\ \forall i, a_i \ge 0\end{matrix} } \dfrac{15!}{\displaystyle \prod_{i=1}^6 (a_i)! } = 1$$