# Solution to Hannah’s Sweets Viral Probability Problem

A probability problem which is GCSE takers find it “unfair” went viral on Twitter after students tweets about this “Hanna’s Sweets” problem. This post will enlighten the students and everyone who wanted to know the solution.

Mathematics problems seldom made its way to the trending topic in social media. Recently, grade 5 olympiad problem about Cheryl’s birthday hit the internet like a storm. Now, my favorite topic, probability.

The problem says,

Let us show elementary solution to the problem so that everyone would be able to understand it.

Since there are n sweets and 6 of them are orange, the probability of obtaining the first sweet is $\dfrac{6}{n}$. (6 possibilities out of n total number of sweets).

Now, since Hanna has taken 1 orange sweet, there are only 5 orange sweets remaining. Also, the total number of sweets from n must become n-1 since 1 sweet was removed.

In her second time taking an orange sweet, the probability must be $\dfrac{5}{n-1}$. (5 possibilities out of n-1 total sweets).

The total probability in obtaining 2 consecutive orange sweets can be found by multiplying the individual probabilities solved. Thus, $P=\dfrac{6}{n}\cdot \dfrac{5}{n-1}$ $P=\dfrac{30}{n(n-1)}$ $P=\dfrac{30}{n^2-n}$

Going back to the problem, we are given by the total probability for this event which is 1/3. This means that the expression at the top in terms of n is equal to 1/3. $\dfrac{30}{n^2-n}=\dfrac{1}{3}$

By cross multiplication, $30\cdot 3=n^2-n$ $90=n^2-n$ $\boxed{n^2-n-90=0}$

Another solution(the practical approach):

Let’s think of taking 2 oranges from n total number of sweets. The number of ways to choose 2 sweets from n sweets can be solved as follows, $_nC_2=\dfrac{n!}{(n-2)!2!}$ $_nC_2=\dfrac{n(n-1)(n-2)!}{(n-2)!2!}$ $_nC_2=\dfrac{n(n-1)}{2}$

The total ways to choosing 2 orange sweets from 6 orange sweets can be solved as follows, $_6C_2=\dfrac{6!}{(6-2)!2!}$ $_6C_2=\dfrac{6!}{4!2!)}$ $_6C_2=\dfrac{6\cdot 5}{2}$ $_6C_2=15$

The desired probability is, $P=\dfrac{15}{\dfrac{n(n-1)}{2}}$ $P=15\cdot\dfrac{2}{n(n-1)}$ $P=\dfrac{30}{n(n-1)}$

Since this probability is equal to 1/3 we have, $\dfrac{1}{3}=\dfrac{30}{n(n-1)}$

By cross multiplication, $n(n-1)=90$ $n^2-n=90$ $\boxed{n^2-n-90=0}$

Now, if you want to find the number of yellow sweets. Solve for n using factoring. Subtract the number of orange sweets(6) from the total number of sweets(n).

To give you an idea, there are 10 total number of sweets where 4 of them are yellow and 6 of them are orange.