Available question text
You are given a bag that initially contains 2 red balls and 2 blue balls. You will repeatedly draw one ball from the bag at random until all balls have been kept (i.e., permanently removed from the bag).
The rules for keeping or returning a ball are as follows:
If you draw a red ball, you keep it and remove it from the bag.
If you draw a blue ball:
If it is not the second blue ball in a row, you put it back into the bag.
If it is the second blue ball in a row, you keep it and remove it from the bag.
Note: The “second blue in a row” means you drew a blue ball immediately after having drawn a blue ball in the previous turn.
This process continues until all balls have been kept.
Write a function to compute the probability that the last ball you keep is a blue ball, following the rules above.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Google
Probability That the Last Kept Ball Is Blue
Reported Jun 21, 2025 · 1 source report
JUNIOR
Source snapshot: Nov 12, 2026
View source