A thief goes out stealing every day and has a chance of $p_j$ of stealing a sum $j$ with $0\leq j \leq N$. But there's also a chance $p$ of getting caught, in which case he loses everything he got until that moment. When should he stop stealing? The answer is that he should stop at $$\frac{1-p}{p} \cdot \sum ^n _{j=0} p_j \cdot j$$ First I should make a model of this problem as the optimal stopping of a Markov chain, but I don't know how to do that. And then prove that the model is monotone. Finally I've got to show that the given answer is the moment that the expected extra profit is not greater than the expected loss when getting caught.
Thanks in advance!
Edit: The model should look like this:
$S=\{0,1,...,N\}, A(i)=\{0,1\}, i \in S, r_i=..., i\in S, s_i=..., i\in S, p_{ij}=...$
Where $S$ is the set of total profits the thief can have, $A(i)$ are the action he can perform in state $i$ (stop 0 or steal 1), $r_i$ is the profit he gets when he stops in $i$, $s_i$ is the additional profit if he continues and $p_{ij}$ is the cance of going from $i$ to $j$.