SOLUTION: How many 9-digit codes can be formed if the code starts with 000 or ends with 1?

Algebra.Com
Question 1189546: How many 9-digit codes can be formed if the code starts with 000 or ends with 1?
Answer by ikleyn(52790)   (Show Source): You can put this solution on YOUR website!
.
How many 9-digit codes can be formed if the code starts with 000 or ends with 1?
~~~~~~~~~~~~~~~~~~~~

To solve the problem, we should calculate separately

    - the number of the 9-digit codes that start with 000;

    - the number of the 9-digit codes that end with 1;

    - and then calculate the number of the codes in the union of these two sub-sets.


(1)  The number of the 9-digit codes that start with 000 is  = ,

     since the first three digits are just pre-determined, and only 6 remaining positions 
     each may have any of 10 digits.


(2)  The number of the 9-digit codes that end with  is  = ,

     since the last digit is just pre-determined, and only 8 remaining positions 
     each may have any of 10 digits.


(3)  To complete the solution, apply the formula for the union

          =  +  - .


       equals to  , since the intersection is the set of all codes

     that have pre-determined 000 in the first 3 positions and 1 in the last position,
     having all 5 = 9-3-1 positions free for any of 10 digits.


     THEREFORE, the final formula and the final answer are

          =  +  -  = 1,000,000 + 100,000,000 - 100,000 = 100,900,000.


ANSWER.  There are  100,900,000  such codes.

Solved.

----------------

In short form and for your better understanding:

        add the numbers of codes of each type; then subtract the number of codes
        in the intersection, because otherwise you count them twice.



RELATED QUESTIONS

how many three digit number can be formed using all the available digits (0-9) such that... (answered by Fombitz)
With the digits 1, 2, and 3, and the letters a and b, how many codes can be formed such... (answered by oscargut)
How many 3-letter codes can be formed with the letters A, B, and C if each letter can be... (answered by Fombitz)
A briefcase lock opens with the correct 4-digit code. If the digits can be any number... (answered by Alan3354,ikleyn)
Canadian postal codes consist of three letter (A-Z) and three digits (0-9), which... (answered by TimothyLamb)
Most ATMs require that you enter a four-digit code, using the digits 0 to 9. How many... (answered by solver91311)
A ZIP code contains 5 digits. How many different ZIP codes can be made with the digits 0... (answered by ewatrrr)
pls help... answer ASAP : a three digit code is made up of three diff. digts from (answered by Theo,richard1234)
you create a four digit code for your ATM card using the digits 0 to 9. how many... (answered by stanbon)