# Counting Problem : A code consists of at-most two...

Tags:
1. Jun 16, 2015

### 22990atinesh

1. The problem statement, all variables and given/known data
A code consists of at-most two identical letters followed by at-most four identical digits. The code must have atleast one letter and one digit. How many distinct codes can be generated using letters A-Z and digits 1-9.

2. Relevant equations

3. The attempt at a solution

//One letter followed by one or more digits
$26 \times 10 + 26 \times 10 \times 10 + 26 \times 10 \times 10 \times 10 + 26 \times 10 \times 10 \times 10 \times 10 +$

//two letters followed by one or more digits
$26 \times 26 \times 10 + 26 \times 26 \times 10 \times 10 + 26 \times 26 \times 10 \times 10 \times 10 + 26 \times 26 \times 10 \times 10 \times 10 \times 10$

But the ans is too big it doesn't matches with the result. What can be correct answer

2. Jun 16, 2015

### RUber

Your question says identical letters and digits.
So the variables in question are:
Choice of letter (26)
Number of identical letters (2)
Choice of digit (9)
Number of identical digits (4).

Doing it this way, I get an answer that is less that 2000. What are you comparing against?

3. Jun 17, 2015

### rcgldr

Two letter cases are still just 26 x 10 ... not 26 x 26 x 10 ... , since the two letters are identical.

4. Jun 17, 2015

### RUber

There are only 9 digits to choose from.