Asked by derrek
A common computer programming rule is that names of variables must be between one and eight characters long. The first character can be any of the 26 letters, while successive characters can be any of the 26 letters or any of the 10 digits. For example, allowable variable names include A, BB, and M3477K. How many different variable names are possible? (Ignore the difference between uppercase and lowercase letters.)
Answers
Answered by
Reiny
one letter variable ---- 26
two character variable ----- 26x36
three character variable --- 26 x 36 x 36
four character variable ---- 26 x 36 x 36 x 36 = 26(36)^3
...
eight character variable ---- 26(36)^7
Possible characters = sum of the above
= 26(1 + 36 + 36^2 + ... + 36^7)
= 26[ 1(36^8 - 1)/35 ] = appr 2.1 x 10^12 (about 2 trillion)
two character variable ----- 26x36
three character variable --- 26 x 36 x 36
four character variable ---- 26 x 36 x 36 x 36 = 26(36)^3
...
eight character variable ---- 26(36)^7
Possible characters = sum of the above
= 26(1 + 36 + 36^2 + ... + 36^7)
= 26[ 1(36^8 - 1)/35 ] = appr 2.1 x 10^12 (about 2 trillion)
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.