the coin is returned with an additional $1 coin, otherwise the original coin is

lost. The probability of winning is 1/2 unless the previous play has resulted

in a win, in which case the probability is p < 1/2. If the cost of maintaining

the machine averages $c per play (with c < 1/3), give conditions on the value

of p that the owner of the machine must arrange in order to make a profit in

the long run.

Not sure how to start this. Is this a markov chain (gambler's ruin)