Step by step
The question
Question: we flip a coin until we get tails: what is the probability that the first tails comes within 3 flips?
1 Name p and q
p, the chance of a success on one try, is 1/2.
q, the chance of a fail, is 1 minus p: 1/2.
Every try has the same chance, and one try does not change the next.
2 None in 3 flips
Within 3 means on flip 1, or 2, up to 3.
The only other way: all 3 flips fail.
All 3 fail: q times itself 3 times.
That is 1/8, about 0.1250.
3 The rest
Everything else has a success within 3: 1 minus that is about 0.8750.
Careful!
p to the power 3 would be 3 successes in a row.
We only need one.
4 Check
Let's check by adding each flip: 0.5000 plus 0.2500 plus 0.1250.
That is about 0.8750.
So it is right!
Let's look back.
First: name p and q.
Then: none in 3 flips.
Then: the rest.
Last: check.