Another how many combinations question - slightly more complicated

In summary, the number of combinations of characters for a string that is between 1 and 8 characters long and uses a-z (non caps) and 0-9 is 2,901,713,047,668. This can be calculated by adding the values of 36+36^2+36^3+...+36^8 or using the formula 1+r+r^2+...+r^n=\frac{1-r^{n+1}}{1-r} where r is equal to 36.
  • #1
krytie75
4
0
Hi. I need a little help.

I'm trying to work out how many combinations of characters there are for a string that is between 1 and 8 characters long and uses a-z (non caps) and 0-9. There are 36 useable characters and the string could be anything from simply 'a' to '99999999'. I was able to work out how many combinations there would be if there were known to be 8 characters in the string, but I'm not sure how to include all the combinations before that (1 - 7 characters long). Is there a formula for this?

Thanks in advance!
 
Mathematics news on Phys.org
  • #2
krytie75 said:
Hi. I need a little help.

I'm trying to work out how many combinations of characters there are for a string that is between 1 and 8 characters long and uses a-z (non caps) and 0-9. There are 36 useable characters and the string could be anything from simply 'a' to '99999999'. I was able to work out how many combinations there would be if there were known to be 8 characters in the string, but I'm not sure how to include all the combinations before that (1 - 7 characters long). Is there a formula for this?

Thanks in advance!

It's actually simpler than you think.

How many combinations are there if it's just 1 character length? 36
Two characters in length? Well the first can be any of the 36, and the second can be any of 36 as well, so it's 362
Three characters? Again applying the same idea, we get 363
...

And so we can get the total number of combinations by adding each and every value, so we have
[tex]36+36^2+36^3+...+36^8[/tex]

And just as a reminder, we can evaluate this more simply by using the formula [tex]1+r+r^2+...+r^n=\frac{1-r^{n+1}}{1-r}[/tex]
 
  • #3
Hi Mentallic!

Thanks for your help, it all makes perfect sense!

One thing I'm not quite sure on though...

When I use the formula you provided at the bottom of your response, I get the answer:

2901713047669

However when I manually calculate 36+36^2+...+36^8 I get the answer:

2901713047668

Which has a difference of 1. I'm guessing this has something to do with the "1+r+r^2" bit of your formula but I'm not sure why?

Thanks again!
 
  • #4
If you use the formula, you should get 2901713047668 as the answer should be. Honestly, I can't quite think where it went wrong for you so you'll have to show me what your procedure was.

edit: If I was to take a guess, you added 1 in front of the long expression to get [itex]1+36+36^2+...+36^8[/itex] to get it in the form [itex]1+r+r^2+...+r^n[/itex] in which you then used the formula and plugged in your values as [tex]\frac{1-36^9}{1-36}[/tex] and got the higher wrong answer because you forgot to take that 1 you added back out of the value.

Also, an easier way to get it into the form of that formula would be to factorize out 36 so you're then solving [tex]36(1+36+36^2+...+36^7)=36\cdot \frac{1-36^8}{1-36}[/tex] :wink:
 
Last edited:
  • #5
= (1-36^8+1)/(1-36)

= (1-36^9)/(1-36)

= -101559956668415/-35

= 2901713047669

Sorry, I'm new here and don't know how to use the proper maths characters yet.
 
  • #6
krytie75 said:
= (1-36^8+1)/(1-36)

= (1-36^9)/(1-36)

= -101559956668415/-35

= 2901713047669

Sorry, I'm new here and don't know how to use the proper maths characters yet.

Yep, there you go, that's why.

Well you're doing a lot better than many other new guys that come to this forum - you know how to use parenthesis properly!
 
  • #7
Ahhh! I forgot my basic maths and didn't balance the equation.

Thanks Mentallic, that's really appreciated.
 
  • #8
If the String Can be "" That is a string of length 0 with nothing in it then there are 2,901,713,047,669 possibilities. However you did say that it had to be of at least length one which means that "" is not a valid string combination you want to count.
Thus 2,901,713,047,668 would be your correct answer.

Just thought I would add some context to the 1 difference you were seeing between the formulas.
 

FAQ: Another how many combinations question - slightly more complicated

What is a "combinations question"?

A combinations question is a type of math problem that involves determining the number of ways that a set of items can be arranged or selected without repetition.

What makes this "another how many combinations question" more complicated?

This question may be more complicated because it involves a larger set of items or more complex criteria for selecting or arranging them.

How do I solve a combinations question?

To solve a combinations question, you typically use a formula such as nCr = n!/(r!(n-r)!), where n represents the total number of items and r represents the number of items being selected or arranged. You may also need to consider any limitations or restrictions on the items.

Can you give an example of a "slightly more complicated" combinations question?

One example could be: "How many different committees of 5 people can be formed from a group of 10 men and 8 women, if each committee must have at least 2 women and no more than 3 men?"

Why are combinations questions important in science?

Combinations questions are important in science because they allow us to calculate the number of possible outcomes in experiments or scenarios where there are multiple variables or factors involved. This can help us make predictions, analyze results, and understand the likelihood of certain outcomes.

Back
Top