回复:15 is # of combination of 4 numbers out of 6, 20 is 3 out of

来源: 2012-04-12 09:37:45 [博客] [旧帖] [给我悄悄话] 本文已被阅读:

1. none of the 4 repeating ones fall in 1st position(million-th) & not zero (15*9*8*8*7)

15: 4 repeats in the six positions other than first, so it's the number of possible positions for the four repeats (6x5x4x3)/(4x3x2x1)

9: 4 repeats can be any of the numbers 1 to 9

8: the first position can take any of the other numbers from 1 to 9 other than the repeated number

8 and 7: the remaining 2 positions can take any of the numbers left from 0 to 9 without replacement, with 8 numbers left for the first remaining position and 7 for the last position

2. the 4 repeating one start on 1st position (20*9*9*8*7)

20: 4 repeats in the seven positions, so it's the number of possible positions for the four repeats, (7x6x5x4)/(4x3x2x1)

9: 4 repeats can be any of the numbers 1 to 9

9 and 8 and 7: the remaining 3 positions can take any of the numbers left from 0 to 9 without replacement, with 9 numbers left for the first remaining position, 8 for the second and and 7 for the last position

3. the 4 repeating ones are zeros (15*1*9*8*7)

15: 4 repeats in the six positions other than first, so it's the number of possible positions for the four repeats, (6x5x4x3)/(4x3x2x1)

1: only 1 number in this situation for repeats (which is zero)

9: the first position can take any of the other numbers from 1 to 9 other

8 and 7: the remaining 2 positions can take any of the numbers left from 1 to 9 without replacement, with 8 numbers left for the first remaining position and 7 for the last position