0
$\begingroup$

I need to find number of combination for word which has following constraint a. The word can have exactly 5 characters b. The word can have digits [0-9], upper case letters [A-Z]and lowercase letters [a-z] c. The word must contain exactly one uppercase letter and exactly one digit characters.

My approach

The word is comprised of 5 characters. For each character can be filled with digit [0-9], uppercase letter [A-Z] or lowercase letter [a-z]. So for the first place we have = 10 +26 +26 = 62 combinations. Similarly we have 62 combinations for each position.

Therefore total number of combinations are=62 * 62 * 62* 62 *62 =916132832

Answer = Total number of combination - combination which does not follow 3rd condition

I am not able to figure out how to calculate number of combinations which does not follow 3rd condition.

$\endgroup$
0
2
$\begingroup$

$26$ ways to choose the capital letter and $5$ choices for its place.
$10$ ways to choose the digit and $4$ places to put it.

Concerning the remaining three places where to fit small letters, you shall distinguish among:
- three equal letters: $26$ choices, $1$ way to arrange
- two equal letters: $26 \times 25$ choices, $3$ different arrangements
- all different letters: $26 \times 25 \times 24$ ways.

total: $\quad26 \cdot 5 \cdot 10 \cdot 4 \cdot 26 \cdot\left( 1+25 \cdot 3+25 \cdot24 \right)=91 395 200$

$\endgroup$
2
  • 1
    $\begingroup$ Looks like a typo on "25" versus "26." Also note that $26^{3} = 26(1+(25)(3)+(25)(24))$. $\endgroup$
    – Michael
    Apr 6 '19 at 1:14
  • $\begingroup$ @trancelocation : thanks for editing typo. $\endgroup$
    – G Cab
    Apr 6 '19 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.