MHB Solve Combinatorics Problem with 3 & 5 Digits: Help Needed!

  • Thread starter Thread starter Puzzles
  • Start date Start date
  • Tags Tags
    Combinatorics
AI Thread Summary
The discussion revolves around calculating the number of n-digit numbers that include the digits 3 and 5. The initial approach incorrectly assumes leading zeros are allowed, leading to confusion in the calculations. A correct method involves using inclusion-exclusion to account for n-digit numbers that do not contain 3 or 5, adjusting for overlaps. The final formula derived is 9·10^(n-1) - 16·9^(n-1) + 7·8^(n-1), which accurately represents the count of n-digit numbers containing at least one 3 and one 5. This approach clarifies the problem and provides a valid solution.
Puzzles
Messages
21
Reaction score
0
Hi! I've been stuck with this problem:

How many different n digit numbers are there that contain the numbers 3 and 5?

I've approached it like this: There are 10^n different n digit numbers in total - variations made from the digits 0,...,9. There are 8^n of those that don't contain 3 and 5 which we have to eliminate from those. Now we have to eliminate the numbers that start with one zero, so there are 10^(n-1) of those, then there are 10^(n-2) that start with two zeros, etc, up until the 1 n digit number that is made out of n zeros.

I'm stuck. This isn't right, but I can't seem to see what I'm doing wrong. Please help me if you can!
 
Physics news on Phys.org
Puzzles said:
How many different n digit numbers are there that contain the numbers 3 and 5?
Isn't it $2^n$?

When we say "an $n$-digit number", it is usually assumed that leading zeros are not allowed. So there are $9\cdot10^{n-1}$ $n$-digit decimal numbers.
 
Evgeny.Makarov said:
Isn't it $2^n$?

When we say "an $n$-digit number", it is usually assumed that leading zeros are not allowed. So there are $9\cdot10^{n-1}$ $n$-digit decimal numbers.

I think that's the number of n-digit different numbers made up of only 3s and 5s.
 
Puzzles said:
Hi! I've been stuck with this problem:

How many different n digit numbers are there that contain the numbers 3 and 5?

I've approached it like this: There are 10^n different n digit numbers in total - variations made from the digits 0,...,9. There are 8^n of those that don't contain 3 and 5 which we have to eliminate from those. Now we have to eliminate the numbers that start with one zero, so there are 10^(n-1) of those, then there are 10^(n-2) that start with two zeros, etc, up until the 1 n digit number that is made out of n zeros.

I'm stuck. This isn't right, but I can't seem to see what I'm doing wrong. Please help me if you can!
I would use an inclusion-exclusion method for this.

There are $9\cdot10^{n-1}$ $n$-digit numbers. If we look for $n$-digit numbers that do not contain a $3$ then we only have nine digits to use (and only eight choices for the first digit, since that cannot be $0$). So there are $8\cdot 9^{n-1}$ $n$-digit numbers without any $3$s. Subtract those from the total and you see that there are $9\cdot10^{n-1} - 8\cdot 9^{n-1}$ $n$-digit numbers that contain at least one $3$.

Next, we can do the same for numbers that contain no $5$, and there are again $8\cdot 9^{n-1}$ of them. If we subtract them also from the total, then we get $9\cdot10^{n-1} - 16\cdot 9^{n-1}$. But that is not the final answer, because there are some numbers that contain neither a $3$ nor a $5$, and we have subtracted them twice (once because they contain no $3$ and then again because they contain no $5$). So we must add them back in again. There are $7\cdot 8^{n-1}$ such numbers. So the final total of $n$-digit numbers that contain at least one $3$ and at least one $5$ is $$9\cdot10^{n-1} - 16\cdot 9^{n-1} + 7\cdot8^{n-1}.$$
 
Yes, that is absolutely correct! Thank you so much.
 
Back
Top