2026 AMC 10A Problem 12
A drawer has red socks and blue socks. Pippi randomly removes one sock at a time, without replacement, until all the socks of one color have been removed. What is the probability that there are exactly socks left in the drawer once that happens?
Show solution without answering
Key insight
Picture the socks in a random line. The socks left over are the unbroken same-color run at the end, so read the line from the back.
Solution
Taking socks out one at a time at random is the same as first shuffling all socks into a random line and then taking them from the front. Pippi stops early, so some socks at the back of the line are never taken. The whole problem is about what the back of the line looks like.
- A tiny example. Suppose the drawer had only red (R) and blue (B) socks. There are equally likely lines:
| Line | Pippi takes | Color used up | Socks left |
|---|---|---|---|
| RRBB | R, R | red | (BB) |
| RBRB | R, B, R | red | (B) |
| RBBR | R, B, B | blue | (R) |
| BRRB | B, R, R | red | (B) |
| BRBR | B, R, B | blue | (R) |
| BBRR | B, B | blue | (RR) |
In every row, the socks left are exactly the block of same-colored socks at the very end of the line. For example, RRBB ends in BB, with a red sock just before that block.
2. Why that is always true. Pippi stops right after taking the last sock of some color, say the last red. Every sock behind it in the line is blue, since no reds are left. And the sock she just took is red, so the blue block behind it starts right there. So:
- What "exactly 2 left" means. The end block has length exactly when the last two socks in the line are the same color and the third sock from the end is the other color.
4. Fill the line from the back. A random line read backwards is still a random line, so the last spot is equally likely to hold any of the socks, the spot before it is equally likely to hold any of the others, and so on. Take the case "last two red, third from the end blue":
- last sock red: ;
- second to last red, given that: reds among socks, so ;
- third from the end blue: blues among socks, so .
Multiply, using and :
5. The other color. "Last two blue, third from the end red" has the same probability, , because the two colors have the same number of socks. The two cases cannot happen together, so add them:
- Check with the tiny example. The same method gives , and the table above shows of the lines leaving exactly socks. They agree.
The answer is .
Why this works
A process that stops "when something runs out" is easier to study as one complete random order: what is left over is decided entirely by the end of that order. Reading the order from the back replaces a long process (up to draws) with three simple draws. Whenever a question asks about the last items or the leftovers, try looking at the order from the end.
Alternative approach
Count lines instead of multiplying probabilities. Every arrangement of R's and B's in a row is equally likely, and there are of them.
A line ends with "B, R, R" when its last three spots are fixed that way and the other spots hold the remaining R's and B's. That is lines. Dividing and cancelling the factorials,
the same as Step 4. Doubling for lines ending "R, B, B" gives .
Concise solution
A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.
Shuffle the socks into a uniformly random order and let Pippi draw from the front. She stops just after the last sock of one color, so the socks left are exactly the maximal block of one color at the end of the order. Exactly remain if and only if positions and match in color and position has the other color. Reading from the back,
The answer is .
Review in the AoPS books
- Introduction to Counting & Probability, Chapter 7: Introduction to Probability
- Introduction to Counting & Probability, Chapter 8: Basic Probability Techniques (§8.5)
- Intermediate Counting & Probability, Chapter 4: Constructive Counting and 1-1 Correspondences (§4.4, §4.5, §4.6)
- Prealgebra, Chapter 15: Problem-Solving Strategies (§15.4)
Similar problems
Problem © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. Solution and commentary are original to this site.