There are 5 ways you can get exactly 4 numbers right, and for each one the wrong number can be any one of the remaining 20. So expect 100 times as many matches.

I don’t follow your logic in the second part. I don’t see the relevance of the number of 4-number combinations, because each trial produces a 5-number combination, not 4-number.

Your mistake is that you replaced the wrong number when going from the 5-match to the 4-match case. 25c5=53510 tells you how many possible outcomes there are. That doesn’t change, so you should leave the “5” alone here.

If you want to match all five numbers, there is exactly one outcome that works. Thus, 1-in-53510 is the chance of hitting all five. Multiplying by the number of attempts gets you your first (correct) answer:

50,000,000 * (1/53510) = 941.1

If you want to match four numbers, you need to count up the number of possible 4-match outcomes. If your numbers are 1-2-3-4-5, then the complete list of 4-match outcomes is:

Ok, I think I see. I’d like to put this in a formula so that I can calculate not only the frequency of 4 number matches in the 5, but also the number of 3, 2, and 1 matches in the 5.

And I THINK this is the formula I need to calculate the number of “interesting” outcomes:

r * ((n - r) C (r - t))

where:
r = the number of numbers drawn in the lottery (in our case, 5)
n = the number of “balls in the urn” (in our case 25)
t = the number of exact matches within the “r” number drawn.

For the case of 4 exact matches, r = 5, n = 25, t = 4 which gives

You’re on the right track. It looks like you tried the r out front because that’s what worked for the 4-match case. If you plug in the 5-match numbers, though, you’ll find it doesn’t work for that one (or, as you found, the 2-match or 3-match).

You’re spot on with the second factor: You have to pick (r-t) values from the list of (n-r) un-guessed numbers. For the numbers you got corrent, you need the same logic: You have to pick (t) values from the list of (r) guessed numbers. For example, if you chose 1-2-3-4-5 as your numbers and you are looking to guess two right, you might match 1-2, 1-3, 1-4, etc. The number of possible pairs is (5 C 2) since you are picking two items from a list of five.

The final result is thus the product of the two combinations:

(r C t) * ( (n-r) C (r-t) )

The reason your formula worked for the 4-match and 1-match cases is because