Permutations & Combinations
Counting with repetition
Grade 11

Question:

<p>In a particular programming language, a valid variable name can consist of a sequence of one to six alphanumeric characters A, B, C, ..., Z, 0, 1, 2, ..., 9 beginning with a letter. Find the total number of valid variable names.</p>

Step-by-Step Solution

Key Concept: Variable names must start with a letter (26 choices) and remaining 0-5 positions can be any alphanumeric character (36 choices each). Use the formula for geometric series to sum all lengths from 1 to 6.
<p><strong>Step 1:</strong> Identify constraints. A valid variable name has 1-6 characters, starts with a letter (A-Z: 26 choices), and remaining characters are alphanumeric (A-Z, 0-9: 36 choices each).</p><p><strong>Step 2:</strong> Count by length:</p><ul><li>Length 1: 26 names (just the starting letter)</li><li>Length 2: 26 × 36 names (first position: letter, second: any alphanumeric)</li><li>Length 3: 26 × 36² names</li><li>Length 4: 26 × 36³ names</li><li>Length 5: 26 × 36⁴ names</li><li>Length 6: 26 × 36⁵ names</li></ul><p><strong>Step 3:</strong> Sum all cases: Total = 26 + 26(36) + 26(36²) + 26(36³) + 26(36⁴) + 26(36⁵)</p><p><strong>Step 4:</strong> Factor out 26: Total = 26(1 + 36 + 36² + 36³ + 36⁴ + 36⁵)</p><p><strong>Step 5:</strong> Apply geometric series formula where a = 1, r = 36, n = 6 terms:</p><p>Sum = 1 + 36 + 36² + ... + 36⁵ = \(\frac{36^6 - 1}{36 - 1} = \frac{36^6 - 1}{35}\)</p><p><strong>Step 6:</strong> Substitute back: Total = 26 · \(\frac{36^6 - 1}{35}\) = \(\frac{26}{35}(36^6 - 1)\)</p><p>∴ Answer: \(\frac{26}{35}(36^6 - 1)\)</p>
Correct Answer: \(\frac{26}{35}(36^6 - 1)\)

Master Permutations & Combinations with Mathbee

Practice this topic under real exam conditions with strict timers, or ask our AI Mentor to explain the concepts step-by-step.

Start Practicing for Free