Lotto Numbers Generator

The example is an expansion of the Lotto Number Generator program. It allows users to select their inputs, number of population set (from 10 to 100) and the number of data point to be selected (from 2 to 10), and then populate the random number. Even though the lotto example is used, gambling is not encouraged.

This program involves resampling without replacement. The sub-procedure, DoubleSort( ), sorts the numbers of one array based on the numbers of another array. The sub-procedure, Resample( ), creates numbers from 1 to 54 for array two (Hold2) and 54 random numbers for array one (Hold), and calls in the sub-procedure, DoubleSort( ). When executed,the program will return 5 sets of 6 lotto numbers in column B through F starting from row 13 of the worksheet. The user can select the number of sets by altering the number of iterations on line 4 of the program. An example of the output is displayed below.

This program involves resampling without replacement. The sub-procedure, DoubleSort( ), sorts the numbers of one array based on the numbers of another array. The sub-procedure, Resample( ), creates numbers from 1 to 54 for array two (Hold2) and 54 random numbers for array one (Hold), and calls in the sub-procedure, DoubleSort( ). When executed,the program will return 5 sets of 6 lotto numbers in column B through F starting from row 13 of the worksheet. The user can select the number of sets by altering the number of iterations on line 4 of the program. An example of the output is displayed below.

Copyright © XL Modeling.