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

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

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

$\endgroup$
  • 1
    $\begingroup$ thx for the details and info $\endgroup$ – SteveCl Oct 6 '10 at 20:52
2
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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