Lottery ticket coverage from algorithm development guide?

I am reading Stephen S. Skien Algorithm Design Guide. In the first chapter I read about the problem with the lottery ticket. He claims that his first decision for the optimal number of tickets for guaranteed winnings was wrong. I do not understand how his next and final decision is right?

In Figure 1.11, he says: The guarantee of a winning pair from {1,2,3,4,5}, using only tickets {1,2,3} and {1, 4, 5}, is the scheme. I'm confused, why are there no other numbers there? For example, what if the winning numbers were (3.4), (2.4), (2.5), (3.5), etc. D ...? You obviously cannot combine tickets together, so how can we explain this? In the lottery, if they said that the winning numbers were 3 and 5, you should have one ticket in which 3 and 5 have some sort of order. Can someone explain please?

+9
design algorithm
source share
2 answers

In the example

  • n = 5 - numbers from the mental
  • j = 3 - the number of winning numbers from n
  • k = 3 - the number of slots in the ticket
  • l = 2 - the number of matches required to obtain valuable

What makes this case simple is that all numbers on the ticket must be between 1..5. This is due to the fact that j = k, which means that the number of winning numbers falling between 1 and 5 corresponds to the number of slots on the ticket.

So, get tickets {1, 2, 3} and {1, 4, 5}. This really means that you do not have the match {3, 5}, but if the numbers {3, 5} are indicated on the ticket, then the other number on the ticket must be set from the set {1, 2, 4}. If it is 1, then match 3 was picketed by the first ticket, if it is 2 then, if it is 5, then the second ticket catches it.

+10
source share

In Figure 1.11, the number of slots in each ticket is 3. Thus, there are 3 winning numbers. With two tickets {1,2,3} and {1,4,5} you are guaranteed to get at least 2 out of 3 winning numbers.

+1
source share

All Articles