The probability that 2 sheeps selected randomly from the flock are from different barns is exactly $1/2$. Determine the value of $n$.

114 Views Asked by At

A Farmer has a flock of $n$ sheep, where $2000 \le n \le 2100$. The farmer puts some number of sheep into one barn and the rest of the sheep into a second barn. The farmer realizes that if she were to select two different sheeps at random from her flock, the probability that they are in different barns is exactly $1/2$. Determine the value of $n$.


Attempt:

If $k$ sheeps are placed in barn 1, and $n$ sheeps in barn 2, then the number of ways of selecting 2 sheeps from the flock such that tehy are in different barns is: $k (n-k)$. So the probability is $\frac{k(n-1)}{\binom{n}{2}}$, and it must have the property $$\frac{k(n-k)}{\binom{n}{2}} = \frac{1}{2}$$

I get a quadratic equation: $$ n^{2} - (1+4k)n + 4 k^{2} = 0$$

The solution is $$ n = \frac{1+4k \pm \sqrt{1+8k}}{2}$$

by trial I get that $k=1035$ satisfy an integer solution with $n=2025$. Is there better ways than trial?

2

There are 2 best solutions below

0
On BEST ANSWER

You have $$n^2-(1+4k)n+4k^2=0 \implies (n-2k)^2=n.$$ Thus $n$ is a perfect square. The only perfect square in $[2000, 2100]$ is $2025$. Thus $n=2025$.

0
On

Continuing from your last equation, you have that $8k+1$ is an odd square $(2m+1)^2=4m^2+4m+1$ so $8k=4m^2+4m$ so $4k=2m^2+2m$. Thus $$n=\frac{(2m^2+2m)+(2m+1)+1}2=m^2+2m+1=(m+1)^2$$ is a square. Then use Anurag's idea.