week 5
solving for inverses analytically
view diagram 4.3.4
Function
A function f that maps elements of a set X to elements of a set Y, is a subset of X × Y such that for every x ∈ X, there is exactly one y ∈ Y for which (x, y) ∈ f f: X → Y is the notation to express the fact that f is a function from X to Y The fact that f maps x to y (or (x, y) ∈ f) can also be denoted as f(x) = y.
one-to-one or injective
A function f: X → Y is one-to-one or injective if x1 ≠ x2 implies that f(x1) ≠ f(x2). That is, f maps different elements in X to different elements in Y.
onto or surjective
A function f: X → Y is onto or surjective if the range of f is equal to the target Y. That is, for every y ∈ Y, there is an x ∈ X such that f(x) = y.
bijective
A function is bijective if it is both one-to-one and onto. A bijective function is called a bijection. A bijection is also called a one-to-one correspondence
partition
A partition of a non-empty set A is a collection of non-empty subsets of A such that each element of A is in exactly one of the subsets. A1, A2, ...,An is a partition for a non-empty set A if all of the following conditions hold: For all i, Ai ⊆ A. For all i, Ai ≠ ∅ A1, A2, ...,An are pairwise disjoint. A = A1 ∪ A2 ∪ ... ∪ An
pairwise disjoint
A sequence of sets, A1, A2, ..., An, is pairwise disjoint if every pair of distinct sets in the sequence is disjoint (i.e., Ai ∩ Aj = ∅ for any i and j in the range from 1 through n where i ≠ j).
inverse
If a function f: X → Y is a bijection, then the inverse of f is obtained by exchanging the first and second entries in each pair in f. The inverse of f is denoted by f-1: Reversing each pair in a function f does not always result in a well-defined function. Therefore, some functions do not have an inverse. A function f: X → Y has an inverse if and only if reversing each pair in f results in a well-defined function from Y to X. f-1 is a well-defined function if every element in Y is mapped to exactly one element in X. Inverse in function notation f(x) = y if and only if f-1(y) = x.
well-defined (related to function definition)
If f maps an element of the domain to zero elements or more than one element of the target, then f is not well-defined. Simplified, if one x in domain maps to two y's then its not a well defined function if there is an x in the domain that maps to no y it is also not a well defined function
inferences based on domain and target being finite sets
If f: D → T is onto, then for every element in the target, there is at least one element in the domain: |D| ≥ |T|. If f: D → T is one-to-one, then every element in the domain maps to a unique element in the target: |D| ≤ |T| If f: D → T is a bijection, then f is one-to-one and onto: |D| ≤ |T| and |D| ≥ |T|, which implies that |D| = |T|..
arrow diagram (related to function definition)
In an arrow diagram for a function f, the elements of the domain X are listed on the left and the elements of the target Y are listed on the right. There is an arrow from x ∈ X to y ∈ Y if and only if (x, y) ∈ f. Since f is a function, each x ∈ X has exactly one y ∈ Y such that (x, y) ∈ f, which means that in the arrow diagram for a function, there is exactly one arrow pointing out of every element in the domain.
identity function
The identity function on A, denoted IA: A → A, is defined as IA(a) = a, for all a ∈ A.
composition.
The process of applying a function to the result of another function is called composition f and g are two functions, where f: X → Y and g: Y → Z. The composition of g with f, denoted g ο f, is the function (g ο f): X → Z, such that for all x ∈ X, (g ο f)(x) = g(f(x) Generally, the order in which the functions are applied is important, so f ο g is not the same as g ο f. Define: f: R+ → R+, f(x) = x3 g: R+ → R+, g(x) = x + 2 Then (f ο g)(x) = f(g(x)) = (x + 2)3 (g ο f)(x) = g(f(x)) = x3 + 2
Domain (related to function definition)
The set X is called the domain of f,
Function equality
Two functions, f and g, are equal if f and g have the same domain and target, and f(x) = g(x) for every element x in the domain. The notation f = g is used to denote the fact that functions f and g are equal. note that f: X → X, f(x) = (x - 1)^2 g: X → X, g(0) = 1, g(1) = 0, g(2) = 1 is equal even though g does not show a formula for all x because it shows example output that matches f(x)
disjoint
Two sets, A and B, are said to be disjoint if their intersection is empty (A ∩ B = ∅).
range
an element y is in the range of f if and only if there is an x ∈ X such that (x, y) ∈ f. Expressed in set notation: Range of f = { y: (x, y) ∈ f, for some x ∈ X } the range of f is a subset of the target but the range is not necessarily equal to the target. In an arrow diagram, the range is the set of elements in the target that have arrows coming into them. PARTICIPATION ACTIVITY
ceiling and floor brackets
ceiling has brackets that bend on top and means round up floor has brackets that bend on bottom and means round down
Composition is associative
f ο g ο h = (f ο g) ο h = f ο (g ο h) = f(g(h(x)))
All possible combinations of 5 binary digits
f(00000) = 0 f(00001) = 1 f(00010) = 1 f(00011) = 2 f(00100) = 1 f(00101) = 2 f(00110) = 2 f(00111) = 3 f(01000) = 1 f(01001) = 2 f(01010) = 2 f(01011) = 3 f(01100) = 4 f(01101) = 3 f(01110) = 3 f(01111) = 4 f(10000) = 1 f(10001) = 2 f(10010) = 2 f(10011) = 3 f(10100) = 2 f(10101) = 3 f(10110) = 4 f(10111) = 4 f(11000) = 2 f(11001) = 3 f(11010) = 3 f(11011) = 4 f(11100) = 3 f(11101) = 4 f(11110) = 4 f(11111) = 5
functions with sets
f: {0, 1}3 → {0, 1}4 x ∈ {0, 1}^3, f(x) = x0 Then for any 3-bit string x, the output of f on input x is obtained by adding a 0 to the end of x. For example f(011) = 0110.
if you are stuck on a for loop not knowing how to increment something properly
find the limit of the object, set i <= limit where limit is defined outside the loop then increment limit++ in the loop to fit the logic
4.4.3 chegg for identity questions
https://www.chegg.com/homework-help/questions-and-answers/define-f-function-whose-domain-x-whose-target-y-x-y--following-functions-indicate-whether--q22483675
4.4.4
https://www.chegg.com/homework-help/questions-and-answers/let-f-x-y-g-y-z-two-functions-possible-f-onto-g-f-onto-justify-answer-answer-yes-give-spec-q22483765
4.1.5 ridiculously long questions chegg link
https://www.chegg.com/homework-help/questions-and-answers/please-help-express-range-function-using-roster-notation-e-f-0-1-3-0-1-3-x-0-1-3-f-x-obtai-q34499490
composite function tips
if f is x -> y and g is y -> z then domain of (g of) = x target of (g o f) = z
inverse domain and target
in a composition where f is x -> y -1f o f the domain and target will be x if f o -1f the domain and target will be y
Target (related to function definition)
set Y is the target of f. An alternate word for target that is sometimes used is co-domain