What algorithm did Windows XP use to choose your initial user picture?
20 days ago
- Windows XP uses RtlRandomEx with GetTickCount as seed to randomly select a profile picture.
- The algorithm employs a one-pass random selection (reservoir sampling with k=1) for efficiency.
- One-pass reduces file system calls compared to a two-pass algorithm and handles dynamic file counts.
- The selection works by iterating over items, replacing the winner with probability 1/count.
- A safety limit stops sampling after 100 pictures to avoid pathological behavior with many files.