VITON13School
Free tools of the school

Random name picker: how to pick students and make teams fairly

A random name picker chooses one name from a list so that every name has the same chance: with 25 students, each has a 1 in 25 chance on every pick. A fair picker relies on a good random generator, such as the browser's crypto.getRandomValues, and removes each chosen name when everyone should get exactly one turn.

By , Founder of VITON13 SCHOOL
Numbered bingo balls in many colours piled up inside a wire drum

Picking a student at random sounds trivial, yet two things often go wrong in class: the same names keep coming up, and teams end up lopsided. This guide explains what makes a draw fair, why a computer's random numbers can be trusted for it, the difference between drawing with and without replacement, and how to deal a class into teams, then points to a free spin wheel and random generator.

Key ideas

  • A draw is fair when every name has the same chance; with 30 names that is 1 in 30 on every pick.
  • The browser's crypto.getRandomValues uses a pseudo-random generator seeded with enough entropy to be suitable for cryptography, far more than a classroom draw needs.
  • Drawing with replacement repeats names surprisingly often: in 10 picks from 30 names, the chance that some name comes up twice is about 82%.
  • To call everyone once, draw without replacement; to make teams, shuffle the whole list and deal it out, so team sizes differ by one at most.

What makes a random name picker fair?

A picker is fair when every name has exactly the same chance on every draw. With 25 names on the list, each has a 1 in 25 chance, whoever was picked last time. Fairness belongs to the method, not to a single result: a fair draw can still pick the same student twice in a row, just as a fair coin can land heads twice.

Paper methods can be fair too. Names on identical slips, folded the same way and mixed well in a hat, give everyone an equal chance; slips of different sizes, or a teacher who can see them, do not. The weak point is usually the mixing, and a draw that someone could steer will not feel fair to the class even when it is.

A computer draws from a list by numbering the names from 1 to n, choosing a random whole number in that range and reading off the name. The care lies in one detail. Raw random numbers come in a fixed range, and squeezing them into 1 to 25 with a plain remainder slightly favours the smaller results, because that range rarely splits evenly into 25 groups. A careful generator throws away the uneven leftovers and draws again, which is called rejection sampling.

[1]

Is computer randomness really random?

Not in the strict sense, but it is unpredictable enough for any classroom. For speed, browsers do not read a truly random source for every number: crypto.getRandomValues uses a pseudo-random number generator seeded with a value that has enough entropy, and the algorithm has to be suitable for cryptographic purposes. The seed comes from sources such as the operating system's own random number function.

A pseudo-random generator is a formula that turns a starting value, the seed, into a long sequence of numbers that behaves like chance. JavaScript also has the simpler Math.random, which MDN describes as a non-cryptographic source: it makes no promise that its output cannot be predicted. For a draw that people want to trust, such as who presents first or who wins a class prize, the cryptographic generator is the better choice.

How do you pick names without repeats?

Draw without replacement: once a name is out, it leaves the pool until everyone has had a turn. In statistics this gives a simple random sample, in which every group of the same size has the same chance of being chosen, and drawing without replacement is the usual way to take one.

With replacement, repeats arrive fast. Picking 10 times from 30 names, the chance that at least one name comes up twice is about 82%, and after 30 picks each student still has about a 36% chance of never having been called. Without replacement, 30 picks call all 30 students exactly once.

A whole round can also be fixed at once by shuffling the list. The standard method is the Fisher–Yates shuffle, described by Ronald Fisher and Frank Yates in 1938 and turned into a computer method by Richard Durstenfeld in 1964. It goes through the list from the end and swaps each name with a randomly chosen name at or before it; with an unbiased random source, every order is equally likely.

How do you split a class into random teams fairly?

Shuffle the whole list, then deal the names out one by one like cards: team 1, team 2 and so on, then back to team 1. Dealing keeps the sizes even. 30 students in 4 teams become teams of 8, 8, 7 and 7; 27 students in teams of 4 become 7 teams, six of 4 and one of 3.

To call on students one at a time, use the free spin wheel at VITON13 SCHOOL. Type or paste up to 100 names, one per line, and spin with a click, the Spin button, Space or Enter; the winner is drawn with crypto.getRandomValues before the wheel moves. Turn on “Remove the winner” so each name leaves the wheel after its turn, and “Put back” returns everyone. Full screen enlarges the wheel for a projector, Share copies a link that carries the list, and repeating a line gives that option a second segment and a bigger chance.

For several names at once or for teams, open the random number generator. In List mode, paste the names and choose how many to pick: they come out with no repeats. In Teams mode, split the list into a set number of teams or into teams of a set size; the list is shuffled and dealt, so sizes differ by one at most. The last 20 results are kept in your browser only, and nothing is uploaded.

[2][3]

In everyday language

A fair name picker works like a well-shuffled deck of cards: no card knows where it will land. Drawing without replacement is dealing the deck to the end before shuffling again, so everyone gets exactly one turn.

Try it yourself

Paste your class list into the spin wheel, turn on “Remove the winner” and spin until one name is left.

Expected result

Each spin shows one name in large type, and that name leaves the wheel when you spin again. When one name is left, that student goes last, and “Put back” starts a new round.

Check your answer: A class of 24 is split into 5 teams by dealing a shuffled list. What sizes are the teams?

Four teams of 5 and one team of 4. After 20 names every team has 4; the remaining 4 names go to the first four teams, so 5 + 5 + 5 + 5 + 4 = 24.

Questions

Can a random name picker choose the same name twice in a row?

Yes, if names go back into the pool. Each draw is independent, so with 25 names the chance of the same name twice running is 1 in 25. Removing each winner prevents it.

Is a spin wheel fairer than drawing names from a hat?

Both are fair when done properly. A hat depends on equal slips and good mixing; the wheel here draws the winner with the browser's cryptographic generator before it starts to turn, so the animation cannot change the result.

Next time you need a volunteer or teams, put the class list into the free VITON13 SCHOOL spin wheel or random generator, draw without replacement and let the class watch the draw happen.

Sources and further reading

  1. Fisher–Yates shuffle — Wikipedia ↗Sources checked:
  2. MDN Web Docs: Crypto.getRandomValues() ↗Sources checked:
  3. Simple random sample — Wikipedia ↗Sources checked: