I think you must just have an error in your code somewhere. Consider going round 3. Let the probability you say “3” be p_3. Then according to your numbers
164⁄512 = 15⁄64 + (1 − 15⁄64)*(1/2)*p_3
Since the probability of escaping by round 3 is the probability of escape by round 2, plus the probability you don’t escape by round 2, multiplied by the probability the coin lands tails, multiplied by the probability you say “3”.
But then p_3 = 11⁄49, and 49 is not a power of two!
I think you must just have an error in your code somewhere. Consider going round 3. Let the probability you say “3” be p_3. Then according to your numbers
Since the probability of escaping by round 3 is the probability of escape by round 2, plus the probability you don’t escape by round 2, multiplied by the probability the coin lands tails, multiplied by the probability you say “3”.
But then p_3 = 11⁄49, and 49 is not a power of two!
Say, that SB has only 10 tries to escape.
The DM (Dungeon Master) tosses his 10 coins and SB tosses her 20 coins, even before the game begins.
There are 2^30, which is about a billion possible outputs. More than half of them grants her freedom.
We compute her exit by—At the earliest x>y condition in each output bit string, the DM has also the freeing coin toss.