Problem (Combinatorics):
A bag contains 40 balls, each of which is black or gold. Feridun reaches into the bag and randomly removes two balls. Each ball in the bag is equally likely to be removed. If the probability that two gold balls are removed is $\frac{5}{12}$, how many of the 40 balls are gold?

Solution:
Suppose that the bag contains $g$ gold balls.

We assume that Feridun reaches into the bag and removes the two balls one after the other.

There are 40 possible balls that he could remove first and then 39 balls that he could remove second. In total, there are 40(39) pairs of balls that he could choose in this way.

If he removes 2 gold balls, then there are $g$ possible balls that he could remove first and then $g-1$ balls that he could remove second. In total, there are $g(g-1)$ pairs of gold balls that he could remove.

We are told that the probability of removing 2 gold balls is $\frac{5}{12}$.

Since there are $40(39)$ total pairs of balls that can be chosen and $g(g-1)$ pairs of gold balls that can be chosen in this way, then $\frac{g(g-1)}{40(39)}=\frac{5}{12}$ which is equivalent to $g(g-1)=\frac{5}{12}(40)(39)=650$.



Therefore, $g^{2}-g-650=0$ or $(g-26)(g+25)=0$, and so $g=26$ or $g=-25$.

Since $g>0$, then $g=26$, so there are 26 gold balls in the bag.

Suppose that the bag contains $g$ gold balls.

We assume that Feridun reaches into the bag and removes the two balls together.

Since there are 40 balls in the bag, there are $\left(\begin{array}{c}40 \\ 2\end{array}\right)$ pairs of balls that he could choose in this way.

Since there are $g$ gold balls in the bag, then there are $\left(\begin{array}{l}g \\ 2\end{array}\right)$ pairs of gold balls that he could choose in this way.

We are told that the probability of removing 2 gold balls is $\frac{5}{12}$.

Since there are $\left(\begin{array}{c}40 \\ 2\end{array}\right)$ pairs in total that can be chosen and $\left(\begin{array}{l}g \\ 2\end{array}\right)$ pairs of gold balls that can be chosen in this way, then $\frac{\left(\begin{array}{l}g \\ 2\end{array}\right)}{\left(\begin{array}{c}40 \\ 2\end{array}\right)}=\frac{5}{12}$ which is equivalent to $\left(\begin{array}{l}g \\ 2\end{array}\right)=\frac{5}{12}\left(\begin{array}{c}40 \\ 2\end{array}\right)$.

Since $\left(\begin{array}{l}n \\ 2\end{array}\right)=\frac{n(n-1)}{2}$, then this equation is equivalent to $\frac{g(g-1)}{2}=\frac{5}{12} \frac{40(39)}{2}=325$.

Therefore, $g(g-1)=650$ or $g^{2}-g-650=0$ or $(g-26)(g+25)=0$, and so $g=26$ or $g=-25$.

Since $g>0$, then $g=26$, so there are 26 gold balls in the bag.

Final answer: 26