We call a number special if every digit in the number either is a 1 or borders a 1. for example, 11111, 13, 141, 1441, 515151, and 101 are all special, but 10001, 222, 122, and 1333 are not special. how many 3-digit numbers are special?

Respuesta :

The first three digit number is 100. It is not special because the the zero on the units is not bordering a 1.

The umbers that start and finish with 1 are special: 101, 111, 121, ... 191 => 10 numbers

The numbers that start with 11 are special:

110, 111 (repeated), 112, 113, 114, 115, 116, 117, 118, 119 => 9 new numbers

The numbers that finish with 11special:

111 (repeated), 211, 311, 411, 511, 611, 711, 811, 911 => 8 new numbers

The numbers that have 1 in the center are special:

Numbers that start with 2 and have 1 in the center: 201, 211 (repeated), 212,  213, 214, 215, 216, 217, 218, 219, => 9 new numbers

Numbers that start by 3 and have 1 in the center: 301, 311 (repeated), 312, 313, 314, 315, 316, 317, 318, 319 => 9 numbers

Starting with 4 => 9 numbers

Starting with 5 => 9 numbers

Starting with 6 => 9 numbers

Starting with 7 => 9 numbers

Starting with 8 => 9 numbers

Starting with 9 => 9 numbers

total = 10 + 9 + 8 + 8*9 = 99 numbers


You can do that quickly if you use counting theory by realizing that the numbers are of the kind:

1 X 1, where X may be any digit from 0 to 0 => 10 numbers, or

X 1 Y, where X may be any digit from 1 to 9 and Y may be any digit from 0 to 9 => 9 * 1 * 10 = 90 numbers, but you have to subtract 1 because it includes number 111 which was already counted => 89 numbers

10 numbers + 89 numbers = 99 numbers (same answer)
Answer: 99