To solve the problem, we'll count the number of seven-digit numbers formed using digits {0, 1, 2} where at least one of the digits 0 or 1 appears exactly twice. Here's the step-by-step solution:
Step 1: Total Possible Numbers
Each of the 7 digits can be 0, 1, or 2.
The first digit cannot be 0 (to ensure it's a seven-digit number).
Total numbers: .
Step 2: Numbers Where 0 Appears Exactly Twice
Choose positions for 0: (since the first digit cannot be 0).
Fill the remaining 5 digits: Each can be 1 or 2 (since we're fixing exactly two 0s).
Count: .
Step 3: Numbers Where 1 Appears Exactly Twice
Choose positions for 1: .
Fill the remaining 5 digits: Each can be 0 or 2 (but the first digit cannot be 0).
If the first digit is 1: .
If the first digit is not 1 (i.e., it's 2): .
Total for 1 appearing exactly twice: .
Step 4: Numbers Where Both 0 and 1 Appear Exactly Twice
Overlap count: Numbers where both 0 and 1 appear exactly twice.
Choose positions for 0: .
Choose positions for 1 from remaining: .
Fill the remaining 3 digits: Must be 2.
Count: .
Step 5: Apply Inclusion-Exclusion Principle
Total desired numbers: Numbers where 0 appears exactly twice + Numbers where 1 appears exactly twice - Numbers where both appear exactly twice.
Calculation: .
Final Answer
The number of such seven-digit numbers is .
Comments
Post a Comment