# Mathematical Preliminaries: Arrangement and Selection Problems

## Basics of Arrangement

• Arrangement problems primarily deal with combinations and permutations of sets or sequences. They may also be referred to as combinatorial problems.

• A permutation of a set is any arrangement of its elements. The order of the elements in a permutation is important.

• The number of permutations of a set of `n` elements is `n!` (n factorial), which is the product of all positive integers less than or equal to `n`.

• A combination of a set is an selection of its elements. Unlike permutations, the order does not matter in a combination.

• The number of combinations of `r` items from a set of `n` elements is given by `nCr = n! / [(n - r)! * r!]`

## Factorial

• The factorial of a non-negative integer `n` (denoted as `n!`), is the product of all positive integers less than or equal to `n`.

• It acts as an essential tool while dealing with permutations and combinations.

• Factorial of zero is defined as one i.e., `0! = 1`

## Permutations and Combinations

• A permutation is an arrangement from a set where the order is important.

• The number of permutations of `n` things taken `r` at a time is denoted as `nPr = n! / (n - r)!`

• A combination is a selection from a set where the order is unimportant.

• The number of combinations of `n` things taken `r` at a time is denoted as `nCr = n! / [(n - r)! * r!]`

## Distinguishable and Indistinguishable Objects

• Arrangements of distinguishable objects are governed by the rules of permutations and combinations, focusing on the placing or selecting of unique, distinguishable items.

• Arrangements of indistinguishable objects, such as anagrams, use multiset coefficients to account for indistinguishability.

• When arranging `n` indistinguishable objects into `r` distinct boxes, use a stars and bars argument to consider possible divisions.

## Special Cases

• Circular permutations refer to arrangements around a circle, where there is no ‘start’ and ‘end’ to the set. There are `(n-1)!` ways to arrange `n` objects in a circle.

• Permutations with repetition are used when some items within the set are the same (indistinguishable). Divide the total permutation count `(n!)` by the factorial of the count of each repeated element.

• The Binomial theorem describes the algebraic expansion of powers of a binomial and can also be seen as a combination problem where it can be applied.