Algebra - Elements of Combinatorics

How many four-digit numbers which are divisible by $4$ can be formed from the digits $1$, $2$, $3$, $4$ and $5$ if the digits are repeated?


A number is divisible by $4$ if the digits in its unit's and ten's place are divisible by $4$.

Since the digits are repeated, the digits in the ten's and the unit's place can be

$1$ and $2$ $\;$ OR $\;$ $2$ and $4$ $\;$ OR $\;$ $3$ and $2$ $\;$ OR $\;$ $4$ and $4$ $\;$ OR $\;$ $5$ and $2$ $\;$ respectively

i.e. $\;$ The digits in the ten's and the unit's place can be selected in $5$ ways.

For each of these selections,

the hundred's place can be selected in $5$ ways

and the thousand's place can be selected in $5$ ways.

$\therefore \;$ Total number of four digit numbers that can be formed from the digits $1$, $2$, $3$, $4$ and $5$ (digits repeated) which are divisible by $4$ are

$5 \times 5 \times 5 = 125$ numbers