Number of ways to win a lottery

235 Views Asked by At

I have a larger problem where the core could be simplified with the following analogy:

In a lottery game, there are five balls numbered from 1-5 . We call the numbers 1, 2,3 winning numbers. A lottery ticket contains 3 to 5 digits. A winning ticket must contain all three the winning numbers. How many winning tickets are possible ?

My attempts:

  • Step 1: find the count of winning tickets with 3 numbers only: 3P3= 6
  • Step 2: Find the count of winning tickets with 4 numbers only: 4P3 * 2 = 24*2=48 (permutation of a sample of 3 out of 4 objects times 2 which is the non winning numbers)
  • Step 3: Find the count of winning tickets with 5 numbers only: 5!/2! * 2P2 = 120( winning tickets Assuming the two non-winning digits out of the 5 numbers are non-distinctive times permutation of a sample of 2 out of 2 objects which is the non winning numbers)
  • Step 4: Sum all result in step 1, 2 and 3 = 6+48+120= 174

Is my attempt correct? is there a compact formula without calculating the value iteratively step by step for example, my actual problem has 100 balls out of which 30 are winning numbers?

2

There are 2 best solutions below

0
On BEST ANSWER

As clarified in the comments all numbers in a ticket are different which makes the problem rather trivial. Your attempt is correct.

In general case the number of winning tickets is $$ \sum_{i=m}^n \binom{n-m}{i-m}i! $$ where $n$ is the number of balls, $m$ is the number of winning balls, $\binom{n-m}{i-m}$ and $i!$ stay for the number of ways to choose $i-m$ non-winning balls and to order the balls in a ticket containing $i$ numbers, respectively.

0
On

I think 174 as well

It is because there are P(3,3) 3 digit lottery tickets, C(2,1)*P(4,4) 4 digit lottery tickets and P(5,5) 5 digit lottery tickets.

Hence 3! + 2*4! + 5! = 6 + 48 + 120 = 174 possible tickets.

As far as process is concerned, I find separation at 5 digit tickets not required as when taking 5 numbers out of 5, it would have all the numbers. Again this is done assuming the numbers dont repeat.