An escape needs two stages done back to back. Stage one succeeds with
probability p1, stage two with p2. Failing either stage sends you back to
the start. Each stage you attempt counts as one action.
Return the expected total number of actions until you get out.
Condition on one pass through:
Input
p1 = 0.5
p2 = 0.5
Output
6.0