Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

Thx

share|improve this question
4  
This is not a site for math experts! –  Mariano Suárez-Alvarez Oct 6 '10 at 18:12
4  
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

2 Answers 2

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|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|improve this answer

Your Answer

 
discard

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.