A box contain more than $100$ balls of which some are red and remaining are blue. If we take two balls at random ,the probability of getting one blue and one red is $\frac{1}{2}$. The minimum no of balls in the box?
I am not getting the way to relate the two givens in the problem. Any hints?
Suppose we have $r$ red balls and $b$ blue balls and $t$ be the total number of balls. We are given $t = r+b>100$. The probability of getting one blue and one red ball is $2\frac{r}{r+b}\frac{b}{r+b-1} = 2\frac{r(t-r)}{t(t-1)}$. This quantity should be $\frac{1}{2}$. Re arranging we obtain ( or at least I obtained ): $$t^2 - t(1+4r)+4r^2 = 0$$ We want the first integer solution to this equation with $t>100$. Solving for $t$, we get: $$2t = (1+4r) \pm \sqrt{1+8r}$$ Since the $LHS$ is even and so is $1+4r$, $\sqrt{1+8r}$ needs to be an odd square number say $m^2$. Then we are looking at integer solutions of $1+8r = m^2$. This means that: $$m^2-1 = (m+1)(m-1) = 8r$$, since $m$ is odd, $m+1$ and $m-1$ are consecutive even numbers, so one of them is always divisible by $4$ and $m^2-1$ is always divisible by $8$. We can write $m = 2n+1$ and we obtain: $$(n+1)n = 2r$$ So we can choose $2r$, to be the product of any two consecutive numbers. Writing the $LHS$ of the equation for $2t$ in terms of $n$ we obtain: $$2t = 1+2(n)(n+1) + 2n+1 = 2n^2+4n+2 > 200$$ $$t = n^2 +2n+1 > 100$$ $t = (n+1)^2>100$ clearly $ t = 121$ is the smallest value of $t$.
There is an easier way to do this:
Note that the quadratic for $t$ can be written as $$t = (t-2r)^2$$. So $t$ must be a square number. The smallest square number greater than $100$ is $121$, and trying this, we see that $r$ is an integer. Thus $t = 121$ is the smallest possible value of $t$.