I am looking for an algorithm to create a raffle, where each participant is assigned a ticket with a random series of numbers.
Each raffle hast N participants, and there should exist same amount of raffle tickets, one ticket per user.
The user should know her ticket numbers before the draw, so she can follow the draw, and anticipate if she is a winner.
Each raffle has a minimum of one winner.
Some raffles can have two or more winning tickets, whereas each ticket can only win once. A winning ticket is removed from the current raffle.
If there is more than one winning ticket available, this should be determined before the beginning of the raffle.
It should be impossible to draw blanks.
How could a raffle with such properties be created. Or more specifically:
How can we generate the raffle numbers, and tickets as such, that each raffle has one or (1+N) guaranteed winning ticket. How can we avoid blanks?
Pseudocode would be great, and/or a few pointers of maybe well known algorithms solving similar issues.