Quantum Attack Game Theory

Curious about the math - what’s the standard approach to getting this formula?

Also, for

doesn’t this discount the blocks that are found if you win? The opportunity cost of chasing a failed attempt to reorg involves lost block rewards if you don’t win - but you don’t pay that cost if you do win.