Hello, I would like to clarify this task.
The example that baffles me the most - #assert(almostequal(battleprobability(['A', 'D'], 4, 3), 1.0000)), "Always win".
Even if I assume that player 2 never wins, how can we say that the player one wins every single time with certainty, if there is a very small chance of a perpetual no-win, for instance if player 1 throws all Ds all the time (but there are other combination when player 2 does not lose any units).
Am I missing something, or is there a precondition that should be added to the mix?
Thank you.
Created at: 2021/01/05 08:12; Updated at: 2021/01/06 19:54
The question is resolved.