. A new programming language requires variable names to start with a letter (upper or lowercase), which can be followed by letters, numbers, or underscores. For example, a1_B_3 is a valid name. If every variable name has to be at least 3 characters but fewer than 7, how many variable names are possible?

Respuesta :

Answer:

Explanation:

Total letters available on the keyboard = 26

Doubling this amount to account for both upper and lower case letters.

Therefore, Total characters (Upper + Lower Case) = 52 characters

Total numbers on keyboard (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) = 10 characters

Underscore = 1 character

Thus, Total allowed characters = 52 + 10 + 1 = 63

This is a problem of the permutation as order of the characters results in a different name.

Our file name should be of atleast 3 and smaller than 7 (i.e. 6) characters

Therefore, total possible permutations can be obtained by subtraction permutation of 2 characters from the permutations of 6 characters.

[tex]Total\; Permutations\; =\; (^{63}P_{6}) \;-\;(^{63}P_{2}) \\\\Total\; Permutations\; =\;48920775120\;-\;3906\\\\Total\; Permutations\; =\;48920771214[/tex]

Answer:

1824799399

Explanation:

If we suppose that the letters allow are the 26 letters in the English alphabet, we have a total of 52 letters (Nl) counting upper and lowercase, and we have a total of ten number from zero to nine plus the underscore, for a total of 11 non-alphabetic characters (Nn). To calculate the variables namespace (Ps) we need to add the possibilities of combinations there are from 3 to 6 character (Pn), considering that the first character has to be a letter:

Pn = P3+P4+P5+P6

P3 = Nl*(Nl+Nn)^2 = 206388

P4 = Nl*(Nl+Nn)^3 = 13002444

P5 = Nl*(Nl+Nn)^4 = 819153972

P6 = Nl*(Nl+Nn)^5 = 992436595

Pn = 206388 + 13002444 + 819153972 + 992436595 = 1824799399