Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Basic combinatorics

Options
  • 11-03-2016 4:24pm
    #1
    Registered Users Posts: 28


    A lottery is run where balls numbered 1 to 30 are taken out of a bag. How many different
    ways are there of choosing 3 numbers from these 30?

    The answer given to this question from the book I'm using is 4060:
    30x29x28 / 3x2x1 = 4060

    However if you use factorials: 30! / (30-3)! you get 24360

    Can anyone tell me which is the correct way and why?


Comments

  • Registered Users Posts: 5,141 ✭✭✭Yakuza


    4060 is correct.
    You have 30 numbers to choose from for the first, 29 for the second and 28 for the 3rd. This means there are 30 * 29 * 28 ways to choose 3 numbers from 30.

    However, of all those ways there are many repeated sequences (1 2 3, 1 3 2, 2 1 3, 2 3 1, 3 1 2, 3 2 1) which amount to the same thing.
    So, of the 3 numbers you've chosen, how many ways can they be arranged? 3! (3 choices for the first, 2 for the second and one for the third).

    Therefore, you have to divide the larger number of permutations (full of repetition) by the number of ways to arrange the chosen numbers to come up with the number of unique combinations,

    So, the answer is (30 * 29 * 28) / (3 * 2 * 1) = 4060.

    More generally, this is n! / r! where n is the total number of objects and r the amount chosen.

    If order doesn't matter, it's a combination (like in the Lotto draw).
    If order does matter, it's a permutation. Strictly speaking, a combination lock should be called a permutation lock as order matters with them :)


  • Registered Users Posts: 9,018 ✭✭✭Ficheall


    Yakuza wrote: »
    More generally, this is n! / r! where n is the total number of objects and r the amount chosen.
    Just in case it throws anyone, you've a typo there - should be n!/(r!(n-r)!) .


  • Registered Users Posts: 5,141 ✭✭✭Yakuza


    Indeed, my bad.


  • Registered Users Posts: 28 Ronan5000


    Dd


Advertisement