W8 - Counting and Combinatorics Flashcards
(6 cards)
Inclusion and exclusion general case
|A ∪ B ∪ C| = |A| + |B| + |C| - |A ∩ B| - |A ∩ C| - |B ∩ C| + |A ∩ B ∩ C|
- add individual sets.
- subtract sum of sizes for all interception of two sets
- subtract sum of sizes for all interception of three sets
- ect
- add the size of all of the sets AND together
What is ordered/unordeded
and with/without replacement
with ice-cream example
Imagine ice-cream cone:
Ordered = I care about the which order the scoop are stacked [mint, choco is different to choco, mint] - this is permutations.
With replacement = I can pick the same flavour multiple times
If we have a set of n elements and draw r elements from it
Ordered selection with replacement
n^r
If we have a set of n elements and draw r elements from it
Ordered selection without replacement
nPr = n! / (n-r)!
If we have a set of n elements and draw r elements from it
Unordered selection with replacement
(n+r-1) choose r
If we have a set of n elements and draw r elements from it
Unordered selection without replacement
nCr = n! / [ r! * (n-r)!]