Read this lesson as text
Permutations
Math for CS · Axiom Academy
Ordered arrangements -- when the sequence matters A permutation is an ordered arrangement of objects. The key word is ordered -- the arrangement ABC is different from BAC. When k = n (arranging ALL items), P(n,n) = n! . 52! 8.07 10^ 67 (shuffling a deck of cards) When some items are identical, we overcount. Swapping two identical items doesn't create a new arrangement. When objects are arranged in a circle, rotations of the same arrangement are considered identical. Linear: 6! = 720 . Circular: 5! = 120 . We divide by 6 because each circular arrangement corresponds to 6 linear arrangements (one for each starting position). Yes, order matters -- use permutations. Ranking contestants, assigning roles, arranging books on a shelf. No, order doesn't matter -- use combinations. Choosing a committee, selecting lottery numbers, picking a hand of cards. Permutations (order matters): ABC, ACB, BAC, BCA, CAB, CBA are all different. P(5,3) = 60 . Combinations (order doesn't matter): A,B,C is one group. 3 = 10 . Relationship: P(5,3) = 3 3! . Each combination generates 3! = 6 permutations.
This is the written version of the interactive lesson above. See the full Math for CS course.