[Math] Discrete Math: determine the number of six digit integers (no leading zeros)

combinationsdiscrete mathematicspermutations

– Background Information:

I am studying discrete mathematics, as I was practicing, I came across this problem and solution in my textbook. However, I cannot fully understand the solution. I need some clarification, thanks.

– Question:

Determine the number of six-digit integers (no leading zeros)
in which (a) no digit may be repeated; (b) digits may be
repeated. Answer parts (a) and (b) with the extra condition that
the six-digit integer is (i) even; (ii) divisible by 5; (iii) divisible
by 4.

– Textbook Solution:

For part b i)

ANSWER:
case 1:(9 * 8 * 7 * 6 * 5 * 1) for integers ending in 0.
case 2: (8 * 8 * 7 * 6 * 5 * 4) for integers ending in 2,4,6, and 8.

result: case 1 + case 2 = 68,800

– My Questions:

Why do we start with 8 and not 9? Could you please explain how case 2 is structured?

Best Answer

Call the six digits $D_1, D_2, \ldots, D_6$. In case two, the order in which we are choosing them is $D_6, D_1, D_2, \ldots, D_5$.

  • For $D_6$, there are four choices: 2, 4, 6, 8.
  • For $D_1$, there are eight choices: all nine of 1-9 (can't start with zero!), except $D_6$.
  • For $D_2$, there are eight choices: all ten of 0-9, except $D_6$ and $D_1$.
  • For $D_3$, there are seven choices: all ten of 0-9, except $D_6$ and $D_1$ and $D_2$.
  • For $D_4$, there are six choices: all ten of 0-9, except $D_6,D_1,D_2,D_3$.
  • For $D_5$, there are five choices: all ten of 0-9, except $D_6,D_1,D_2,D_3,D_4$.