# Summation to count number of strings over N characters?

How many different strings of five characters are there if only lower-case letters or numbers can be used in creating these strings?

Here is my solution:

There are 26 letters in the alphabet and 10 numbers $\{0,1,2,3,4,5,6,7,8,9\}$, which gives us a total of 36 characters. Thus, I was able to calculate this using the following:

$$(36)^5 = 60466176$$

Now is it possible to compute the number of different strings of five characters using the following two steps?

1. Compute the number of different strings of four characters.

$$(36)^4 = 1679616$$

1. Create a summation that has several terms, each of them involves the number of different strings of four characters and this summation is the answer.

Here is my approach:

Let

$$X=\{0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z\}$$ Let $$N=5, M=4$$

We have $$\sum_{K=1}^{M}X^M\sum_{I=M}^{N}X^I$$

Am I on the right track? Any hints on how to approach this? I am looking to answer this question in the form of a summation.

• Hint: There are $36$ characters that you can place at the trailing place of a $4$ character long string to make it a $5$ character long string.
– Eoin
Apr 28 '15 at 5:36
• I think I understand you. Could you please elaborate a little more? Apr 28 '15 at 5:37

The number of different strings with four characters is, as your previous reasoning, $(36)^4$. Now, given a string with four characters, I can append one character to it to give me a five-character string. All five-character strings can be formed in this way ($4 + 1$), and doing this append operation gives us all five-character strings, so we know we are counting the same thing.
In how many ways can I append a character to a four-character string? $36$ ways. Since I want four characters and one extra character, I will multiply ('and' signifies multiplication, while 'or', addition). So the total number of five-character strings is $(36)^4 \cdot 36 = (36)^5$.