Back to the blog
Inside random group generationPublished July 20268 min read

How Random Group Generators Work: Seeds, Shuffling, and Fair Groups

A random group generator needs more than a button labeled “shuffle.” Here is the precise path from browser randomness to a group assignment—and why random, balanced, and fair are not interchangeable claims.

01

Browser entropy

The browser supplies cryptographically strong random bytes.

02

Fresh seed

Those bytes become the compact starting value for one solve.

03

Randomized search

A seeded generator produces the choices used while exploring assignments.

04

Scored result

The solver returns a valid assignment shaped by the selected goals and rules.

GroupMixer’s browser path separates the source of unpredictability from the solver that turns randomized choices into a useful group assignment.

A random group generator normally combines an unpredictable starting value with a deterministic algorithm. The source supplies the seed; the algorithm turns that seed into a sequence of choices.

That distinction matters. A browser does not need to collect fresh physical noise for every participant placement. It obtains high-quality random bytes once, then a pseudorandom generator expands the seed into the many decisions needed by a shuffle or search. With the same seed and the same deterministic process, the same sequence can be produced again.

Entropy, seed, and pseudorandom sequence

01

Entropy source

The platform facility that provides unpredictable bytes. In a modern browser, Web Crypto exposes this through crypto.getRandomValues().

02

Seed

A compact value used to initialize a pseudorandom generator. Changing the seed changes the sequence of later randomized choices.

03

Pseudorandom generator

A deterministic algorithm that expands the seed into a long sequence with the statistical properties needed by the application.

What a simple random group generator does

The simplest defensible method is to shuffle the participant list, then deal the shuffled names into groups. A Fisher–Yates-style shuffle can make every list permutation equally likely when each swap position is selected uniformly. Group sizes can then be filled in round-robin order or by taking consecutive slices.

This gives a clean random split, but it has no memory and no understanding of outcomes. It can put every experienced participant in one group, repeat yesterday’s pairs, separate required partners, or violate room capacities. Better random bytes do not solve those modeling problems.

The GroupMixer path

Randomized optimization, not a blind shuffle

When the browser-facing solver receives no seed, GroupMixer’s WebAssembly boundary asks the Rust getrandom crate for eight random bytes. On browser WASM, the enabled wasm_js backend uses Crypto.getRandomValues(). If that request fails, GroupMixer returns an explicit error instead of substituting a weaker source.

The resulting seed drives randomized solver paths, including seeded ChaCha12 generators used throughout the search code. Random choices help construct candidates, choose moves, break ties, and explore alternatives. The optimizer then evaluates those alternatives against the active model: capacities and hard rules must remain valid, while balancing, unique contacts, repeat reduction, and soft preferences affect the score.

Consequently, GroupMixer is a random group generator, but it does not promise a uniform draw from every mathematically possible partition. Once goals or constraints are active, some valid assignments are deliberately preferred over others.

Does stronger randomness make groups fair?

Not by itself. “Fair” can describe the procedure, the validity of the assignment, or the quality of the outcome. Those are different properties.

Random procedure

A fresh, unpredictable seed means the next randomized search path is not chosen manually or derived from the participant names.

Valid assignment

Capacities, attendance, fixed placements, and hard together/apart rules still have to hold. Randomness does not override them.

Useful outcome

Balance goals and repeat reduction can prefer one valid assignment over another. That is optimization, not a uniform lottery over every partition.

What a seed can reproduce

A deterministic seed controls the randomized sequence, which is useful for debugging and comparison. It is not a permanent identifier for a result. Exact reproduction also requires the same participant data, rules, solver settings, solver version, and deterministic stopping conditions.

Same seed, same fixed iteration limit

The strongest reproducibility case when the inputs, settings, and software version are also unchanged.

Same seed, wall-clock time limit

The random sequence is controlled, but machines or browser scheduling can let the solve stop after different amounts of work.

Generate or Reshuffle

The quick tool starts a new unseeded solve, so the browser supplies a fresh secure seed for the next search.

The precise claim

GroupMixer obtains fresh cryptographically strong seed material from the browser, uses seeded pseudorandom exploration inside a local Rust and WebAssembly solver, and returns a valid assignment shaped by the chosen requirements and optimization goals. Secure seeding makes the search path unpredictable; the model—not the entropy source—defines what a good grouping means.

Open the random group generator

Sources and implementation references