Counting and functions Flashcards
Ordered choice with repetitions
n^k
Ordered choice without repetitions
n!/(n-k)!
Unordered choice without repetitions
n!/k!(n-k)!
Unordered choice with repetitions
(k+n-1) choose (n-1)
What does n stand for
Number of choices
What does k stand for
Number of spots to fill / how many we are working with
How to calculate n choose k
n! / k!(n-k)!
For function f(x) where A -> B. What is the domain?
A is the collection of possible input, its the domain of f
For function f(x) where A -> B. What is the codomain?
B is the codomain of f, its the types of outputs f will generate
Range
A set of all values that the function actually produces, in most cases in a subset of the codomain
We can have:
- Several inputs correspond to the same output
- There is a value in B which never be an output value
We cannot have:
- One input corresponds to two different outputs
- There is a value in A which is not an input value
Function Composition
Given any two functions f ∶ B → C, g ∶ A → B, we can combine these functions via function composition: that is, we can define the function f ○ g ∶ A → C, defined by the rule f ○ g(x) = f (g(x)). We pronounce the small open circle symbol ○ as “composed with.”