A four-digit number is formed by using only the digits 1, 2 and 3 such that both 2 and 3 appear at least once. The number of all such four-digit numbers is
To determine the count of four-digit numbers composed solely of digits 1, 2, and 3, where both 2 and 3 are present at least once, we follow these steps:
Step 1: Determine the total number of possible four-digit numbers:
Each of the four positions can be filled with one of three digits (1, 2, or 3).
Total combinations: $3^4 = 81$
Step 2: Calculate the number of cases where either 2 or 3 is absent:
Numbers formed using only 1 and 3 (no 2): $2^4 = 16$
Numbers formed using only 1 and 2 (no 3): $2^4 = 16$
Numbers formed using only 1 (no 2 and no 3): $1^4 = 1$
Applying the Principle of Inclusion-Exclusion to find cases where at least one of 2 or 3 is missing: $16 + 16 - 1 = 31$
Step 3: Subtract excluded cases from the total:
Numbers that contain both 2 and 3 at least once: $81 - 31 = 50$
Step 4: State the final result:
The count of four-digit numbers using only digits 1, 2, and 3, with both 2 and 3 appearing at least once, is 50.