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

  • Thread starter Thread starter Puzzles
  • Start date Start date
  • Tags Tags
    Combinatorics
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.
 
Hi all, I've been a roulette player for more than 10 years (although I took time off here and there) and it's only now that I'm trying to understand the physics of the game. Basically my strategy in roulette is to divide the wheel roughly into two halves (let's call them A and B). My theory is that in roulette there will invariably be variance. In other words, if A comes up 5 times in a row, B will be due to come up soon. However I have been proven wrong many times, and I have seen some...
Thread 'Detail of Diagonalization Lemma'
The following is more or less taken from page 6 of C. Smorynski's "Self-Reference and Modal Logic". (Springer, 1985) (I couldn't get raised brackets to indicate codification (Gödel numbering), so I use a box. The overline is assigning a name. The detail I would like clarification on is in the second step in the last line, where we have an m-overlined, and we substitute the expression for m. Are we saying that the name of a coded term is the same as the coded term? Thanks in advance.
Back
Top