document.write( "Question 1189546: How many 9-digit codes can be formed if the code starts with 000 or ends with 1? \n" ); document.write( "
Algebra.Com's Answer #820932 by ikleyn(52790)\"\" \"About 
You can put this solution on YOUR website!
.
\n" ); document.write( "How many 9-digit codes can be formed if the code starts with 000 or ends with 1?
\n" ); document.write( "~~~~~~~~~~~~~~~~~~~~\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "
\r\n" );
document.write( "To solve the problem, we should calculate separately\r\n" );
document.write( "\r\n" );
document.write( "    - the number of the 9-digit codes that start with 000;\r\n" );
document.write( "\r\n" );
document.write( "    - the number of the 9-digit codes that end with 1;\r\n" );
document.write( "\r\n" );
document.write( "    - and then calculate the number of the codes in the union of these two sub-sets.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "(1)  The number of the 9-digit codes that start with 000 is \"N%5B000%5D\" = \"10%5E6\",\r\n" );
document.write( "\r\n" );
document.write( "     since the first three digits are just pre-determined, and only 6 remaining positions \r\n" );
document.write( "     each may have any of 10 digits.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "(2)  The number of the 9-digit codes that end with  is \"N%5B1%5D\" = \"10%5E8\",\r\n" );
document.write( "\r\n" );
document.write( "     since the last digit is just pre-determined, and only 8 remaining positions \r\n" );
document.write( "     each may have any of 10 digits.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "(3)  To complete the solution, apply the formula for the union\r\n" );
document.write( "\r\n" );
document.write( "         \"N%5Bunion%5D\" = \"N%5B000%5D\" + \"N%5B1%5D\" - \"N%5Bintersection%5D\".\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "     \"N%5Bintersection%5D\"  equals to  \"10%5E5\", since the intersection is the set of all codes\r\n" );
document.write( "\r\n" );
document.write( "     that have pre-determined 000 in the first 3 positions and 1 in the last position,\r\n" );
document.write( "     having all 5 = 9-3-1 positions free for any of 10 digits.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "     THEREFORE, the final formula and the final answer are\r\n" );
document.write( "\r\n" );
document.write( "         \"N%5Bunion%5D\" = \"10%5E6\" + \"10%5E8\" - \"10%5E5\" = 1,000,000 + 100,000,000 - 100,000 = 100,900,000.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "ANSWER.  There are  100,900,000  such codes.\r\n" );
document.write( "
\r
\n" ); document.write( "\n" ); document.write( "Solved.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "----------------\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "In short form and for your better understanding: \r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "        add the numbers of codes of each type; then subtract the number of codes \r
\n" ); document.write( "\n" ); document.write( "        in the intersection, because otherwise you count them twice.\r
\n" ); document.write( "
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "
\n" ); document.write( "
\n" );