Another how many combinations question - slightly more complicated

  • Context: Undergrad 
  • Thread starter Thread starter krytie75
  • Start date Start date
  • Tags Tags
    Combinations
Click For Summary

Discussion Overview

The discussion revolves around calculating the number of combinations for strings composed of lowercase letters (a-z) and digits (0-9), with lengths ranging from 1 to 8 characters. Participants explore the mathematical formulation for determining the total combinations, addressing both the formulaic approach and manual calculations.

Discussion Character

  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant seeks help in calculating the total combinations for strings of lengths 1 to 8 using 36 characters.
  • Another participant proposes a summation approach, suggesting the total can be expressed as 36 + 36² + 36³ + ... + 36⁸.
  • A formula for the sum of a geometric series is introduced, leading to a calculation of 2901713047669, which one participant claims to have derived using the formula.
  • Another participant calculates the sum manually and arrives at 2901713047668, noting a discrepancy of 1 with the formula result.
  • Discussion includes speculation about potential errors in applying the formula, particularly regarding the inclusion of an initial '1' in the summation.
  • A later reply suggests that the discrepancy arises from misunderstanding the formula's structure and the need to adjust for the initial term.
  • One participant mentions the possibility of including an empty string, which would alter the total combinations to 2901713047669, but acknowledges that the original question specifies strings of at least length one.

Areas of Agreement / Disagreement

Participants express differing views on the application of the formula and the resulting calculations, with no consensus reached on the correct interpretation of the formula or the final count of combinations.

Contextual Notes

Participants highlight potential misunderstandings in the application of the geometric series formula, particularly regarding the initial term and how it affects the total count. The discussion remains focused on the mathematical reasoning without resolving the discrepancies in calculations.

krytie75
Messages
4
Reaction score
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!
 
Physics news on Phys.org
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]
 
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!
 
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:
= (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.
 
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!
 
Ahhh! I forgot my basic maths and didn't balance the equation.

Thanks Mentallic, that's really appreciated.
 
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.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
12K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
55
Views
7K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 18 ·
Replies
18
Views
43K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K