There are two thieves with a total of 1 billion ($10^9$) dollars in a bank vault. Now they must decide how to divide the booty. But there is one problem:
the thieves have only $M$ minutes to leave the bank before the police arrives. Also, the more time they spend in the vault, the lower the amount they can carry away from the bank. Formally speaking, they can get away with all of the billion dollars right now, but after t minutes they can carry away only $10^9\cdot p^t$ dollars, where $0<p<1$, and at $t = M$, they get arrested and lose all the money.
They will not leave the vault until a decision on how to divide the money has been made.
The money division process proceeds in the following way: at the beginning of each minute starting from the 1st (that is, $t = 0$), one of them proposes his own way to divide the booty. If his colleague agrees, they leave the bank with pockets filled with the proposed amounts of dollars. If not, the other one proposes his way at the next minute etc. To escape arrest, they can only propose plans till the beginning of the $M$th minute (i.e., till $t = M-1$).
Each thief wants to maximize his earnings, but if there are two plans with the same amounts for him, he would choose the one which leads to a larger total amount of stolen dollars.
For example: for $M=2$ and $p=0.5$, if a decision isn't made at $t = 0$, the total amount of money decreases to $0.5*10^9$ at $t = 1$ which leads to a situation worse than the given solution, so each thief would get 500000000 each.
How should I calculate this for any value of $M$ and $p$.
Whoever gets to propose the last distribution can walk away with $p^{M-1}$ of the loot (I'll omit the one billion), so the other one has to give that sum at the $M-2$ point if he wants to get anything, this means he can get $p^{M-2}-p^{M-1}=p^{M-2}(1-p)$ at the $M-2$ point. We can keep this line of thought and go one more step back in which the proposing thief can get away with $p^{M-3}-p^{M-2}(1-p)=p^{M-3}(1-p+p^2)$ etc.
The general term for the proposal at $T$ steps before the end can be shown to be $p^{M-T}(1-p+p^2-p^3...+(-1)^{T-1}p^{T-1}$ (by simple induction), where the last term is a finite geometric series with $q=-p$, and so for $T=M$ we get $\frac{1+(-1)^{M-1}p^M}{1+p}$.