Consider the following game.
P has a fair $6$ sided die and continuously rolls it while keeping track of the sum, $S$, of the top faces. P can bail anytime and leave with $S$ number of dollars. However, if $S$ is ever a perfect square, the game ends and $P$ gets nothing.
When is it most profitable for $P$ to quit? What is the expected amount of money does $P$ make when $P$ quits at this optimal time?
I ran sum simulations of this and found that on average, the game runs for $8$ rolls and the expected earnings of $P$ is around $28$ dollars. Can we prove this?
