AUTOMATED DRAWS

Automated Draws take place shortly after the draw time specified on the competition page. Here’s how they work:

  • Depending on the day’s schedule, Automated Draws might happen sooner or later, usually within a range of a few minutes.
  • We use a method called the Mersenne Twister algorithm to select a random number. It’s like picking a number from a hat.
  • This algorithm takes three inputs: the smallest possible number, the largest possible number, and a starting value called the seed.
  • For example, if we set the range from 1 to 100 and the seed as 1234560987123, it will give us a random number like 55.

To see this in action, you can follow these steps:

  1. Go to this website: https://onlinephp.io/
  2. Clear the first text box.
  3. Paste this code on the first line:
    <?php
    mt_srand(1234560987123);
    echo mt_rand(1, 1000);
    
  4. Click on “Execute Code”.

You’ll get “55” as the result. Changing the seed or the range will give you different numbers.

In our Automated Draws, we use:

  • The seed: This is calculated from the current time, which is a way of making it unpredictable as it’s triggered by random within a range of time
  • The range: This depends on the number of tickets, for example, 1 to 9999.

At the time of the draw:

  1. All ticket numbers are sorted by when they were issued.
  2. The tickets are compiled.
  3. The output from Mersenne Twister (like “5921” in our example) corresponds to a specific line in the list.
  4. The winning ticket number is found on that line – and the system will automatically email the winner.

To summarise, the Automated Draw process involves

  • Using the current time as a starting point (seed).
  • Defining the range based on the number of tickets.
  • Using Mersenne Twister to find the winning ticket’s position in the sorted list.
  • Identifying the winning ticket number on that line.

This randomness is introduced through:

  • Random allocation of ticket numbers to customers.
  • The unpredictable timing of the draw.
  • The inclusion of milliseconds in the seed.
  • Variations in the number of tickets for each draw.