# Permutation Formula

**Formula:** `P(n,r) = n! / (n - r)!`

In permutation calculations, the order of the objects is important. The number of ways to arrange ** r** objects from a set of

**distinct objects (without repetition) is given by the permutation formula, which is the ratio of the factorial of**

*n***to the factorial of the difference between**

*n***and**

*n***. Factorial, represented by the exclamation mark (!), means the product of an integer and all the integers below it down to 1. For example, 5! equals 5 × 4 × 3 × 2 × 1 equals 120. The permutation formula can be written in function form in JavaScript, where a loop calculates the product of descending numbers from**

*r***to**

*n***. This formula is useful in various fields including statistics, probability theory, and combinatorial problems such as scheduling, cryptography, and decision-making processes.**

*n - r*Tags: Statistics, Probability, Permutations