$A$ and $B$ are two players, each have exactly one turn. $A$ goes first. $A$ keeps on choosing a random number uniformly distributed over $(0,1)$ and add the values. If at one point it exceeds $1$, $A$ loses. If $A$ thinks his cumulative sum is very close to $1$, hence there is a risk of losing, he stops. Then $B$ starts the same process and add the values separately. If at one point $B$ exceeds $A$'s sum and still below $1$, he wins. What is the optimal strategy for $A$ to stop adding and what is the probability of winning in that case ($B$ knows the value $A$ stopped at)?


From simulation It appears that the optimal threshold of $A$'s cumulative sum is approximately $0.5772$, which is very close to the Euler-Mascheroni constant $\gamma$.



An Interesting Two Players' Game Involving Cumulative Sum of Uniform Distribution
The optimal strategy for A is to play until she reaches 0.570557. This is a root of $3e^x-x-2xe^x=e$. To see this, one can compute that A's probability of winning if she stops at $\alpha$ is $f(\alpha)$, where $f(x)=1-(1-x)e^x$. Her probability of winning if she carries on for one more turn and then stops is $g(\alpha)=\int\_\alpha^1f(x)\,dx=1-e+2e^\alpha-\alpha-\alpha e^\alpha$. These two functions are equal when $\alpha=0.570557...$.


You might ask why should you only play 1 step more? The answer is that at the critical point, playing one step more will neither increase nor decrease the chances of winning; but playing two additional steps will definitely decrease your chances of winning.


*EDIT*: Here is a derivation of $f$. Consider the game from B's point of view once A has scored $t$. B just keeps generating random numbers until the sum is greater than $t$. If the sum is then less than 1, he wins; otherwise he loses. Let $g\_\delta(x)$ be the probability that the cumulative sum lands in the interval $[x,x+\delta]$ (so that B's probability of winning is $1-f(t)=g\_{1-t}(t)$). Now for any $x,\delta$ summing to at most 1, $g\_\delta(x)=\delta+\int\_0^x g\_\delta(t)\,dt$: the probability of winning in 1 step plus the probability of winning in multiple steps. You can solve this to get $g\_\delta(x)=\delta e^x$. Hence $f(t)=1-(1-t)e^t$. 


