how many 3-digit numbers can be formed using only the digits 1 to 7, if the number 2 must be included? (Repetitions are allowed)

The books says 127. Could someone please explain this? Thanks

Since repetition is allowed, and the 2 must be included, it is easy to forget that the 2 can show up once, twice or even three times

case 1: only one 2
number of ways = 3(6)(6) = 108
(2XX, X2X, XX2, where X is one of the other 6 digits)

case 2: two 2's
number of ways = 3(6) = 18
(22X, 2X2, X22, where X is one of the other 6 digits)

case 3: three 2's , namely 222
number of ways = 1

total = 108+18+1 = 127

127=7^3-6^3

7^3 all 3-digit numbers, formed using
1,2,3,4,5,6,7
6^3 ... using 1,3,4,5,6,7

Mgraph

Very nice, good logic.

To find the number of 3-digit numbers that can be formed using only the digits 1 to 7, with the condition that the number 2 must be included, we need to consider the different positions that the digits can take.

We have three positions for the digits, and since repetitions are allowed, each position can have any of the digits from 1 to 7.

However, since the number 2 must be included, we can fix the first position of the number to be 2. So we already have one fixed digit.

For the remaining two positions, we can choose any digit from the set {1, 3, 4, 5, 6, 7} for each position, that means we have 6 choices for each of these two positions.

Therefore, the total number of 3-digit numbers that can be formed is obtained by multiplying the number of choices for each position together.

Number of choices for the first position = 1 (since it must be 2)
Number of choices for the second position = 6
Number of choices for the third position = 6

Total number of 3-digit numbers = Number of choices for each position multiplied together
= 1 * 6 * 6
= 36

So, the book's answer of 36 is incorrect. The correct number of 3-digit numbers that can be formed with the given conditions is 36.