Winner Selection

The mathematics of fair giveaway draws

Overview

How winners are fairly selected

Swisserways uses a weighted lottery system to select winners. Your chance of winning is directly proportional to the number of entries you've earned through completed tasks and bonuses.

Mathematically fair and verifiable
More entries = higher win probability
Cryptographically secure randomization
Algorithm is fully transparent

Entry Calculation

How your total entries are determined

Your total entries for a giveaway are the sum of all task entries plus any booster bonuses you've earned.

The Formula

Your total entries are calculated as:

Etotal=i=1nei+BE_{total} = \sum_{i=1}^{n} e_i + B
EtotalE_{total}=Your total entries
eie_i=Entries from task i
nn=Number of completed tasks
BB=Booster bonus (0 if not boosting)

Example Calculation

Consider a giveaway with 3 tasks:

Task A (Join Discord): 1 entry

Task B (Follow Twitter): 2 entries

Task C (Subscribe YouTube): 3 entries

Booster bonus: +2 entries

If you complete all tasks and are a server booster:

Total = 1 + 2 + 3 + 2 = 8 entries

Weighted Lottery

How the entry pool works

The winner selection uses a weighted lottery where each of your entries represents one "ticket" in the drawing pool.

The Entry Pool

Imagine a pool containing one ticket for each entry from every participant. If you have 6 entries and another participant has 3 entries, the pool contains 9 tickets total - 6 with your name and 3 with theirs.

The total pool size is the sum of all participants' entries:

Ptotal=j=1mEjP_{total} = \sum_{j=1}^{m} E_j

Visual Example

For a giveaway with 3 participants:

A
User A: 6 entries (6 tickets in pool)
B
User B: 3 entries (3 tickets in pool)
C
User C: 1 entry (1 ticket in pool)

Total pool: 10 tickets

Win Probability

Calculating your chances

Your probability of winning is simply your entries divided by the total pool size.

Probability Formula

Your win probability is calculated as:

P(win)=EuserPtotal=Euserj=1mEjP(win) = \frac{E_{user}}{P_{total}} = \frac{E_{user}}{\sum_{j=1}^{m} E_j}

Probability Example

Using the previous example with 10 total entries:

User A: 6/10 60%
User B: 3/10 30%
User C: 1/10 10%

Note

These probabilities always sum to 100%.

Multiple Prizes

When a giveaway has multiple prizes, winners are drawn one at a time. Each user can only win once, so after someone wins, they're removed from the pool for subsequent drawings.

Complete Example

A worked-through scenario

Scenario

A giveaway with:

  • 2 prizes to give away
  • Tasks worth 1, 2, and 5 entries
  • Booster bonus: +3 entries

Participants

Alice

Completes all tasks + is boosting

1 + 2 + 5 + 3 = 11 entries
Bob

Completes all tasks, not boosting

1 + 2 + 5 + 0 = 8 entries
Charlie

Only completes first task

1 + 0 + 0 + 0 = 1 entry

The Drawing

Total pool: 11 + 8 + 1 = 20 entries

First Prize Draw

Alice:11/20 = 55%
Bob:8/20 = 40%
Charlie:1/20 = 5%

Second Prize Draw (assuming Alice won first)

Alice is removed from the pool:

New pool: 8 + 1 = 9 entries

Bob:8/9 = 88.9%
Charlie:1/9 = 11.1%

Cryptographic Fairness

How we ensure truly random selection

We use industry-standard cryptographic methods to ensure winner selection is completely random and unbiased.

Fisher-Yates Shuffle

The entry pool is shuffled using the Fisher-Yates algorithm, which guarantees that every possible ordering has an equal probability of occurring.

Web Crypto API

Instead of using Math.random(), we use the Web Crypto API (crypto.getRandomValues()) which provides cryptographically secure random numbers. This makes the selection unpredictable and manipulation-proof.

Verification

The algorithm runs server-side with comprehensive logging. Each winner selection is recorded with timestamps, entry counts, and pool sizes for auditability.

Shuffle Visualization

Watch how the entry pool gets shuffled step by step

Step 1 / 6
Fisher-Yates shuffles from right to left. Each position swaps with a random position to its left (or itself).
A1
A2
A3
B4
B5
C6
Initial pool state
Alice (3 entries)
Bob (2 entries)
Charlie (1 entry)

Winner Validation

Ensuring winners are legitimate

Before a winner is confirmed, we verify they're still eligible. This is called "lazy validation" - we only check winners, not all entries.

Discord Membership Check

If the giveaway required joining a Discord server, we verify the selected winner is still a member. If they left the server, they're disqualified and a new winner is drawn.

Automatic Reroll

Invalid winners are automatically removed from the pool and a new winner is drawn. This continues until all prize slots are filled with valid winners or the pool is exhausted.

One Win Per User

One Win Per User

Each user can only win once per giveaway, regardless of how many prizes are available. This ensures fair distribution across more participants.

Frequently Asked Questions