Sum and Product rule
In combinatorics the Sum and Product rule can be understood in terms of the number of nested iterations needed to count the possible outcomes. Choosing elements
- between a set or another—zero iterations—is the Sum rule
- from a set and from another, or repeatedly on the same, entails multiple iterations and is the Product rule
Sum rule
The Sum rule entails choosing one outcome between either of two (or more) sets—call them and —among all the possible ones, that, with no overlap, is given by the sum of each set’s number of elements , and it’s equivalent to the union operation . When sets overlap the simple sum overcounts, see inclusion-exclusion-principle for the correction.
Product rule
The iterative process of finding more than one outcome is represented by the the Product rule, the possible outcomes of drawing one element in successive iterations from a set with repetition is given by or where each iteration represents a different set, so that the Product rule, generalizing, is equivalent to the Cartesian product of all the involved sets .
Special cases of the Product rule: Permutations and Combinations
Permutation
The Product rule allows to compute all the possible arrangements with repetition, and it’s therefore the largest number of possible elements’ arrangements attainable. Permutation is a special case of the Product rule on the same set, where at each iteration the chosen element is discarded, until the set is exhausted, that is to say the elements are drawn without repetition*. This operation has its own name, factorization
and it symbolizes the operation of choosing the possible arrangements of all set’s elements. Notice that in the compact product notation the sequence here is forward (from to ), whereas factorization is depicted backwards (from to ).
-Permutation
If the set isn’t completely exhausted, I’m choosing the possible arrangements of some—call them —set’s elements and I’m doing a partial permutation. Like this
For example, choosing numbers between and : first iteration has numbers available, second has , third has , that is to say . But why?
If I were to exhaust all the elements, I’d do
but since I don’t want anything but elements, I need to subtract those iterations from the formula, like so
or more compact
generalizing
that spoken in natural language is defined as the number of -Permutations of objects is , that reads as pick .
-Combination
-Permutations forget about some elements, what if I want to forget also about the ordering? I may, for example, be interested in knowing how many sums of some set elements arrangements I can compute. The ordering, here, clearly doesn’t matter.
In how many ways can I arrange the 3 numbers of the -Permutations example? This is a simple permutation, hence , and it represents something I don’t want because these arrangements all give me the same sum.
Just like I have done to subtract the elements from the permutation
I need to subtract repeated arrangements, hence
that, expanding, gives me
that reads as choose .
This, incidentally, means that if order doesn’t matter there is only way to choose all the elements of a set. This is useless and trivial, but it closes the circle beautifully.
Progressive layers of forgetting
There is a thread that runs across these operation, starting from the Product rule, through Permutations, to -Combinations: the progressive shrinking of the number of possible arrangements. From the largest, obtained by application of the Product rule, forget about
- repetitions permutations
- some elements -permutations
- ordering -combinations
Each of these computes a smaller sets of the possible arrangements universe represented by the application of the Product rule. This is the same pattern found in the relationship between the Dot product and Pearson correlation described in the dedicated note.
Related
- conditional-probability-and-bayes-rule — permutations and combinations are the counting tools that underpin event probability