Hacker News
What algorithm did Windows XP use to choose your initial user picture?
Windows XP selects the initial user picture using the RtlRandomEx generator seeded with the current GetTickCount() value and a one-pass reservoir-sampling algorithm (k = 1). The code iterates through the files in %ALLUSERSPROFILE%\Default Pictures, updating a winner with probability 1/count for each item, and stops after examining 100 pictures to prevent excessive processing.