UnipickerDraw Whitepaper
Algorithms · LESSON 1

Lining up by random number

Basic draw

A method that gives each entrant one random number, then lines everyone up by that random number's order to decide the winners.

Two key points — ① The seed decides the lineup direction (ascending/descending). ② Draw from the top, but skip anyone already won.
Concept

Hand Out Random Numbers and Line Up

Assign each entrant (or each entry) one random number. Then line everyone up in one row by that number, and the front of the line becomes the win priority.

The random numbers are made with the safe random method from earlier. So with the same seed, anyone can rebuild the identical lineup to verify it.
Sort direction

The Seed Decides Direction — Odd Ascending · Even Descending

If the initial seed value is odd, line up ascending (smaller random numbers first); if even, descending (bigger numbers first). Since even the direction is fixed by the seed, an organizer cannot pick it arbitrarily.

Odd seedAscending ↑ · smallest random numbers go first
Even seedDescending ↓ · biggest random numbers go first
Prevent duplicate wins

Skip Anyone Already Won

In mass entries, one person can enter multiple times, so the same person can appear more than once in line. Check winners in order from the front of the line, and if someone already won comes up again, pass that entry and move to the next.

Why? Just passing instead of redrawing is fast, and winners get filled up to the needed number with no duplicates.
Experiment

Try Lining Up Yourself (5 people · 3 winners)

These are entries from A·B·C·D·E. A and B entered twice each. Change the seed to see how the ascending/descending sort direction changes and how duplicates get passed. (In this experiment the initial seed only decides the sort direction, and random numbers are drawn fresh each time.)

Initial seed
Result after assigning random numbers and lining up
If the seed is odd, the top has the smallest random number; if even, the top has the biggest. Drawing from the top, you can see duplicates get passed.