Calculating probability for a never ending situation which is recurring.

**Problem:** A coin tossing game between two friends (of course Alice & Bob may be Eve is also there watching them play).

Find probability of Alice winning if both Alice and Bob has two weighted coins which has `a`

and `b`

probability of coming heads.

Assume Alice plays first and whoever gets Head first wins.

**Solution:**

P(A) = Probability of Alice winning the game = Probability of Alice coin to show head on first throw + (Probability of Alice count to show Tail on first throw)(Probability of Bob coin to show tail)*Probability of Alice count to come head + .. …

H + TT H + TT TT H

```
```P(A) = a + (1-a)(1-b) P(A)

=> P(A) = a / (a(1-b) + b)