# Expected values of two random variables related to a simple urn problem

In an urn there are $$u$$ balls, $$b$$ of which are black.

If we perform $$n$$ trials of one ball at a time with replacement, the probability of the event $$E$$ to get $$n$$ times a black ball is $$P(E)=\left(\frac{b}{u}\right)^n$$, whereas the probability of the event $$L$$ to get at least one black ball is $$P(L)=1-\left(\frac{u-b}{u}\right)^n$$.

Let $$X$$ be the non-negative, integer-valued random variable representing the number of trials it takes to get a success for the event $$E$$, and $$Y$$ the non-negative, integer-valued random variable representing the number of trials it takes to get a success for the event $$L$$.

What are the expected values $$\mathbb{E}[X]$$ and $$\mathbb{E}[Y]$$?

My attempt for $$\mathbb{E}[X]$$:

I denote with $$P(E;k)$$ the probability to get a success for the event $$E$$ at the trial $$k$$.

The variable $$X$$ can assume only the value $$n$$, therefore, by definition it should be $$\mathbb{E}[X]=\sum_{k=1}^n k P(E;k)=\sum_{k=1}^n k P(E)\delta_{n,k}=nP(E).$$

My attempt for $$\mathbb{E}[Y]$$:

I denote with $$P(L;k)$$ the probability to get a success for the event $$L$$ at the trial $$k$$.

The variable $$Y$$ can assume any value from $$1$$ to $$n$$, therefore, by definition, it should be $$\mathbb{E}[Y]=\sum_{k=1}^n k P(L;k)=\sum_{k=1}^n k \left[1-\left(\frac{u-b}{u}\right)^k\right].$$

Are these calculations correct?

• If I understand your question (the desription does not make much sense for me), the random variables $X$ and $Y$ are geometrically distributed. These random variables are not bounded by $n$, so your calculations cannot be correct. Please google for geometric distribution. – Dieter Kadelka Jan 29 '19 at 18:26
• @DieterKadelka Thanks for your comment. – Andrea Prunotto Jan 29 '19 at 18:52
• In your definitions of of $X$ and $Y$, what do you mean by "trials" and "a success for the event"? – Iosif Pinelis Jan 30 '19 at 2:42
• Sorry, I still don't understand your definitions. Perhaps you can state them in purely formal terms (such as independent identically distributed random variables, with certain distributions) and completely eschew such non-mathematical terms as "draw", "attempt", "trials", etc. – Iosif Pinelis Jan 30 '19 at 17:32
• I'm afraid the question as phrased has no answer; a different question does: "Repeatedly draw a ball with replacement, stop when you have $n$ black balls. What is the expected number of balls drawn?" --- is that a question that would interest you? – Carlo Beenakker Feb 5 '19 at 9:10

For the alternative approach in the comments, the Pascal distribution applies: Repeatedly draw a ball with replacement from an urn with $$u$$ balls, $$b$$ of which are black, stop when you have $$n$$ black balls. Let $$X$$ be the number of balls drawn. The probability distribution of $$X$$ is $$P(X=N)=\binom{N-1}{n-1} (b/u)^{n}(1-b/u)^{N-n},\;\;N\geq n,$$ with expectation value $$\mathbb{E}(X)=nu/b$$.

• Thanks Carlo, it looks really neat! Please, can you help me to apply the same approach to the other event? – Andrea Prunotto Feb 5 '19 at 18:15
• For event $Y$ the best I can come up with is to ask for the number of draws until the first black ball, which has expectation value $u/b$. – Carlo Beenakker Feb 5 '19 at 22:01

In your definitions, you have confused:

$$P(E;k)$$

This actually means:

$$P(X=k|E)$$

(which equals $$\delta_{kn}$$ and gives the correct value that $$\mathbb E(X)=n$$).

and not, as you have used:

$$P(E|X=k)$$

which equals $$P(E)\delta_{kn}$$.