Hello..alright bare with me
Of the 7 spots, 5 spots will be occupied by 3’s or 8’s…
So 5! / (2!*3!) = 10. So there are 10 possible ways that the 3’s and 8’s can be organized with within the 5 spots. Now put the number 10 aside for now and deal with the spots that are NOT 3’s or 8’s.
So the other 2 spots; which do not contain 3’s or 8’s, have 8 possible values (0,1,2,4,5,6,7,9). HOWEVER, the problem becomes more complicated because spot #1 (A) can not be 0 since if it was 0, then the number is no longer 7 digits, it would be 6.
So the possible locations for the non 3 or 8 digits are listed below from i) to vi). If the 7 digit number is: A B C D E F G.
(Where A is the millionth digit, B is the hundred thousands, C is the ten thousand, D is the thousand, E is the hundred, F is the tenth digit and G is the ones digit. )
i) AB, AC, AD, AE, AF, AG = 6 possibilities
ii) BC, BD, BE, BF, BG = 5 possibilities
iii) CD, CE, CF, CG = 4 possibilities
iv) DE, DF, DG = 3 possibilities
v) EF, EG = 2 possibilities
vi) FG = 1 possibilities
In i), A must be one of 7 digits (it can not be 0) so it can be 1,2,4,5,6,7,9. B/C/D/E/F/G can be 8 digits (0,1,2,4,5,6,7,9). So the different possibilities are 8*7*6 (the number of possibilities) = 336. Multiply 336 * 10 (which is the number of possible ways that the 3’s and 8’s can be organized so it is 3360.
In ii) B and C (since they are not the first digits) both have 8 possible values (0,1,2,4,5,6,7,9). This means that either 3 or 8 is one of the first digits (A) but we don’ so 8*8*5 = 320. (It is multiplied by 5 since there are 5 possibilities). The multiply 320 by 10 to factor in the 3’s and 8’s so 3200
iii) 8*8*4*10 = 2560
iv) 8*8*3*10 = 1920
v) 8*8*2*10 = 1280
vi) 8*8*1*10 = 640
So 3360 + 3200 + 2560 + 1920 + 1280 + 640 = 12,960
I can tell this is confusing but I couldn’t find another way to explain it. This took me 2 hours to figure out so If I was doing this on the GMAT I would get 1/40 and not get into any school, so if anyone knows a quicker way, please post!
ODOD