We are asked to determine how many 6-digit numbers contain exactly 3 different digits.
To solve this problem, we'll consider two main cases based on whether zero is one of the three digits or not.
Case 1: Zero is not among the digits
First, we select 3 distinct digits from 1-9 (since zero cannot be the leading digit). The number of ways to do this is:
[ C(9, 3) = 84 ]
For each set of 3 digits, we need to count the number of 6-digit numbers that use only these digits and each digit must appear at least once. Since zero is not among the digits, any of the three digits can be the first digit.
The total number of 6-digit numbers using these digits (with repetitions allowed) is:
[ N = 3^6 = 729 ]
However, we need to exclude numbers where one or more of the digits are missing. We calculate the number of such numbers using the Inclusion-Exclusion Principle.
Number of numbers missing one digit (e.g., missing digit ( D_1 )):
[ N_{\text{missing } D_1} = 2^6 = 64 ]
We do this for each digit, so the total missing one digit is:
[ 3 \times 64 = 192 ]
But we've overcounted numbers missing two digits (i.e., numbers using only one digit). The number of numbers missing two digits is ( 1^6 = 1 ) for each case, so:
[ N_{\text{missing two digits}} = 3 \times 1 = 3 ]
Using the Inclusion-Exclusion Principle:
[ N_{\text{at least one missing}} = \text{Total missing one digit} - \text{Total missing two digits} = 192 - 3 = 189 ]
So, the number of valid numbers for each set is:
[ N_{\text{valid per set}} = N - N_{\text{at least one missing}} = 729 - 189 = 540 ]
Therefore, the total for Case 1 is:
[ \text{Total}_{\text{Case 1}} = 84 \times 540 = 45,360 ]
Case 2: Zero is among the digits
We select zero and 2 different digits from 1-9:
[ C(9, 2) = 36 ]
For each set (zero, ( D_1 ), ( D_2 )), the number of 6-digit numbers where zero is not the leading digit is calculated similarly, but we must ensure the first digit is not zero. The first digit can be either ( D_1 ) or ( D_2 ), so:
[ N = 2 \times 3^5 = 486 ]
Again, we exclude numbers where one or more digits are missing.
Number of numbers missing one digit:
- Missing ( D_1 ): ( N_{\text{missing } D_1} = 1 \times 2^5 = 32 )
- Missing ( D_2 ): ( N_{\text{missing } D_2} = 1 \times 2^5 = 32 )
- Missing 0: ( N_{\text{missing } 0} = 2 \times 2^5 = 64 )
Number of numbers missing two digits (using only one digit):
[ N_{\text{missing two digits}} = 2 \text{ (since leading digit can't be zero)} ]
Using Inclusion-Exclusion:
[ N_{\text{at least one missing}} = (32+32+64) - 2 = 126 ]
So, the number of valid numbers for each set is:
[ N_{\text{valid per set}} = 486 - 126 = 360 ]
Therefore, the total for Case 2 is:
[ \text{Total}_{\text{Case 2}} = 36 \times 360 = 12,960 ]
Adding both cases together:
[ \text{Total} = \text{Total}{\text{Case 1}} + \text{Total}{\text{Case 2}} = 45,360 + 12,960 = 58,320 ]
Answer: 58320