Text
How many -digit numbers (i.e. from to ) have no two consecutive equal digits?
Solution
We count position by position with the product rule.
- First digit: from to (it cannot be ) choices.
- Each following digit can be any of the digits except the one immediately before it choices each.
Hence