# Probability Drawing Without Replacement

Assignment Question: A box contains of some green balls and some white balls. Given that the probability of drawing two green balls without replacement is $0.5$,

(a) what is the smallest total number of ball inside this box? Hence, state the total number of green and white balls,

(b) if the total number of white ball inside this box is an even number, what is the smallest total number of white ball inside this box? Hence state the number of green ball inside this box.

I'm not sure about the correct way to do it, is it something about the expected formula? I tried the trial and error way $P(X_1) \times P(X_2)=0.5$ , and put all the possible number for $X_1$ and $X_2$ but still I can't get it and I don't think the teacher will accept the trial and error method. Any help will be appreciated.

$a)$: Let $n$ be the total number of balls in the box, and $x$ be the number of green balls, then $n-x$ be the number of white balls, then: $Pr(\text{ 2 green balls w/o replacement}) = \dfrac{x}{n}\cdot \dfrac{x-1}{n-1} = 0.5 \to n(n-1) = 2x(x-1) \to 2x^2-2x - n^2+n = 0 \to x = \dfrac{1\pm \sqrt{1-2(-n^2+n)}}{2}\in \mathbb{N} \to 2n^2-2n+1 = k^2\to (n-1)^2+n^2 = k^2$. We see that the smallest value of $n$ is $4$, thus $k = 5$, and $x = 3$
$b)$: Let $2k$ be the number of white balls in the box, then $n-2k$ is the number of green balls in the box. Thus: $Pr(\text{2 green balls w/o replacement}) = 0.5 \to \dfrac{n-2k}{n}\cdot \dfrac{n-2k-1}{n-1}= 0.5\to n^2-n = 2(n-2k)(n-2k-1) = 2(n-2k)^2-2(n-2k)=2(n^2-4nk+4k^2)-2n+4k\to n^2-n -8nk + 8k^2 +4k=0\to n^2-(8k+1)n + 8k^2 + 4k = 0\to \triangle = (8k+1)^2 - 4(8k^2+4k) = 64k^2+16k+1 - 32k^2 - 16k = 32k^2 + 1 = m^2\to m^2 - 2(4k)^2 = 1\to m^2 - 2p^2 = 1, p = 4k$. We are led to a Pellian equation with initial solution $(m,p) = (3,2)$. We can generate the next ten or so solutions and select the smallest for $p$ then $k$. Specifically, the next solution is: $p = 2\cdot 3+ 3\cdot 2 = 12 \to 4k = p = 12 \to k = 3$ becomes the smallest value we sought. Thus $\text{ the smallest number of white balls inside the box is } 2k = 2\cdot 3 = 6$, and $m = 3^2 + 2\cdot 2^2 = 17\to n = \dfrac{8k+1\pm m}{2} = \dfrac{25 \pm 17}{2} = 4, 21$. Since $n > 6, n = 21$ is the smallest number of balls in the box, and the total number of green balls in the box is $15$.