How to find number of ways of permuting a string satisfying the below conditions? I am given a string,let say- "abcd".
Now I have to find all the strings that can be generated by permuting its character such that-

  
*
  
*There are exactly four mismatches in the generated strings and,
  
*The mismatches exists in pair, for e.g-
  

The string - "abcd" has three such permutations-
"badc","cdab","dcba".
Explanation-
Let us consider "abcd" and "badc". Now there are exactly four mismatch with , i.e- (a,b),(b,a),(c,d),(d,c) and these mismatches exists in pair.
Note that "abcde" has fifteen such permutations-
acbed,adebc,aedcb,baced,badce,baedc,cbaed,cdabe,ceadb,dbeac,dcbae,decab,ebdca,ecbda,edcba
Where I am failing?-
I am just finding the strings manually, but this becomes really time-consuming for strings of large length. Hence,I need a efficient solution

Hint:  Let the string have length $n$.  You choose two places for the first pair to swap, $n \choose 2$ ways. Then you choose two places for the second pair in (how many?) ways. But you could have chosen the pairs in the other order....
