1. ## Keycode selection.

A keycode must contain 4 letters and 3 numbers. The letters may be any letter of the alphabet. The numbers should be any number from 0 to 5. How many different keycode combinations are there?

I have the above problem and the more I look at it the more confused i get!
If no repetitions are allowed then I am pretty sure the the answer is
26C4 * 6C3 * 7!

But let's assume repetition is allowed.
I'll choose the letters first there are $26^4$ ways.

If the numbers are all the same then there are 6 ways of choosing them.
So the number of selections might be $26^4*6*7!/3!$

If the first 2 numbers chosen are the same there are 6*1*5=30 ways to choose them
If the last 2 numbers are the same there are 6*5*1=30 ways to choose them
If the 1st and 3rd are the same then there are 6*5*1=30 ways to choose them
SO there are 90 ways that 2 numbers can be chosen the same and the 3rd one different.
So the number of selections might be $26^4*90*7!/2!$

If the numbers are all different then the number of possibilities is 6*5*4=120
So the number of selections might be $26^4*120*7!$

Actually I think I might need to go through the same rigmarole for the letters. Yes I think that i do.

Letters all different = 26*25*24*23=358800
letters 2 the same= 26*1*25*24*6= 93600
letters 3 the same=26*1*1*25*4=2600
Letters all the same=26
Add all these and I get 455026
Now I know it should add up to $26^4=456976$ so I am short a few possibilities here. WHY AM I SHORT???

See i do not have a clue what I am doing!

Can anyone help set me straight - there are a number of different aspects to this question.

Actually 3 of us have been struggling with this question. At one stage all of us had the same answer but I am almost positive it was wrong. You call us the 3 stooges I suppose.

Any ideas will be greatly appreciated.

2. ## Re: Keycode selection.

I learned this a number of months ago and i'm not sure if i remember accurately, but here's my take on tge question.

Firstly as for repetitions, i think it is understood and should be accepted that repetitions are allowed. As is standard in any codes, there is no reason to disallow repetition, unless the restriction js explicitly stated.

Then the answer should be $26^4 \cdot 6^3 \cdot \frac{7!}{4!3!}$

Can you see why?

3. ## Re: Keycode selection.

Originally Posted by muddywaters
I learned this a number of months ago and i'm not sure if i remember accurately, but here's my take on tge question.

Firstly as for repetitions, i think it is understood and should be accepted that repetitions are allowed. As is standard in any codes, there is no reason to disallow repetition, unless the restriction js explicitly stated.

Then the answer should be $26^4 \cdot 6^3 \cdot \frac{7!}{4!3!}$

Can you see why?
Doesn't this fail to take into account indistinguishable codes caused by repeated chars?

I believe this expressions comes from 7C4 ways to pick 4 slots for letters, then $26^4$ ways of picking the letters, and $6^3$ ways of picking the numbers.

But this allows us to pick any code with k repeated symbols k! ways. Worse It allows codes that have pairs or triplets of repeated symbols which cause indistinguishable codes in a more complicated way.

4. ## Re: Keycode selection.

Originally Posted by romsek
Doesn't this fail to take into account indistinguishable codes caused by repeated chars?

I believe this expressions comes from 7C4 ways to pick 4 slots for letters, then $26^4$ ways of picking the letters, and $6^3$ ways of picking the numbers.

But this allows us to pick any code with k repeated symbols k! ways. Worse It allows codes that have pairs or triplets of repeated symbols which cause indistinguishable codes in a more complicated way.
$\frac{7!}{4!3!}$ not to pick four slots for letters, but to count the number ways to arrange AAAANNN (A is alphabet and N is number)

5. ## Re: Keycode selection.

Thank you muddywaters and Romsek,

I'd like to put this bit aside just for a while. What about the other question that I have.

Letters all different = $26*25*24*23=358800$
letters 2 the same= $26*1*25*24*6= 93600$
letters 3 the same=$26*1*1*25*4=2600$
Letters all the same=26
Add all these and I get 455026
Now I know it should add up to $26^4=456976$ so I am short a few possibilities here. WHY AM I SHORT???

I really do not know about the 6 and the 4 - I guess one of them is wrong - I am not sure how i should get these numbers anyway.

6. ## Re: Keycode selection.

You know Muddywaters, that is the same answer the 3 of us came up with. And i have just re-thought it through and I think that you are correct. Thank you. I will discuss this problem more here tomorrow for it is 2:30 am in Sydney right now.

7. ## Re: Keycode selection.

Originally Posted by muddywaters
$\frac{7!}{4!3!}$ not to pick four slots for letters, but to count the number ways to arrange AAAANNN (A is alphabet and N is number)
that is picking 4 slots for letters...

8. ## Re: Keycode selection.

Originally Posted by romsek
that is picking 4 slots for letters...
Oh well yes haha.. But then i don't see how there are repeats when we use this.

9. ## Re: Keycode selection.

Originally Posted by romsek
that is picking 4 slots for letters...
Oh well yes haha.. But then i don't see how there are repeats when we use this.

10. ## Re: Keycode selection.

Originally Posted by muddywaters
Oh well yes haha.. But then i don't see how there are repeats when we use this.
consider the code

aabb112

There are 6 ways this same code can be arrived at and your number counts all 6 of them.

11. ## Re: Keycode selection.

Now I am really confused. I don't know what you are trying to tell me.

I've actually gone full circle.
My initial thought was the same as muddywaters'. I moved away from this solution but now I have come back again.

There are $26^4$ ways to choose 4 letters. Repetition is allowed and order counts.
there are $6^3$ ways to choose the 3 numbers. Repetition is allowed and order counts.

Now there are 7C3 ways of choosing 3 characters from 7. Order does not count, repetition not allowed. But this is good order has already been taken into account and we don't want repetition. So

The number of possible codes is $26^4\times 6^3 \times 7C3$

Is there anything wrong with this logic?
What were you trying to say Romsek? Actually I think your query is why I went off this idea in the first place but now I really do not know.

I also want to sort out my problem with the other trail that I was going down.
I think that I will post it as a new post of its own.

12. ## Re: Keycode selection.

Thank you muddywaters and Romsek. I have really appreciated your input.

Did you both end up agreeing that muddywaters way is correct?
OR you you really not sure.?
It seems right to me but I am far from certain.
The spin off part of the questions has been totally covered. I was very happy with Romsek's answer.
It is here if anyone is interested.
Selections. Why am I short?