Since they all start with 347, we only need to consider
the last 4 digits.
There are 6 cases to consider.
Let x = the exact number of zeros,
Let y = the exact number of ones
Then the exact number of other digits (2 through 9) is 4-x-y
Number Number Number
of of of
zeros ones others
Case x y 4-x-y
--------------------------------
A 1 1 2
B 1 2 1
C 1 3 0
D 2 1 2
E 2 2 0
F 3 1 0
Cases B and D are the same.
Cases C and F are the same.
In each of those 6 cases,
There are "4 choose x" positions to place the 0's
There are then "4-x choose y" positions to place the 1's
There are then 84-x-y ways to choose the others.
That's C(4,x)·C(4-x,y)·84-x-y for each case.
Number of cases of A = C(4,1)C(3,1)82 = 4·3·8·64 = 768
Number of cases of B = C(4,1)C(3,2)81 = 4·3·8 = 96
Number of cases of C = C(4,1)C(3,3)80 = 4·1·1 = 4
Number of cases of D = same as for case B = 96
Number of cases of E = C(4,2)C(2,2)80 = 6·1·1 = 6
Number of cases of F = same as for case C = 4
------------------------------------------------------
Total 974
Edwin