# TAOCP 3.4.2 Random Sampling and Shuffling

> Week 72 of the cracked.guide path: Knuth 3.4.2 Random Sampling and Shuffling; LeetCode: 2 NeetCode 150 problems; Play: Opus Magnum checkpoint.

Week 72 of 145 on cracked.guide, in TAOCP Vol 2: Seminumerical Algorithms: TAOCP 3.4.2 Random Sampling and Shuffling, 2 NeetCode 150 problems and Play track: Opus Magnum. The reading guides budget about 6 hours.

## Key facts {#key-facts}

- [TAOCP 3.4.2 Random Sampling and Shuffling](https://cracked.guide/guide/knuth-w055-0): Picking n records at random from N, both when N is known (selection sampling) and when it is not known in advance (reservoir sampling), and shuffling an array uniformly.
- Phase: TAOCP Vol 2: Seminumerical Algorithms, weeks 64 to 89.
- Updated October 20, 2026.

## By the end of this week you can {#objectives}

- Implement the standard shuffle and confirm every ordering is equally likely.
- Use selection sampling to choose n records from a known N.
- Use reservoir sampling when the number of records is unknown.

## This week's tasks {#tasks}

- [TAOCP 3.4.2 Random Sampling and Shuffling](https://cracked.guide/guide/knuth-w055-0): about 6 hours
- LeetCode: 2 NeetCode 150 problems
- Play: Opus Magnum checkpoint: Solve the first 12 puzzles

Previous: [Week 71](https://cracked.guide/curriculum/week/71) · Next: [Week 73](https://cracked.guide/curriculum/week/73)

---

Source: https://cracked.guide/curriculum/week/72
cracked.guide: A free, dated 145-week path to getting genuinely cracked at programming.
