1

Given a class of $m$ kids, $\frac{m}{2}$ boys and $\frac{m}{2}$ girls. Their teacher Erica randomly choosing kids from her class one by one. Define success in the experiment when Erica chose at least one boy and at least one girl. Suppose $Y$ is the number of kids that Erica chose until she was successful in the experiment. What is the distribution of $Y$?

My attempt: Divide the class into two groups, $A$ of boys and $B$ of girls. Erica chooses one child. Suppose, without loss of generality, that Erica chose a boy from group A. Because Erica chose $Y$ kids in total, she has another $Y-2$ kids to choose from group $A$, and one kid from group $B$. Therefore: $$P(Y=i)=(0.5)^{i-2} * 0.5 = 0.5^{i-1} , i >1 $$

I have a feeling that I'm wrong, but I can't think about another solution to this problem.

Edit: @Brian M. Scott has been brought my attention to the fact that the solution I have proposed relates to the case where kids beign chosen with replacement. Therefore, because creative solutions were provided for both cases, I separate the original question into two questions, the first with replacement, and the second without replacement.

Dan
  • 55
  • 6

2 Answers2

3

For convenience let $m=2n$, so that we have $n$ girls and $n$ boys.

Clearly $P(Y=0)=P(Y=1)=0$. Assuming that $n\ge 2$ there are $n(n-1)$ ways to begin by choosing $2$ girls, $n(n-1)$ ways to begin by choosing $2$ boys, $n^2$ ways to begin by choosing a girl and then a boy, and $n^2$ ways to begin by choosing a boy and then a girl, so

$$\begin{align*} P(Y=2)&=\frac{2n^2}{2n^2+2n(n-1)}\\ &=\frac{n}{2n-1}\\ &=\frac12+\frac1{4n-2}\;, \end{align*}$$

a bit more than $\frac12$. (If $n=1$, of course, $P(Y=2)=1$.)

Now suppose that $n\ge 3$. The successful sequences are $GGB$ and $BBG$, each of which can be made in $n^2(n-1)$ ways. Each of the other $4$ sequences with two children of one sex and one of the other can also be made in $n^2(n-1)$ ways, and each of the sequences $GGG$ and $BBB$ can be made in $n(n-1)(n-2)$, so

$$\begin{align*} P(Y=3)&=\frac{2n^2(n-1)}{6n^2(n-1)+2n(n-1)(n-2)}\\ &=\frac{n}{4n-2}\\ &=\frac14+\frac1{8n-4}\;. \end{align*}$$

Let’s look at one more: suppose that $n\ge 4$. A similar analysis shows that

$$\begin{align*} P(Y=4)&=\frac{2n^2(n-1)(n-2)}{8n^2(n-1)(n-2)+6n^2(n-1)^2+2n(n-1)(n-2)(n-3)}\\ &=\frac{n(n-2)}{4n(n-2)+3n(n-1)+(n-2)(n-3)}\\ &=\frac{n^2-2n}{8n^2-16n+6}\\ &=\frac18-\frac3{8(4n^2-8n+3)}\;, \end{align*}$$

which pretty well puts paid to any hope of finding a simple pattern for the simplified expression.1

It is, of course, possible to write an expression for the original fraction: assuming that $n\ge k$,

$$P(Y=k)=\frac{2nn^{\underline{k-1}}}{\sum_{i=0}^k\binom{k}in^{\underline i}n^{\underline{k-i}}}\;,$$

where $x^{\underline k}$ is the falling factorial,

$$x^{\underline k}=x(x-1)(x-2)\ldots(x-k+1)=\prod_{i=0}^{k-1}(x-i)\;.$$

1 As a quick check I evaluated these at $n=4$; they sum to $\frac{34}{35}$, which is correct, since in this case

$$P(Y=5)=\frac{2\cdot4!\cdot4}{8\cdot7\cdot6\cdot5\cdot4}=\frac1{35}\;.$$

Brian M. Scott
  • 616,228
1

Let $N$ be the random variable for the number of kids, such that its a success, we can write the distribution of $N$ as follows: $$P(\text{atleast one boy and one girl}) = 1- P(\text{picking all girls}) - P(\text{picking all boys})$$ $$P(N=n) = 1 - {n\choose 0,n}(0.5)^{0}(0.5)^{n}- {n\choose 0,n}(0.5)^{n}(0.5)^{0}$$ $$P(N=n) = 1 - 2(0.5)^n$$


Edited the answer to my new attempt $$P(N=2) = 1 - 2\frac{1}{4}$$ $$ = \frac{1}{2}$$ Which is as expected. Now the probability of picking all girls or all boys will indeed tend to zero. Note: ${n \choose i,j} = {n \choose r} $, where $i$ = $n-r$ and $j = r$

SagarM
  • 1,789
  • 1
    Okay, that makes sense, but the result makes little sense to me. That is, if we assume that the first chose was a boy, and the second chose was a girl, then n=2. that is, we place n = 2 in the result you presented, we get that the probability is 0. Is it possible? – Dan May 08 '20 at 21:55
  • @BOIDEM I can only agree, I find this absurd too and would like to understand where I am growing wrong – SagarM May 08 '20 at 21:58
  • 1
    In addition, as we increase n, the probability that you presented will approach 1, but this is not possible. Because the probability to keep choosing kids from the same group must have to approach 0. – Dan May 08 '20 at 22:02
  • I agree again, I am amzed, the math still makes sense to me, what do you think is wrong ? – SagarM May 08 '20 at 22:04
  • Aaaaah wait, its completely wrong, I am not really treating it as an RV. I will rethink either edit and redo, or delete it tommorrow – SagarM May 08 '20 at 22:06
  • 1
    Glad we agree. Thank you for your effort. – Dan May 08 '20 at 22:08
  • Ok, your final result is same to my final result. That's make sense. The question is, are we correct? – Dan May 09 '20 at 11:01
  • 1
    @BOIDEM: Unfortunately, the solution is not: this analysis requires that the choices be made with replacement. When they are made without replacement, the probability of choosing a girl, say, changes after each choice (and is eventually $0$, since the pool is finite). – Brian M. Scott May 09 '20 at 19:29
  • @BrianM.Scott you are so right ! – SagarM May 09 '20 at 19:40