Dice game, get close to $6$ 
You have been chosen to play a game involving a 6-sided die. You get
  to roll the die once, see the result, and then may choose to either
  stop or roll again. Your payoff is the sum of your rolls, unless this
  sum is (strictly) greater than 6. If you go over $6$, you get $0$. What's the best strategy?

I tried to set up equations with expected value. I think that the best strategy is to roll until you get at least some value, call it $x$. But I have not been able to make too much progress. Can someone please help me?
 A: Suppose $f(x,t)$ is your expected return if so far you have rolled $x$ and you have a threshold $t$ where you stop when $x \ge t$.  Then 


*

*$f(x,t)=0$ if $x\gt 6$ as you are bust

*$f(x,t)=x$ if $t \le x \le 6$ as you stop

*$f(x,t)=\frac16 \sum\limits_{y=x+1}^{x+6} f(y,t)$ if $0 \le x \lt t$ as you reroll
You are interested in $f(0,t)$ for different $t$, and you get 
t   f(0,t)
1   3.5
2   3.888888889
3   4.083333333
4   3.969907407
5   3.396476337
6   2.161394033

So the optimal position is with $t=3$, rerolling if you have a total of $1$ or $2$ and otherwise stopping.  This makes the game worth $4.083333333$ as you found  
A: If you have $x$, you fail and get $0$ with probability $\frac x6$, losing $x$.  If you succeed, you gain a number between $1$ and $6-x$, so on average gain $$\frac {6-x}6\cdot \frac 12(7-x)-\frac x6\cdot x$$ 
Just make a table of this and see where it goes negative.  It turns out the gain is $\frac 73$ at $x=1$, $1$ at $x=2$ and negative above that, so you should roll again when you have $2$ or less.
