Problem 1268. Penny flipping - calculate winning probability (easy)

Two players are playing a fair penny flipping game. For each flip, the winner adds one penny from the loser's collection to his/her collection. This continues until one player runs out of pennies and loses the game.

Calculate the probability of winning for the first player, given the first player's number of coins, m, and the second player's number of coins, n.


Input: m = 1, n =1
Output: 0.50

Solution Stats

67.78% Correct | 32.22% Incorrect
Last solution submitted on Sep 23, 2019

Problem Comments