[Tex/LaTex] command to write the form of a combination or permutation?


I'm trying to write

\binom nk=^nC_k=\frac{n!}{k!(n-k)!}

but when compiled the n is a little far away from the P and C for my liking. Is there a command to write this? I know there is a \binom so I was hopeful. If not, is there a way to force the n to be closer?

$ ^nP_k=\frac{n!}{(n-k}!} - permutation \\  
\binom nk=^nC_k=\frac{n!}{k!(n-k)!} - combination $  

Best Answer

You could use the \prescript command from the mathtools package and define two commands; something along the following lines:




\Myperm{k} = \frac{n!}{(n-k)!}\quad
\Mycomb{k} = \frac{n!}{k!(n-k)!}\quad
\Myperm[m]{k} = \frac{m!}{(m-k)!}\quad
\Mycomb[m]{k} = \frac{m!}{k!(m-k)!}\quad


enter image description here

Related Question