Write permutation and combination in LaTeX

In this tutorial, we will learn how to write the permutation and combination in LaTeX.

I will show you both of those one by one.

Permutation in LaTeX

We will start with writing the permutation formula in LaTeX.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

The number of permutations of $n$ objects taken $r$ at a time is given by:

\[
_{n}P_{r} = \frac{{n!}}{{(n-r)!}}
\]

\end{document}

Output:

permutation formula in LaTeX

The most popular form of permutation can be written in LaTeX like this:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

Permutation formula:

\[
^nC_r = \frac{{n!}}{{(n-r)!}}
\]

\end{document}

Output:

permutation popular form

You can see the space between n and C is a little bit higher. We can reduce this by using \!just like this:

^n\!C\!_r = \frac{{n!}}{{(n-r)!}}

 

We can represent the permutation in many different ways. Let’s check one by one:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

Permutation Formula:

\[
P(n,r) = \frac{{n!}}{{(n-r)!}}
\]

\end{document}

Output:

permutation in latex

We can also represent permutation like this:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

Permutation Formula:

\[
P^n_r = \frac{{n!}}{{(n-r)!}}
\]

\end{document}

Output:

permutation formula in various style

Here is the last one.

P_n,_r = \frac{{n!}}{{(n-r)!}}

Output:

permutation formula latex 2

Combination in LaTeX

\documentclass{article}
\usepackage{amsmath}

\begin{document}

Combination formula:

\[
^nC_k = \frac{{n!}}{k!{(n-k)!}}
\]

\end{document}

combination formula in LaTeX

Other forms of combination:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

Combination formula:

\[
\binom{n}{k}={^n}C_k = \frac{{n!}}{k!{(n-k)!}}
\]

\end{document}

Output:

write combination form in LaTeX

You can check: How to write binomial coefficient in LaTeX?

Leave a Reply

Your email address will not be published. Required fields are marked *