As Jenstar says, with numerals it's the counting numbers.
Ordinary numerals are of course in base 10. The number of possibilities for a 7 digit number (including leading zeros) is 10 to the power of 7.
With letters, just think of them as numbers in base 26, and do the same thing. Count the number of letters in your "number". Raise 26 to this power.
So the number of possible combinations for a three "digit" "number" would run from AAA to ZZZ. It would be 26 to the power of three, or 17,576 (there are no leading zeros to miss out of course).
For other bases, you'd do the same. For example, I had a car with a radio code which worked off the pre-set channel buttons. There were five of these, so that was four digits in base five, or only 625 possible numbers. It didn't take me long to find by trial and error.
Likewise, if you were using letters, but were not allowed some (as in number plates), you'd use the number of allowable ones as your base.
The example above assumes you count to ZZZ starting from AAA. However, if you were counting like spreadsheet columns it would go: "A, B ... Z, AA, AB .. ZZ, AAA, AAB ... ZZZ". This is more complicated, as you are using imaginary leading zeros (00A, 00B etc) but not then using zero as a digit. I think this would be 26 +(26**2)+(26**3).