Compute how many n-digit numbers

  • Thread starter knowLittle
  • Start date
  • Tags
    Numbers
In summary, Homework Statement Compute how many n-digit numbers can be made from the digits of at least one of {0,1,2,3,4,5,6,7,8,9 }Assume, repetition or order do not matter.The Attempt at a Solution10 choices for the 1st sub-index, 10 choices for the second sub-index, ..., 10 choices for the nth- sub-index.## 10^{n} ## total possible combinations.I think that now we need to add 'n' for a set full of one identical digit. i.e.: {2,2,...,n-th}Now
  • #1
knowLittle
312
3

Homework Statement


Compute how many n-digit numbers can be made from the digits of at least one of {0,1,2,3,4,5,6,7,8,9 }
Assume, repetition or order do not matter.

Homework Equations


## a_{1}, a_{2}, ..., a_{n} ##

The Attempt at a Solution


10 choices for the 1st sub-index, 10 choices for the second sub-index, ..., 10 choices for the nth- sub-index.
## 10^{n} ## total possible combinations.
I think that now we need to add 'n' for a set full of one identical digit. i.e.: {2,2,...,n-th}
Now, n*9 for all possibilities

Now, I need to take some n_i number into account in pairs and each of the n-2 numbers repeated for each number.
So, groups of two repeated for each i-th number?
Also, then I would extend this to include triple identical numbers and the rest (n-3) numbers in the set?
And, so on...?

I am sorry, if this does not make any sense or it is too messy.
Could someone give me any guidance?
Thank you.
 
Physics news on Phys.org
  • #2
knowLittle said:

Homework Statement


Compute how many n-digit numbers can be made from the digits of at least one of {0,1,2,3,4,5,6,7,8,9 }
Assume, repetition or order do not matter.

How can order not matter for numbers?

Homework Equations


## a_{1}, a_{2}, ..., a_{n} ##

The Attempt at a Solution


10 choices for the 1st sub-index,

Is it OK to have a string of 0's for leading digits?

10 choices for the second sub-index, ..., 10 choices for the nth- sub-index.
## 10^{n} ## total possible combinations.
I think that now we need to add 'n' for a set full of one identical digit. i.e.: {2,2,...,n-th}
Now, n*9 for all possibilities

Now, I need to take some n_i number into account in pairs and each of the n-2 numbers repeated for each number.
So, groups of two repeated for each i-th number?
Also, then I would extend this to include triple identical numbers and the rest (n-3) numbers in the set?
And, so on...?

I don't follow what you are doing in this last section. Is there something about the problem you haven't told us?
 
  • #3
The question is for a Theoretical Computer Science class.
LCKurtz said:
How can order not matter for numbers?
You might be right, but he said that it does not matter. My professor was very vague in posing the question. I asked it twice.
He gave some examples:
## {0, 0, 0,0, ...,0_{n} }={0} ##
## {0, 0, 0, ..., 0, 1_{n}}={0,1}##

LCKurtz said:
Is it OK to have a string of 0's for leading digits?
Yes, it is.
This counts as a valid number.
## { a_{0}, a_{1}, ..., a_{n} } \equiv {0_{0},0_{1},...,0_{n} } ##

LCKurtz said:
I don't follow what you are doing in this last section. Is there something about the problem you haven't told us?
Sadly, I have told you everything that was given to me.

In the last section, I wanted to start counting numbers as if repetition mattered, but I recalled that the professor said that they do not.

I will for sure ask for more clarity next time, I see him.
 
  • #4
OK. Since leading zeroes are OK it seems to me that your original calculation of ##10^n## should do it.
 
  • Like
Likes 1 person
  • #5
Let me get back to you in a few days, I believe I can obtain more specific information about the problem. Thank you for your help so far.
 
  • #6
It turns out that order does matter after all. One 'gotta' love language.
An example helped to elucidate.

Example:
{0,1,2,3,...,8,9, ...<whatever>,...} is a vector of size n and 1 solution that satisfies the constraints.
{3,4,7,...,9,2,1,...<whatever>,... } is another vector of size n and another solution.

Let me work it out. If you have any leads, they are welcome.
Thanks :>
 
  • #7
Please, check the solution in attachment.
Apparently, it is incorrect. Can someone verify?
I think that I am not taking into account cases such as {m, o ,m } or {1,0,1}, where there could be repetitions.

The solution should be in the form:
Order matters
{ ... , <at least digits from 0 to 9>,..., <any numbers>, ... }

Thank you.
 

Attachments

  • theorCompScie.gif
    theorCompScie.gif
    8.6 KB · Views: 516
  • #8
So, here is the solution.

## \dfrac{ |n| !}{ |n_{1}|! |n_{2}|!... |n_{k}|!} \text{, where n is the size of the vector and the values in denominator are types of symbols in n that repeat.}## ##\text{For instance, if I have a vector called v={e, i, g, e, n, v, a, l, u, e}, there are say n1 type symbols.}## ##\text{n1 relates to, say, e and our |n1|=3. The numerator in the equation takes care of all combination including repetitions}## ##\text{and the denominator takes care of cases as the one just mentioned. } ##
 

FAQ: Compute how many n-digit numbers

What is meant by "n-digit numbers"?

"N-digit numbers" refers to numbers that have a specific number of digits, where "n" represents any positive integer. For example, a 3-digit number would be any number between 100 and 999.

What is the formula for computing how many n-digit numbers there are?

The formula for computing how many n-digit numbers there are is 10^n, where n represents the number of digits. For example, for 3-digit numbers, the formula would be 10^3 = 1000 possible numbers.

Why is the formula for computing n-digit numbers 10^n?

This formula is based on the fact that there are 10 possible digits (0-9) for each place value in a number. So for each additional digit, there are 10 times as many possible numbers. This can be visualized with a tree diagram, where each branch represents a different digit that can be added to the number.

What is the difference between n-digit numbers and numbers with n digits?

The difference between n-digit numbers and numbers with n digits is that n-digit numbers refers to a specific type of number (e.g. 3-digit numbers), while numbers with n digits refers to any number that happens to have n digits (e.g. 123, 4567, 89012).

Can you give an example of computing how many n-digit numbers there are?

Sure, let's say we want to compute how many 4-digit numbers there are. Using the formula 10^n, we get 10^4 = 10,000 possible numbers. So there are 10,000 different 4-digit numbers that can be formed using the digits 0-9.

Similar threads

Back
Top