acura1234567890
Joined: Sep 4, 2018
• Posts: 25
June 21st, 2021 at 7:41:51 AM permalink
So a nerdy question here,

You have an instant ticket game. The game has two "winning Player numbers" from 1-20 and you have to match a like number or multiple matches in a field of 10 numbers with the same range.

Example: Players Numbers 14 7

18 (\$5) 20 (\$100) 3 (\$2500) 9 (\$500) 10 (\$50)

17 (\$25) 4 (\$1) 19 (\$1000) 5 (\$3) 12 (\$2)

The game has predetermined winners in the entire game (a seeded outcome)

So the game would have a fixed number of prizes predetermined for the entire game.

EX.

4 \$50,000
10 \$5000
20 \$500
200 \$100
500 \$50
1000 \$25
2000 \$5
5000 \$2

How would one create an algorithm say in excel to achieve this?
Dieter
Joined: Jul 23, 2014
• Posts: 2354
June 21st, 2021 at 7:58:50 AM permalink
Don't overlook the importance of including \$0 prizes in your lottery.
May the cards fall in your favor.
ThatDonGuy
Joined: Jun 22, 2011
• Posts: 5076
June 21st, 2021 at 8:27:45 AM permalink
Here's one way to do it:
For each ticket, generate a set of 12 different numbers from 1-20, and randomize the order. The first 10 are the prize numbers, and the last two are the player numbers.
Also, generate a random order of the 10 prize amounts for each ticket, then assign the first amount to the first number, the second amount to the second number, and so on.
Once you have done that, start with the \$50,000 prizes; take the first four tickets, and change one of the two player numbers to that ticket's \$50,000 number.
Do the same thing with the ten \$5000 prizes, then the 20 \$500 prizes, and so on.
Since the first 12 numbers are different, this guarantees that any ticket that didn't have either of its player numbers set to a winning number will be a losing ticket.
ECoaster
Joined: Apr 21, 2014
• Posts: 156
June 21st, 2021 at 12:08:05 PM permalink
Quote: ThatDonGuy

Once you have done that, start with the \$50,000 prizes; take the first four tickets, and change one of the two player numbers to that ticket's \$50,000 number.

It's a good basic way to do it... of course actual lottery scratch offs are more complicated. For example, a \$50 winner card might be generated by having 2 different \$25 winning spots.
acura1234567890
Joined: Sep 4, 2018