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 Enough probability Question

Options
  • 06-01-2016 12:10am
    #1
    Registered Users Posts: 476 ✭✭


    My LC maths skills have eluded me and I have a programming assignment due soon but I need to have knowledge of the following information. Here is the exact question I have. It is for an ARM assembly assignment but I am not asking for programming help.
    The Imaginary Lottery Company sells lottery tickets for a weekly draw. Players choose six numbers between 1 and 32 when purchasing an Imaginary Lottery ticket. There are prizes for matching four, five or six numbers.

    Design and write an ARM Assembly Language program that will determine the number of tickets that match four numbers, five numbers and six numbers. (i.e. Your program should produce three result values for the number of “match four” tickets, “match five” tickets and “match six” tickets.).

    Assuming the numbers drawn are 1,2,3,4,5,6.

    There is obviously 1 winning ticket that has all 6.

    Could there be 26 which has 5 matching e.g
    1,2,3,4,5,7
    1,2,3,4,5,8
    1,2,3,4,5,9 etc?


Comments

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


    Not quite, there are more match 5's than that.
    In order to work out how many combinations there are, divide the set of 32 into 6 winners and 26 non-winners.

    For a match 5, you need 5 from the winning 6 numbers and one from the 26 non-winners, formally [latex] {6 \choose 5} * {26 \choose 1} [/latex] or 6 * 26 = 156.
    The match 4 category will have [latex] {6 \choose 4} * {26 \choose 2} [/latex] or 15 * 325 = 4875 sets in it.

    So, your program should produce the following answers:
    Match 6 :    1
    Match 5 :  156
    Match 4 : 4875
    


  • Registered Users Posts: 476 ✭✭RoRo979


    Yakuza wrote: »
    Not quite, there are more match 5's than that.
    In order to work out how many combinations there are, divide the set of 32 into 6 winners and 26 non-winners.

    For a match 5, you need 5 from the winning 6 numbers and one from the 26 non-winners, formally [latex] {6 \choose 5} * {26 \choose 1} [/latex] or 6 * 26 = 156.
    The match 4 category will have [latex] {6 \choose 4} * {26 \choose 2} [/latex] or 15 * 325 = 4875 sets in it.

    So, your program should produce the following answers:
    Match 6 :    1
    Match 5 :  156
    Match 4 : 4875
    

    But order does not matter in this question so would it not be that the person has 5 correct numbers. therefore there is now 27 remaining. If the user got picked number 6 then he/she would have won so that leaves 26 possible numbers that could have been picked no?


  • Registered Users Posts: 1,768 ✭✭✭timsey tiger


    RoRo979 wrote: »
    But order does not matter in this question so would it not be that the person has 5 correct numbers. therefore there is now 27 remaining. If the user got picked number 6 then he/she would have won so that leaves 26 possible numbers that could have been picked no?

    Correct, however you've forgotten to consider how many ways you can get five correct numbers. You could be missing the first one or the second one or the third one...

    Giving 6 different ways you can get 5 out of the six winners. Then for each of these you have 26 options to pick the final wrong number, giving a total of 6 by 26 = 156 possible match five tickets


  • Registered Users Posts: 23,360 ✭✭✭✭ted1


    4 numbers = 32*31*30*29/ 4*3*2*1
    5numberd as above but *28 /5..,.
    6numbers as above but *27/6.,,,


Advertisement