Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My first post here...not really a math expert, but certainly enjoy the challenge.

I working writing a random string generator and would like to know how to calculate how many possible combinations there are for a particular combination.

I am generating a string of 2numbers followed by 2 letters (lowercase) e.g. 12ab

I think the calculation would be (breaking it down) number combinations 10*10=100 letter combinations 26*26=676

So the number of possible combinations is 100*676=67600, but this seems a lot to me so I'm thinking I am off on my calculations!!

Could someone please point me in the right direction?


share|cite|improve this question
This is not a site for math experts! – Mariano Suárez-Alvarez Oct 6 '10 at 18:12
In any case, your calculation is correct. – Mariano Suárez-Alvarez Oct 6 '10 at 18:13
I thought this was going to be about characters of representations :P At any rate, +1. – BBischof Oct 6 '10 at 18:16
Excellent! Thx!! Sorry to disappoint BBischof :/ – SteveCl Oct 6 '10 at 20:50
I'm quite interested in why you think 67600 is a lot. Care to explain your intuition? – yatima2975 Oct 7 '10 at 9:57
up vote 3 down vote accepted

You are right. That is the most basic/fundamental procedure for counting in combinatorics.

It's sometimes called the Rule of product, or multiplication principle or fundamental counting principle, and it can be visualized as a tree

share|cite|improve this answer
thx for the details and info – SteveCl Oct 6 '10 at 20:52

Some nomenclature: when you say "2 number", you really mean "2 digits". Also, you need to specify if the digits can be anything or not (for example, do you allow leading zeroes?).

If each of the two digits can be anything, 0 through 9, and each of the letters can be anything, a through z, then your computation is correct. If you think about it, you can see why the number is not off: any particular pair of letters have 100 numbers that can go before them to make the string. Each particular letter going first has 26 possible "second letters", and each of them has 100 possible pairs of digits to go. So there are already 2600 possible strings of the form xxxa. Another batch for xxxb, etc. They add up very quickly.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.