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

  • Context: MHB 
  • Thread starter Thread starter Puzzles
  • Start date Start date
  • Tags Tags
    Combinatorics
Click For Summary
SUMMARY

The discussion focuses on calculating the number of n-digit numbers that contain at least one occurrence of the digits 3 and 5. The correct approach utilizes the inclusion-exclusion principle, leading to the formula: 9·10^(n-1) - 16·9^(n-1) + 7·8^(n-1). This formula accounts for the total n-digit numbers, subtracts those without 3s and 5s, and adjusts for double subtraction of numbers containing neither digit. The participants confirm the validity of this approach, emphasizing the importance of considering leading zeros in n-digit numbers.

PREREQUISITES
  • Understanding of combinatorial counting principles
  • Familiarity with the inclusion-exclusion principle
  • Basic knowledge of number theory and digit representation
  • Ability to manipulate exponential expressions
NEXT STEPS
  • Study the inclusion-exclusion principle in combinatorics
  • Learn about generating functions for counting problems
  • Explore advanced combinatorial techniques for digit restrictions
  • Investigate applications of combinatorial counting in algorithm design
USEFUL FOR

Mathematicians, computer scientists, and students studying combinatorics or algorithm design who are interested in solving digit-based counting problems.

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.
 

Similar threads

  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 3 ·
Replies
3
Views
940
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 29 ·
Replies
29
Views
4K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K