I am working on the following problem...
An early BASIC compiler recognized variable names according to the following rules: Numeric variable names had to begin with a letter and this letter could then be followed by another letter or a digit or by nothing at all. String variable names had to begin with the symbol $ followed by a letter, which could then be followed by another letter or a digit or by nothing at all. How many distinct variable names were recognized by this BASIC compiler?
So.. total number of distinct names = number of numerical variables names + number of string variable named.
Numeric variable names must begin with a letter and can be followed by another letter, a digit, or nothing. So I get 26*26 if it's a letter 26*10 if it's a number and 26 if it's nothing which totals 962 possibilities.
String variable names must begin with a $ symbol then a letter then another letter, digit, or nothing. So I get 1*26*26 for if the 3rd is a letter, 1*26*10 if it's a number, and 1*26 if it's nothing. That would also total 962 possibilities.
The Total would then be 962+962=1924
Now my question is does that make sense, or do the cases where the end is nothing not need the 0 because that is effecting the answer?