Match Day

Peg Draw


Number of Anglers:


Peg Numbers:


Drawing Mode:

AnglerPeg
Is it random? Is it fair?

Analysis of Peg Draw Script Fairness

1. Randomness of the draw:

You use a standard Fisher-Yates shuffle in the shuffle() function:

function shuffle(arr) {
  for (let i = arr.length - 1; i > 0; i--) {
    const j = Math.floor(Math.random() * (i + 1));
    [arr[i], arr[j]] = [arr[j], arr[i]];
  }
}

This is a well-known unbiased shuffling algorithm, widely accepted as fair and random.

The drawManualPeg() picks a peg with:

const index = Math.floor(Math.random() * pegPool.length);
currentManualPeg = pegPool[index];
				

This is a uniform random selection among remaining pegs.

Once a peg is drawn and confirmed, it’s removed from pegPool, so no repeats.

The automatic mode simply shifts pegs from the front of the already shuffled array, so it’s also fair.

2. Visual randomness:

Balls are rendered randomly inside the circle with random starting positions and velocities, so visually they move unpredictably.

The animation is independent of the peg drawn (ball position/velocity isn’t linked to peg selection), so it cannot bias the choice.

3. Possible concerns:

  • Randomness source: This depends on JavaScript’s Math.random(), which is not cryptographically secure but sufficient for casual fairness.
  • Reproducibility / Manipulation: If the script is running client-side, and users can access console or developer tools, they could manipulate Math.random() or pegPool before the draw to bias outcomes. This can be mitigated by ensuring you refresh the page before using this tool (ensuring nobody with technical knowledge has tampered with the client-side code prior to starting).
  • Timing of draw: Because the peg is randomly picked from the current pool at draw time, and the pool is shuffled once at start, the outcome is pretty unpredictable.

Summary

The script uses well-known fair randomization techniques and correctly removes drawn pegs to avoid duplicates. For typical angling matches, this should be sufficiently fair and unbiased to prevent claims of rigging — encourage any skeptical anglers to test the tool's randomness for themselves.