Trying Until You Succed

Sometimes it only matters that you succeed, eventually. You are allowed to take your driving test repeatedly, and once you have passed, after however many attempts, you are free to drive. Suppose that the probability of passing your drive test is a fixed 0.7. What is the probability of passing your driving test after at most three attempts?
You might pass at the first attempt. The probability of this is 0.7.
You might fail the first attempt and retake, passing at the second attempt. The probability of failing the first attempt and passing at the second attempt is 0.3 x 0.7=0.21.
You might fail the first attempt, fail the second attempt and pass at the third attempt. The probability of this is 0.3 x 0.3 x 0.7=0.063.
The verall probability of passing within three attempts is
0.7+0.3 x 0.7 + 0.3 x 0.3 x 0.7=0.973.