Permutation
Permutation
Where:
Factorial (noted as “!”) is the product of all positive integers less than or equal to
the number preceding the factorial sign. For example, 3! = 1 x 2 x 3 = 6.
For example, let n = 4 (A, B, C and D) and k = 2 (All permutations of size 2). The
answer is 4! / (4-2)! = 12. The twelve permutations are AB, AC, AD, BA, BC, BD,
CA, CB, CD, DA, DB and DC.
Combination:
A combination is a mathematical technique that determines the number of
possible arrangements in a collection of items where the order of the selection does
not matter. In combinations, you can select the items in any order.
For example, suppose we have a set of three letters: A, B, and C. we might ask
how many ways we can select 2 letters from that set. Each possible selection would
be an example of a combination. The complete list of possible selections would be:
AB, AC, and BC.
Formula for Combination
Mathematically, the formula for determining the number of possible
arrangements by selecting only a few objects from a set with no repetition is
expressed in the following way:
Where:
n – the total number of elements in a set
k – the number of selected objects (the order of the objects is not important)
! – factorial
For example, let n = 4 (A, B, C and D) and r = 2 (All combinations of size 2).
The answer is 4! /((4-2)!*2!) = 6. The six combinations are AB, AC, AD, BC, BD,
and CD.
NOTE: In the same example, we have different cases for permutation and
combination. For permutation, AB and BA are two different things but for
selection, AB and BA are same.