# Figuring Out Number Of Combinations

I'm attempting to figure out the number of combinations if you have 95 possibilities and 63 slots to fill where the choices CAN repeat and order does matter and cause a new combination.

Ex.
A B C - The choices

Pick 1-3:
A
B
C
AA, AB, AC
BA, BB. BC
CA, CB, CC
AAA, AAB, AAC, ABA, ABB, ABC, ACA, ACB, ACC
BAA, BAB, BAC, BBA, BBB, BBC, BCA, BCB, BCC
CAA, CAB, CAC, CBA, CBB, CBC, CCA, CCB, CCC

The basis of my question derives from my curiosity of how many possible passwords ranging from a length of 1 to a length of 63 using 95 different possible characters. I'm aware that this will be a giant number. I'd just like to know the way to solve for finding said number for research purposes.

The number of possible passwords of length $k$ is $95^k$: You have $k$ choices to make, each of which has $95$ options.

So the total number of passwords of length between $1$ and $63$ is $$\sum_{k = 1}^{63} 95^k$$

This is a geometric series. Factoring out a power of $95$ to rewrite it as $$95 \sum_{k = 0}^{62}95^k$$

and applying the geometric series formula $$\sum_{k = 0}^n r^k = \frac{1-r^{n+1}}{1-r}$$

we get $$95\left(\frac{1-95^{63}}{1-95}\right) = \frac{95^{64}-95}{94}.$$

• I'm a bit new to geometric series. How exactly does one use this formula. For example, I have no idea how you went from 63 over k=1 to 62 over k=0. On the other hand, the 95^64 - 95 over 94, is that what would give the number of password combinations? – Invidus Jan 14 '17 at 17:46
• The first sum is $95^1 + 95^2 + 95^3 + \dots + 95^{63}$. The second sum is $95(95^0 + 95^1 + 95^2 + \dots + 95^{62})$. Do you see why these are the same? – Alex Kruckman Jan 14 '17 at 18:17
• As for "how exactly does one use this formula?": It's just pattern matching. Setting $n = 62$ and $r = 95$ in the formula, we get $\sum_{k = 0}^{62} 95^k = (1-95^{63})/(1-95)$. – Alex Kruckman Jan 14 '17 at 18:19
• And yes, I've demonstrated that $(95^{64}-95)/94$ is the exact number of possible passwords. As you say, this is a "giant number". It's approximately $4 \times 10^{124}$. – Alex Kruckman Jan 14 '17 at 18:26
• @Invidus If I have answered the question to your satisfaction, you can upvote and accept my answer (see the site FAQ if you don't know how to do this). If not, I'm happy to try to clarify further. – Alex Kruckman Jan 15 '17 at 19:30