9
$\begingroup$

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

  • 5
    This is not a site for math experts!2010-10-06
  • 5
    In any case, your calculation is correct.2010-10-06
  • 0
    I thought this was going to be about characters of representations :P At any rate, +1.2010-10-06
  • 0
    Excellent! Thx!! Sorry to disappoint BBischof :/2010-10-06
  • 0
    I'm quite interested in why you think 67600 is a lot. Care to explain your intuition?2010-10-07

2 Answers 2

3

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

  • 1
    thx for the details and info2010-10-06
2

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.