Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

If you consider a 26 letter alphabet, and a cipher where 24 of the letters are sent to themselves, and only 2 letters switch, how many different substitution alphabet ciphers are there, and what percentage are they of total possible?

I thought it would be there are $26\cdot25=650$ such possible ciphers, for a percentage of $$\frac{26\cdot25}{26!}\cdot100\approx1.61\cdot10^{-22}\%$$

But it seems there are only $325$ possible ciphers, when switching only two letters, and i dont understand why?

share|improve this question
1  
Hint: Try that calculation with a 2 letter alphabet where 0 of the letters are sent to themselves. $\hspace{.79 in}$ –  Ricky Demer Jun 2 at 23:38
    
If $\Sigma=\{a,b\}$ then wouldnt you have only one possible cipher combination? I feel like something should have clicked from that, but it didnt nor as i try to think of smaller cases now... –  guydudebro Jun 3 at 1:13

1 Answer 1

up vote 3 down vote accepted

Iterate through the alphabet (using a smaller alphabet is always a good way to start). So you take letter A and you can combine it with letter B..Z. Now if you take B, then you can combine it with letter A and C..Z. But the combination (A,B) is equivalent to (B,A). So you only have C..Z to consider. Thus you would get (n - 1) + (n - 2) + ... pairs, leaving you with 26 * (25 / 2) = 325 combinations.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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