Expected Value After n Trials Suppose there is a game where a player can press a button for a chance to win a cash prize of $50,000. This can be done as many times as he/she wishes. The catch is that the chance of winning is 14/15 each time. A loss, which happens 1/15 times at random, will void all winnings and remove the player from the game. How many times should the player press the button to maximize their winnings?
This was a question brought up at dinner this evening by a family member with a slightly different game but same overall concept. It has been a while since I've done probability but I believe there is a solution to this problem. I assume that we can create a function using the expected value of each press and find the vertex to find the number of presses a player should do to maximize his/her prize. 
My guess is something like $y = ((14/15)^x*50,000) - ((1/15)^x*50,000x)$ where x is the number of trials, remembering that the player will potentially gain \$50,000 each round but also potentially lose all of their money (\$50,000x). 
Assuming there is a solution to this problem, is this the correct way to go about answering this? 
I apologize is this is completely off or a similar question has been asked, its been a few years since I've encountered a problem like this so I'm not even sure if I'm approaching/wording it the correct way.
 A: If the player has won $n$ games ($n\ge 0$), then to play again, the player is risking $\$50000n$ for a chance to win $\$50000$, with the probability of winning being $\frac{14}{15}$.  Thus the expected value of the $(n+1)$-st play (given that the player is still in the game) is $\frac{14}{15}\cdot 50000 -\frac{1}{15}\cdot 50000 n$.
Thus the game is in favor of the player for the first $14$ plays, fair for the $15$th play, and in favor of the 'house' after that. 
A: Let $x$ be the number of times the player plans to press the button.   The probability that the player wins is ${(\tfrac{14}{15})}^x$ and the expected amount won is $x\cdot\$50000\cdot {(\tfrac{14}{15})}^x \color{silver}{+ 0\cdot \big(1-{(\tfrac{14}{15})}^x\big)}$.
You want to maximise $x\cdot {(\tfrac{14}{15})}^x$
$\dfrac{\mathsf d (x(14/15)^x)}{\mathsf d x} =0 \quad\implies\quad x= 1/\log_e(14/15) \approx 14.{\small 5} $
So with a plan of $14$ rounds, the expected return is $\$266\,448.27$.
( Of course, the actual realised return will either be $\$0.00$ or $\$700\,000$ with a probability of $0.38$.   Stop earlier and you may obtain less with more probability, stop later and you may obtain more with less certainty.   $14$ rounds is about where the product of return times probability is a maximum. )
A: Find n where the expression is maximized:
$$n(\frac{14}{15})^{n}$$
=> n = 14
A: There's no reason for the second term in your sum. Indeed, the player doesn't "lose" any money when they lose the game, but rather returns to their base value of zero. Indeed, if $x=1$ you would expect a gain of $14/15\ast 50,000$ since on the $1/15$ chance that you lose immediately, you still haven't lost any money!
Therefore, the expectation at the $n$-th round should be $(14/15)^n\ast 50,000n$. Plugging in a value of $n$ tells you your expected gain if you resolve to play the game $n$ times (note that this formula takes into account the $1-(14/15)^n$ chance that you lose at some point, and go away with no gain and no loss either). Now, we can either use calculus or just elicit the value of $n$ with successive guesses. The idea is that at some point, we expect that expected value to start decreasing as we "push the odds" too much. Indeed, we can see the following:
$n=13$ leads to expected value about 265089
$n=14$ leads to expected value about 266448
$n=15$ leads to expected value 266448 
$n=16$ leads to expected value 265264
So we either want to press the button 14 or 15 times. 
EDIT: Ninja'd by paw, whose answer explains the calculation of $n$ much more nicely than mine! I'll leave my answer here as I think the first paragraph provides a nice alternative viewpoint, and perhaps the concrete numbers are of interest to you.
