Draw Code used by Flicker

Lottery Winning Probabilities

Game Overview

In this lottery system, 10 numbers are randomly drawn from a pool of 1 to 49. Players select 5 numbers, and prizes are awarded based on how many numbers match the drawn numbers.

Prize Distribution Rules

  • The minimum requirement to win any prize is matching 3 numbers.
  • If there's One of winners with 5 matches, receive 100% of the allocated SUPER JACKPOT.
  • If there's only 1 winner with 4+ matches, they receive 100% of the allocated JACKPOT prize.
  • With 2 winners having 4+ matches, prizes are distributed 62.5%/37.5%.
  • For 3-match winners, only 50% of the total pool is allocated, distributed as 30%/15%/5% for 1st/2nd/3rd places respectively.

This creates an interesting dynamic where larger prizes are exceptionally rare, while smaller wins occur relatively more frequently.

Probability Calculation

The probability P(k) of matching exactly k numbers out of 5 is calculated as:

P(k) = [C(5,k) × C(44,10-k)] / C(49,10)

Where:
• C(n,k) represents combinations (number of ways to choose k elements from n)
• 5 is the number of player-selected numbers
• 10 is the number of drawn winning numbers
• 49 is the total number of possible numbers

Probability Calculation Analysis

Hypergeometric Distribution Formula

P(k) = [C(5,k) × C(44,10-k)] / C(49,10)

3 Matches

P(3) = [C(5,3) × C(44,7)] / C(49,10)

= (10 × 38,608,020) / 8,217,822,536

≈ 386,080,200 / 8,217,822,536

≈ 0.04698 ≈ 1 in 21.28

4 Matches

P(4) = [C(5,4) × C(44,6)] / C(49,10)

= (5 × 7,059,052) / 8,217,822,536

≈ 35,295,260 / 8,217,822,536

≈ 0.004295 ≈ 1 in 233

5 Matches (SUPER JACKPOT)

P(5) = [C(5,5) × C(44,5)] / C(49,10)

= (1 × 1,086,008) / 8,217,822,536

≈ 1,086,008 / 8,217,822,536

≈ 0.000132 ≈ 1 in 7,566

Overall Winning Probability (≥3 Matches)

P(win) = P(3) + P(4) + P(5)

≈ 0.04698 + 0.004295 + 0.000132

≈ 0.0514 ≈ 1 in 19.45

This means a player has approximately 5.14% chance to win any prize.

Key Findings

  • The actual jackpot odds (5 matches) are 1 in 7,566
  • The chance to win any prize (≥3 matches) is 1 in 19.45

The method used for Draw

            
              /**               
               * Generates an array of unique random integers within a specified range in sorted order.
               *
               * Performed daily for draws with parameters of generateUniqueRandomSortedIntegers(10, 1, 49)
               *
               *
               * @param {number} count - The number of unique integers to generate (must be positive)
               * @param {number} min - The lower bound of the range (inclusive)
               * @param {number} max - The upper bound of the range (inclusive)
               * @returns {number[]} A sorted array of unique random integers
               * @throws {Error} If the requested count exceeds the possible unique values in the range
               * or if any parameter is invalid
               */
              function generateUniqueRandomSortedIntegers(count, min, max) {
                // Validate input parameters
                if (!Number.isInteger(count) || !Number.isInteger(min) || !Number.isInteger(max)) {
                  throw new Error("All parameters must be integers");
                }

                if (count <= 0) {
                  throw new Error("Count must be a positive integer");
                }

                if (min > max) {
                  throw new Error("Minimum value cannot exceed maximum value");
                }

                const rangeSize = max - min + 1;
                if (count > rangeSize) {
                  throw new Error(`Cannot generate ${count} unique numbers in range [${min}, ${max}]`);
                }

                // For small ranges relative to count, use Fisher-Yates shuffle algorithm
                if (count > rangeSize / 2) {
                  const allNumbers = Array.from({length: rangeSize}, (_, i) => min + i);

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

                  return allNumbers.slice(0, count).sort((a, b) => a - b);
                }

                // For larger ranges relative to count, use Set approach
                const uniqueNumbers = new Set();
                while (uniqueNumbers.size < count) {
                  const randomNumber = Math.floor(Math.random() * rangeSize) + min;
                  uniqueNumbers.add(randomNumber);
                }

                return Array.from(uniqueNumbers).sort((a, b) => a - b);
              }