QF101: Quantitative Finance August 22, 2017 Week 1: Functions Facilitator: Christopher Ting AY 2017/2018 The chief function of the body is to carry the brain around. Thomas A. Edison 1.1 What is a function? 1. In set theory, we learn the relations such as subset, complement and so on between two sets. What about the relation between the elements of a set with the elements of another set? The answer for this question is, function. 2. Broadly speaking, a function specifies a mathematical relation that the elements of one set has with the elements of another set, under one defining condition. 3. Given sets X and Y, a function from X to Y is a set of ordered pairs F of members of these sets such that for every x in X there is a unique y in Y for which the pair (x, y) is in F. 4. Notation f is a function from the set of natural numbers N to the set of real numbers R is typically expressed as, for example, f : N R, n 2n n 2 + π. The first part of this notation is often read as f is a function on N into R. f(n) is read as f of n, where n is the argument of the function. 5. More formally, a function from X to Y is an object f such that every variable x X is uniquely associated with an object f(x) in Y. Very often, we write y = f(x). Example: Let X = {H, T }, Y = { 1, 0, 1}. Then (H, 1), (T, 1) is a function. One may interpret X as the two possible outcomes of tossing a coin. If head turns up, then it is associated with 1. If tail turns up, then it is associated with -1. This is a one-to-one function or mapping. The coin can stand on its edge after being tossed. But this unstable outcome is rare. 1-1
Week 1: Functions 1-2 Example: For the same X, the collection of pairs {(H, 1), (H, 0), (T, 1)} does not form a function because H is associated with 1 and 0, which is not unique. 6. The notation f : X Y indicates that f is a function with domain X and codomain Y. The function f is said to map or associate elements of X to elements of Y. Example: Constant function f(x) = c, x X Example: Indicator function 1 if x A, 1 A (x) = 0 if x / A. Here, the set A is a subset of X. Often, indicator function comes in various forms. For example, suppose a, b R, we can also have 1 if b > a, 1 b>a (x) = 0 if b a. Example: Sign function Example: Identity function The function satisfying sgn(x) = f(x) = x, 1, if x < 0; 0, if x = 0; 1, if x > 0. x X is called the identity function, and denoted by id X. Example: Power function A power function is f(x) = c x n, where c is a constant and n is typically an integer. Example: Polynomial function A polynomial function is a linear sum of power functions as follows: f(x) = a n x n + a n 1 x n 1 + + a 2 x 2 + a 1 x + a 0
Week 1: Functions 1-3 for all arguments x, where n is a non-negative integer and a 0, a 1, a 2,..., a n are constant coefficients. As an example, we have f(x) = x 3 x. Example: Logarithm function If b is any strictly positive number (b > 0) and x > 0, then y = log b x is equivalent to b y = x. We usually read this as log base b of x. In this definition y = log b x is called the logarithm form and b y = x is called the exponential form. Example: Natural logarithm function If b is the Napier s constant, denoted by e, which is the irrational value of 2.718281828459045, then a different symbol is used. ln(x) = log e x. Example: Exponential function The exponential form that corresponds to the natural logarithm is called the exponential function as follows: e x = exp ( x ). Example: Hyperbolic functions Hyperbolic sine: Hyperbolic cosine: Hyperbolic tangent: sinh x = ex e x 2 cosh x = ex + e x 2 = e2x 1 2e x = e2x + 1 2e x tanh x = sinh x cosh x = ex e x e x + e x = e2x 1 e 2x + 1 7. The set of all y is known as the image or range of the function, and need not be the whole of the codomain. That is, not every element of Y need to have an x in the domain to be associated with or mapped to it. 8. Three important kinds of functions are injection (or one-to-one function): if f(a) = f(b), then a must equal b;
Week 1: Functions 1-4 surjection (or onto function): for every y in the codomain there is an x in the domain such that f(x) = y; bijection: both one-to-one and onto. 9. A real-valued function f(x) on an interval is said to be concave if, for any x 1 and x 2 in the interval and for any t in [0, 1], f ( ) tx 1 + (1 t)x 2 tf(x1 ) + (1 t)f(x 2 ). The function is called strictly concave if f ( ) tx 1 + (1 t)x 2 > tf(x1 ) + (1 t)f(x 2 ), for any t (0, 1) and x 1 x 2. 10. For a function f : R R, this definition merely states that for every x 0 between x 1 and x 2, the point ( x 0, f(x 0 ) ) on the graph of f is above the straight line joining the points ( x 1, f(x 1 ) ) and (x 2, f(x 2 ) ). 11. A real-valued function f(x) on an interval is said to be concave if, for any x 1 and x 2 in the interval and for any t in [0, 1], f ( ) tx 1 + (1 t)x 2 tf(x1 ) + (1 t)f(x 2 ). The function is called strictly convex if f ( ) tx 1 + (1 t)x 2 < tf(x1 ) + (1 t)f(x 2 ), for every t such that 0 < t < 1 and x 1 x 2. 12. A function f is said to be (strictly) concave if f is (strictly) convex. 1.2 Composition 1. The nesting of two or more functions to form a single new function is known as composition. The composition of two functions f and g is denoted f g, where f is a function whose domain includes the range of g. The notation (f g)(x) = f ( g(x) ) is sometimes used to explicitly indicate the variable. 2. Composition is associative, so that f (g h) = (f g) h.
Week 1: Functions 1-5 1.3 Inverse functions 1. If f is a function from X to Y then an inverse function for f, denoted by f 1, is a function in the opposite direction, from Y to X, with the property that a round trip (a composition) returns each element to itself. Namely, for every x X, f 1( f(x) ) = x. 2. At times it is expressed as f 1 f = id X. 3. Not every function has an inverse; those that do are called invertible. The inverse function exists if and only if f is a bijection. Example: To find the inverse function of f(x) = (2x+8) 3 is to solve the equation y = (2x+8) 3 for x in terms of y. y = (2x + 8) 3 = 3 y = 2x + 8 = x = 3 y 8 2 Thus the inverse function f 1 is given by the formula f 1 (y) = 3 y 8 2 4. If f : X Y is any function (not necessarily invertible), the preimage (or inverse image) of an element y Y is the set of all elements of X that map to y: f 1 (y) = {x X : f(x) = y}.. Similarly, if S is any subset of Y, the preimage of S is the set of all elements of X that map to S: f 1 (S) = {x X : f(x) S}. Example: Consider the sine function f(x) = sin(x). The inverse function of sin(x) is denoted as arcsin(y). Similarly, arccos(y), arctan(y) are the inverse functions of, respectively, cos(x) and tan(x). Example: Take a function f : R R, where f : x x 2. This function is not invertible. Yet preimages may be defined for subsets of the codomain, for example, f 1 ({1, 4, 9, 16}) = { 4, 3, 2, 1, 1, 2, 3, 4}.
Week 1: Functions 1-6 1.4 Limit and Continuity 1. We say that lim f(x) = L if for every ɛ > 0 there is a δ > 0 such that whenever 0 < x a < δ then f(x) L < ɛ. Here L is the limit point. 2. Intuitive, if we can make f(x) as close to L as we want by taking x sufficiently close to a (on either side of a) without letting x = a. 3. The right hand limit is defined as lim f(x), for x > a. + In other words, the limit L is approached from the right where x > a. 4. The left hand limit is defined as lim f(x), for x < a. In other words, the limit L is approached from the left where x < a. 5. The right hand limit and the left hand limit need not necessarily be the same. If they are different, then lim f(x) does not exist. Example: Piecewise function x 2 + 5, if x 2; f(x) = 1 3x, if x 2. The left hand and right hand limits are, respectively, Therefore, lim x 2 f(x) does not exist. 6. But if lim f(x) does exist, then lim f(x) = lim x 2 x 2 x2 + 5 = 9 ; lim f(x) = lim 1 3x = 7. x 2 + x 2 + lim f(x) = lim f(x). + Conversely, when the left hand and right hand are equal, than lim f(x) exists. 7. The function f is continuous at some point a of its domain if the limit of f(x) as x approaches a through domain of f exists and is equal to f(a). In mathematical notation, this is written as lim f(x) = f(a).
Week 1: Functions 1-7 Implicit in this definition, three conditions are assumed. First, f has to be defined at a. Second, the limit on the left hand side of that equation has to exist. Third, the value of this limit must equal f(a). The function f is said to be continuous if it is continuous at every point of its domain. 8. Assume lim f(x) and lim g(x) both exist and c is any number, then (a) lim ( cf(x) ) = c lim f(x) (b) lim ( f(x) ± g(x) ) = lim f(x) ± lim g(x) ( ) (c) lim f(x)g(x) = lim f(x) lim g(x) ( ) f(x) (d) lim = lim f(x) g(x) lim g(x) ( ) n ( ) n, (e) lim f(x) = lim f(x) where n is typically a rational number. (f) Suppose f(x) is continuous at b and lim g(x) = b, then lim f( g(x) ) ( ) = f lim g(x) = f(b). 1.5 Squeeze theorem 1. The squeeze theorem (known also as the pinching theorem, the sandwich theorem, the sandwich rule and sometimes the squeeze lemma) is a theorem regarding the limit of a function. 2. The squeeze theorem is a technical result that is very important in proofs in calculus and mathematical analysis. It is typically used to confirm the limit of a function via comparison with two other functions whose limits are known or easily computed. It was first used geometrically by the mathematicians Archimedes and Eudoxus in an effort to compute π, and was formulated in modern terms by Gauss. 3. The squeeze theorem is formally stated as follows. Let I be an interval having the point a as a limit point. Let f, g, and h be functions defined on I, except possibly at a itself. Suppose that for every x in I not equal to a, we have g(x) f(x) h(x), and also suppose that Then lim g(x) = lim h(x) = L. lim f(x) = L.
Week 1: Functions 1-8 Proof: When x a, and under the assumption that g(x) f(x), we have by the definition of greatest lower bound inf. lim g(x) lim inf f(x) When x a, and under the assumption that f(x) h(x), we have by the definition of least upper bound sup. lim sup f(x) lim h(x) Obviously, we have lim inf f(x) lim sup f(x). Putting these inequalities together and by assumption, lim g(x) = lim h(x) = L, we obtain L = lim g(x) lim inf f(x) lim sup f(x) lim h(x) = L. Consequently all the inequalities are indeed equalities and the theorem immediately follows. 4. The functions g and h are said to be lower and upper bounds, respectively of f. 5. Here a is not required to lie in the interior of I. Indeed, if a is an endpoint of I, then the above limits are left- or right-hand limit. 6. A similar statement holds for infinite intervals: for example, if I = (0, ), then the conclusion holds, taking the limits as x. Example: The limit cannot be ascertained through the limit law lim x 0 x2 sin x because does not exist. ( ) lim f(x) g(x) = lim f(x) lim g(x), lim sin x 0 x However, by the definition of the sine function, 1 sin 1. x Multiplying each term by a positive number x 2, it follows that x 2 x 2 sin x 2. x Since lim x 0 x 2 = lim x 0 x 2 = 0, by the squeeze theorem, lim x 0 x 2 sin must also be 0. x
Week 1: Functions 1-9 1.6 Exercises A. Is the function f(x), f : R R, x R, f : x x 2 injective, surjective, or bijective function? B. Find the inverse function of ( ( ) 2 ) 1 exp 1 x µ, 2π σ 2 σ where x R is the variable of the function, µ R is a constant, and σ is a strictly positive realvalued constant. C. Apply the squeeze theorem to find the limit of when x π. f(x) = sgn ( π x ) ( ( ) ( )) 1 1 sin + cos π x π x