Brick walls are there for a reason. The brick walls are not there to keep us out. The brick walls are there to show how badly we want something. Because the brick walls are there to stop the people who don’t want something badly enough. They are there to keep out the other people, Randy Pausch.
Let A and B be two arbitrary sets.
A function is just a collection of ordered pairs of the form (a, b) where a ∈ A and b ∈ B that satisfies one condition: every element a in the domain A must be paired with exactly one element b in the codomain B. The first elements are called arguments, the second values.
A way of representing the set of ordered pairs which define a function is to use one of these notations: {(x,y)| y = f(x), x ∈ X} or {(x, f(x))| x ∈ X}.
1.c’s diagram represents the set of pairs {(1, A), (2, B), (3, C), (3, D)}. It does not define a function because: (i) 3 is in more than one ordered pair, namely (3, C) and (3, D); (ii) 4 is not a first element (input) of any ordered pair.
f = {(x, y) ∈ ℤ x ℤ | 2x -3y = 1} is not a function either because (1, y)∉f ∀y∈ℤ (1 is not a first element of any ordered pair). Suppose for the sake of contradiction, ∃y: 2·1 -3·y = 1 ⇒ -3·y = -1 ⇒ y = 1/3 ∉ ℤ ⊥
A function is most often denoted by letters such as f, g, or h. A function takes an input element from the set A (X) and produces an output in the set B (Y). We can image it as some sort of black box, device, or machine that does some kind of computation or transformation (1.b). You put some object into its input funnel, then the function machine will process that object or argument and turn it into some other object or value, which comes out as output.
Let’s see some examples:
The set A (or X) is called the domain of f, the set B (or Y) is called the codomain of f. The image or range of a function f: X → Y is simply the set of all possible outputs or values it may produce under the mapping or transformation given by f, that is, f(X) = {y | y = f(x), x ∈ X } ⊆ Y. The graph of the function is the set of all ordered pairs (x,y) in the plane that satisfies the equation y = f(x), i.e., {(x, y)| y = f(x), x ∈ X}. It represents a curve in the x, y-plane giving a pictorial representation of the function.
An injective or one-to-one function is a function that maps distinct elements of its domain to distinct elements of its codomain, that is, whenever Φ(a1) = Φ(a2) then a1 = a2. In other words, if we pick any element from the codomain, it is either connected to exactly one or no elements from the domain.
f, g: ℝ → ℝ, then f(x) = 2x, and g(x) = 2x+1 are both injective, but x2 is not, because f(-1) = 1 = f(1). A monotonic function is a function that is either always increasing or always decreasing on its domain. A strictly monotonic function is injective, since in this case x1 < x2 implies that f(x1) < f(x2) or f(x1) > f(x2). ex is injective because ex = ey ⇒ x = y.
A surjective or onto function is loosely speaking a function that “hits everything” or more formally, a function f such that for each element in the codomain there is at least one element in the domain that maps to it. Thus, if we choose any element from the codomain, we can find at least one element from the domain that it is connected to. It is one whose image covers the entire codomain, that is, for every b ∈ B, there exists a ∈ A such that Φ(a) = b (∀b ∈ B, ∃a ∈ A: Φ(a) = b).
For any set X, the identity function idX: X → X, idX(x) = x, ∀ x ∈ X is surjective. f,g: ℝ → ℝ, f(x) = 2x +1 is surjective (∀ y∈ℝ, we have an x(y-1⁄2) such that f(x)=y), but g(x)=x2 is not surjective. However, g: ℝ → ℝ+, where ℝ+ = {x∈ℝ : x ≥ 0} and g(x)=x2 is surjective.
f: ℝ → ℝ defined by f(x) = $\frac{1}{x^2+1}$ is neither injective (f(1) = f(-1) = $\frac{1}{2}$) nor surjective (there is no element x ∈ ℝ: $\frac{1}{x^2+1}=2↭1=2x^2+2↭x^2=\frac{-1}{2}↭x=\sqrt{\frac{-1}{2}}, x ∈\mathbb{R}$ ⊥).
A bijective function is a relation that is both injective and surjective. It is a function that each element in the domain is mapped to exactly one element in the codomain and viceversa. Formally, if Φ(a1) = Φ(a2), then a1 = a2, and for every b ∈ Y, there exists a ∈ A such that f(a) = b.
For any set X, the identity function idX: X → X, idX(x) = x, ∀ x ∈ X is bijective. Any lineal function over the real numbers, f: ℝ → ℝ, f(x) = ax + b, a ≠ 0 is a bijection. g: ℝ → (-Π⁄2, Π⁄2), given by g(x) = arctan(x) is bijective. f: ℝ → ℝ, f(x) = x3 is bijective, too.
The Pigeonhole principle states that if n items or objects are put into m containers, with n > m, then at least one container must contain more than one item.
Proposition. Suppose that A and B are finite sets and f : A → B is any function. Then,
Problem. Any city containing more than 100,000 people will certainly have at least two people who have the same number of hairs.
Let A be the citizens of a city with more that 100,000 people, B = {0, 1, 2, ···, 100,000}, and h (h stands for hairs or “hairy”): A → B, h(a) = # of hairs of a’s head ⇒ [If |A| > |B|, then f is not injective] h is not injective ⇒ ∃x, y ∈A: h(x) = h(y), so there are two people, x and y, with the same number of hairs∎