# Expected number of uniform distributions

Suppose you have i.i.d uniformly distributed numbers $u_i \in [0,1], i=1,2,\dots$, which are realized sequentially. At the start of the game, $u_1$ is drawn. After you know the realization of $u_1$, denoted by $\hat{u}_1$, you bet that $u_2$ is smaller than $\hat{u}_1$ if $\hat{u}_1 \ge \frac{1}{2}$, and you bet $u_2$ is bigger than $\hat{u}_1$ if $\hat{u}_1 \le \frac{1}{2}$. Then $u_2$ is drawn. If you're right, you get one dollar, and you bet against the value of $u_3$ again with the knowledge of $u_2$'s realization $\hat{u}_2$ using same betting scheme; if you're wrong the game ends. So on so and forth. What is the expected payoff of this game?

Let $W(u)$ be the expected winnings having just seen random number $u>0.5$. We want to find $W(1)-1$, i.e. the winnings after a "sure bet" on $u=1$.

Now $$W(u) \ =\ u + \int_{v=0}^{0.5} W(1-v) \mathrm{d}v + \int_{v=0.5}^{u} W(v) \mathrm{d}v$$because you win a dollar with probability $u$ then, for winning value $v<u$, you experience further winnings $W(1-v)$ if $v<0.5$ or $W(v)$ otherwise. Note that $W(1)=2W(0.5)$.

Differentiate with respect to $u$:$$W^\prime(u)\ =\ 1 + W(u)$$so $W(u) = Ae^u-1$ for some $A$.

But $W(1)=2W(0.5)$, so $A=1/(2e^{0.5}-e)$ and therefore your expected winnings are$$\begin{array}{rcl} W(1)-1 &=& 1/(2e^{-0.5}-1)-2 \\ &\approx&2.69 \ \textrm{dollars} \end{array}$$

• Why do we want to calculate $W(1) -1$? And why do we have $W(1) = 2 W(0.5)$? Commented Oct 10, 2015 at 1:01
• $W(1)$ is the winnings from the game that starts with $\hat{u}_0=1$, which is equivalent to your game except for the "free" payoff of one dollar at the start (due to it being a sure bet that $u_1<\hat{u}_0$). As for $W(1)=2W(0.5)$, just write down the integral equation in the two cases, 1 and 0.5, and note that $\int_0^{0.5}W(1-v)\mathrm{d}v=\int_{0.5}^1W(v)\mathrm{d}v$ (because it's just the area under the $W(v)$ curve between $v=0.5$ and $v=1$). Commented Oct 10, 2015 at 7:39
• That's genius! W(1) - 1 is equivalent to the original game. Can we also do $W(0.8) - 0.8$? I think that's wrong, please correct me. Commented Oct 10, 2015 at 21:49
• We can't do $W(0.8)-0.8$ ... that's about 2.04, not 2.69. The nice thing about $W(1)$, where $\hat{u}_0=1$, is that $u_1$ is free to take any value in $[0,1]$, just as it does in the original game. With $W(0.8)$, you have $u_1 \in [0,0.8]$ instead. Commented Oct 11, 2015 at 7:46