1
$\begingroup$

Can someone give me a formula to calculate $ _nP_0 + _nP_1 +_ nP_2 + _nP_3 + .. + _nP_x$ ?

I need a simple formula to calculate this.

MY actual question is

In a certain programming language identifiers must meet the following requirements: - the first character must be an ASCII letter (A-Z, a-z) - other (than the first) characters must be an ASCII letter, digit (0-9) or an underscore - the maximum length of an identifier is 8 characters The total number of possible identifiers is:

[A] $53*(63^7)$
[B] $52*(63^8 - 1)/62$
[C] $52*(63^7 - 1)/63$
[D] $53*(63^8)$
[E] $(63^8)/(52^8)$

Choose the right answer.

For 1 letter variable ->
Here, First position can be filled with 52 chars.

For 2 letter variable ->
Then, First posision can be filled with 52 chars. And second char can be filled up $_{63}P_1$

For 3 letter variable ->
Then, First posision can be filled with 52 chars. And second char can be filled up $_{63}P_1$. And third char can be filled up with $_{63}P_2$

This goes on like this upto 8 letter variable.
So, the series should be $52 + 52(_{63}P_1) + 52(_{63}P_2) + \dots $
That implies $52(1 + _{63}P_1 + _{63}P_2 + _{63}P_3 +\dots + _{63}P_7)$

After this, I couldn't proceed.

  • 0
    @AlexanderThumm: But the variable length can differ. It's not necessary that the variable length will always be 8.2012-06-04

1 Answers 1

2

There are $52 \cdot 63^{n}$ possible identifiers of length exactly $n+1$, and therefore $\sum_{k=0}^{n} 52 \cdot 63^{k} = 52 \cdot \sum_{k=0}^{n} 63^{k} = 52 \cdot \frac{63^{n+1} - 1}{63 - 1} = 52 \cdot \frac{63^{n+1} - 1}{62}$ possible identifiers of length $\leq n+1.$ The second equality comes from the closed form of the geometric series . Specializing to $n+1 = 8,$ we can see, that [B] is the correct answer.