Ngôn ngữ Pascal chuẩn quy định đặt tên biến không quá 8 kí tự, các kí tự trong tên biến chỉ là các chữ cái từ a…z hoặc các chữ số từ 0..9 và phải bắt đầu bằng chữ cái. Có bao nhiêu tên biến khác nhau thỏa mãn yêu cầu trên?
Trả lời:
Đáp án đúng: A
The question asks for the number of different variable names that can be created according to standard Pascal rules: no more than 8 characters, only letters a..z and digits 0..9, and must start with a letter.
A variable name can be 1 to 8 characters long. The first character must be a letter (26 choices). Each subsequent character can be a letter or a digit (36 choices).
Therefore, the total number of variable names is:
26 + 26*36 + 26*36^2 + ... + 26*36^7 = 26 * (1 + 36 + 36^2 + ... + 36^7)
This can be expressed as 26 * sum(36^k) for k = 0 to 7.





