Question 706693
<pre>
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 8<sup>4-x-y</sup> ways to choose the others.

That's C(4,x)·C(4-x,y)·8<sup>4-x-y</sup> for each case.

Number of cases of A = C(4,1)C(3,1)8<sup>2</sup> = 4·3·8·64 = 768
Number of cases of B = C(4,1)C(3,2)8<sup>1</sup> = 4·3·8    =  96
Number of cases of C = C(4,1)C(3,3)8<sup>0</sup> = 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)8<sup>0</sup> = 6·1·1    =   6
Number of cases of F = same as for case C         =  4
------------------------------------------------------
Total                                              974

Edwin</pre>