Counting and Permutations
ICS 6D Chapter 10.1-10.4
- 10.1: Sum and Product Rules
- 10.2: The bijection rule
- 10.3: The generalized product rule
- 10.4: Counting permutations
10.1: Sum and Product Rules
-
Counting: The process of finding the total amount of combinations that something can be
-
The product rule is one way to count sequences (or combinations)
- Example:
- A set of characters can be called an alphabet, and in an alphabet Σ, Σn is the set of all strings of length n that contain characters only from Σ
- Cardinality of Σn:
- The sum rule is used when you can make multiple choices but only one seelection is made
10.2: The bijection rule
- The bijection rule states that if there is a bijection from one set to another, then they have the same cardinality
- A function that maps one set A to another set B is called a bijection if and only if it has a well defined inverse, where the inverse is a function that maps set B to set A
- This rule can be applied to map a power set to different strings:
- The k-to-1 rule applies for functions that map a set A to another set B such that, for every element in A, there are exactly k different elements in B that it maps to
-
Thus, A = B /k
-
10.3: The generalized product rule
-
The generalized product rule states that, when selecting an item from a set, if the number of choices at each step does not depend on the previous choices, then the number of combinations is the product of the number of choices in each step
- Definition:
10.4: Counting permutations
- An r-permutation is a sequence of r items with no repetitions, all taken from the same set
- Order matters in sequences, so {A, B, C} is different than {B, C, A}; both are 3-permutations
- Formula for number of r-permutations:
- A permutation is a sequence that contains every element of a set exactly once
- Formula for number of permutations of a set with n elements: