Given length of N, and given set of length of chars how many combinations I could make if I include duplicates letters in the string? I am looking for a formula.
e.g.
str = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789&%*^)"!`
N = 8
I could make
aaaaaaaa
aaaaaaaA
aaaaaaAA
aaaaaAAA
aaaaAAAA
aaaAAAAA
aaAAAAAA
aAAAAAAA
AAAAAAAA
aaaaaaa!
aaaaaa!!
aaaaa!!!
aaaAA!!!
....
What would be the total?
ACCEPTED]
In your example, you have 59 characters, so you have 59 choices for the first element of the string, 59 choices for the second element of the string, etc. The number of possible strings is $$59\times59\times59\times59\times59\times59\times59\times59=59^8$$ More generaly, if you have $k$ letters and want to make string of length $N$, with repetitions, then you have $k^N$ possibilities.