Functions as Relations

Similar documents
Functions. Given a function f: A B:

Notes. Functions. Introduction. Notes. Notes. Definition Function. Definition. Slides by Christopher M. Bourke Instructor: Berthe Y.

CS100: DISCRETE STRUCTURES

3 FUNCTIONS. 3.1 Definition and Basic Properties. c Dr Oksana Shatalov, Spring

3 FUNCTIONS. 3.1 Definition and Basic Properties. c Dr Oksana Shatalov, Fall

3 FUNCTIONS. 3.1 Definition and Basic Properties. c Dr Oksana Shatalov, Fall

5 FUNCTIONS. 5.1 Definition and Basic Properties. c Dr Oksana Shatalov, Fall

9 FUNCTIONS. 9.1 The Definition of Function. c Dr Oksana Shatalov, Fall

Section 4.4 Functions. CS 130 Discrete Structures

Section Summary. Definition of a Function.

MATH 224 FOUNDATIONS DR. M. P. M. M. M C LOUGHLIN HAND-OUT XIV FUNCTIONS REVISED 2016

Func%ons. function f to the element a of A. Functions are sometimes called mappings or transformations.

0 Sets and Induction. Sets

Sec$on Summary. Definition of a Function.

Functions Functions and Modeling A UTeach/TNT Course

REVIEW FOR THIRD 3200 MIDTERM

Discussion Summary 10/16/2018

COM S 330 Homework 05 Solutions. Type your answers to the following questions and submit a PDF file to Blackboard. One page per problem.

Section Summary. Definition of a Function.

Chapter Summary. Sets (2.1) Set Operations (2.2) Functions (2.3) Sequences and Summations (2.4) Cardinality of Sets (2.5) Matrices (2.

Functions If (x, y 1 ), (x, y 2 ) S, then y 1 = y 2

Cartesian Products and Relations

Functions. Definition 1 Let A and B be sets. A relation between A and B is any subset of A B.

Today s Topics. Methods of proof Relationships to logical equivalences. Important definitions Relationships to sets, relations Special functions

Sets and Functions. MATH 464/506, Real Analysis. J. Robert Buchanan. Summer Department of Mathematics. J. Robert Buchanan Sets and Functions

9/21/2018. Properties of Functions. Properties of Functions. Properties of Functions. Properties of Functions. Properties of Functions

9/21/17. Functions. CS 220: Discrete Structures and their Applications. Functions. Chapter 5 in zybooks. definition. definition

Definition: For nonempty sets X and Y, a function, f, from X to Y is a relation that associates with each element of X exactly one element of Y.

Real Analysis. Joe Patten August 12, 2018

2.1 Sets. Definition 1 A set is an unordered collection of objects. Important sets: N, Z, Z +, Q, R.

1. Decide for each of the following expressions: Is it a function? If so, f is a function. (i) Domain: R. Codomain: R. Range: R. (iii) Yes surjective.

CS 220: Discrete Structures and their Applications. Functions Chapter 5 in zybooks

Section 7.2: One-to-One, Onto and Inverse Functions

RED. Name: Math 290 Fall 2016 Sample Exam 3

SETS AND FUNCTIONS JOSHUA BALLEW

Chapter Summary. Sets The Language of Sets Set Operations Set Identities Functions Types of Functions Operations on Functions Computability

Sets and Functions. (As we will see, in describing a set the order in which elements are listed is irrelevant).

QUESTION BANK II PUC SCIENCE

Week Some Warm-up Questions

Solutions to Homework Problems

Day 15. Tuesday June 12, 2012

RELATIONS AND FUNCTIONS

447 HOMEWORK SET 1 IAN FRANCIS

AMB111F Notes 1: Sets and Real Numbers

Math Fall 2014 Final Exam Solutions

Sets. We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Functions. Chapter Continuous Functions

MATH 220 (all sections) Homework #12 not to be turned in posted Friday, November 24, 2017

(a) We need to prove that is reflexive, symmetric and transitive. 2b + a = 3a + 3b (2a + b) = 3a + 3b 3k = 3(a + b k)

MATH 3300 Test 1. Name: Student Id:

QF101: Quantitative Finance August 22, Week 1: Functions. Facilitator: Christopher Ting AY 2017/2018

RED. Fall 2016 Student Submitted Sample Questions

Math 210 Exam 2 - Practice Problems. 1. For each of the following, determine whether the statement is True or False.

Selected problems from past exams

Sets, Functions and Relations

Chapter 2 Invertible Mappings

Relations, Functions & Binary Operations

INFINITY.THINK BEYOND.

Functions and cardinality (solutions) sections A and F TA: Clive Newstead 6 th May 2014

Math 42, Discrete Mathematics

Solved Examples. Given are two sets A {1, 2, -2, 3} and B = {1, 2, 3, 5}. Is the function f(x) = 2x - 1 defined from A to B?

CLASS12 RELATIONS AND FUNCTIONS

Review Problems for Midterm Exam II MTH 299 Spring n(n + 1) 2. = 1. So assume there is some k 1 for which

LESSON RELATIONS & FUNCTION THEORY

4.1 Real-valued functions of a real variable

Chapter 1 : The language of mathematics.

Topology. Xiaolong Han. Department of Mathematics, California State University, Northridge, CA 91330, USA address:

Practice Exam 1 CIS/CSE 607, Spring 2009

Chapter 1. Sets and Mappings

Discrete dynamics on the real line

A function is a special kind of relation. More precisely... A function f from A to B is a relation on A B such that. f (x) = y

SRI RAMAKRISHNA INSTITUTE OF TECHNOLOGY COIMBATORE Discrete Mathematics Functions

Introduction to Decision Sciences Lecture 6

Cardinality and ordinal numbers

CHAPTER 7 FUNCTIONS. Alessandro Artale UniBZ - artale/

About This Document. MTH299 - Examples Weeks 1-6; updated on January 5, 2018

4) Have you met any functions during our previous lectures in this course?

MATH 22 FUNCTIONS: COMPOSITION & INVERSES. Lecture N: 10/16/2003. Mad world! mad kings! mad composition! Shakespeare, King John, II:1

CSCE 222 Discrete Structures for Computing

RED. Name: Instructor: Pace Nielsen Math 290 Section 1: Winter 2014 Final Exam

Math 3450 Homework Solutions

Topics in Logic, Set Theory and Computability

Functions of Several Variables (Rudin)

Functions. Chapter Introduction to Functions

Topology Homework Assignment 1 Solutions

9/19/2018. Cartesian Product. Cartesian Product. Partitions

UWO CS2214 Feb. 4, Assignment #1 Due: Feb. 12, 2017, by 23:55 Submission: on the OWL web site of the course

(So SamID 1 ( ) = Ken W. Smith.)

Theorem. For every positive integer n, the sum of the positive integers from 1 to n is n(n+1)

MATH 215 DISCRETE MATHEMATICS INSTRUCTOR: P. WENG

Math 5801 General Topology and Knot Theory

Introduction to Topology

A Short Review of Cardinality


MATH 13 SAMPLE FINAL EXAM SOLUTIONS

Solutions for Chapter Solutions for Chapter 17. Section 17.1 Exercises

Introduction to Abstract Mathematics

4. We accept without proofs that the following functions are differentiable: (e x ) = e x, sin x = cos x, cos x = sin x, log (x) = 1 sin x

Numbers, sets, and functions

Transcription:

Functions as Relations Definition Recall that if A and B are sets, then a relation from A to B is a subset of A B. A function from A to B is a relation f from A to B with the following properties (i) The domain of f is A. (ii) If (x, y) f and (x, z) f, then y = z. In other words, for each a A, there is a unique element b B such that (a, b) f. 1

Function Notation If f is a function from A to B, we write f : A B, and we say that A is the domain of f and B is the codomain of f. 2

Functions Example: Let A = {1, 2, 3} and B = {4, 5, 6}. Determine which of the following relations are functions from A to B.. R = {(1, 4), (2, 5), (3, 6), (2, 6)} R = {(1, 4), (2, 6), (3, 5)} R = {(1, 5), (2, 5), (3, 4)} R = {(1, 4), (3, 6)} 3

Functions Example: Let A = {1, 2, 3} and B = {4, 5, 6}. Determine which of the following relations are functions from A to B. R = {(1, 4), (2, 5), (3, 6), (2, 6)} R is not a function, since R is not single-valued: (2, 5) R and (2, 6) R R = {(1, 4), (2, 6), (3, 5)} Function R = {(1, 5), (2, 5), (3, 4)} Function 4

R = {(1, 4), (3, 6)} R is not a function from A to B, since Dom(R) = {1, 3} = A.

Functions Example: Let F be the relation from Z to Z defined by F = {(x, y) Z Z y = x 2 }. Prove that F is a function from Z to Z. Proof: 5

Functions Example: Let F be the relation from Z to Z defined by F = {(x, y) Z Z y = x 2 }. Prove that F is a function Z to Z. Proof: First we ll show that Dom(F ) = Z. Assume x Z. Let y = x 2. Then, y Z. Therefore, (x, y) Z Z and y = x 2, which means (x, y) F. Therefore, x Dom(F ). This proves Dom(F ) = Z. Next, we ll show that F is single-valued. Assume (x, y) F and (x, z) F where x, y, z Z. Then y = x 2 and z = x 2. Therefore y = z. This completes the proof. 6

Functions Example: Let F be the relation from R to R defined by F = {(x, y) R R x = y 3 }. Prove that F is a function R to R. Proof: 7

Functions Example: Let F be the relation from R to R defined by F = {(x, y) R R x = y 3 }. Prove that F is a function R to R. Proof: First we ll show that Dom(F ) = R. Assume x R. Let y = 3 x. Then, y R. Therefore, (x, y) R R and x = ( 3 x) 3 = y 3, which means (x, y) F. Therefore, x Dom(F ). This proves Dom(F ) = R. Next, we ll show that F is single-valued. Assume (x, y) F and (x, z) F where x, y, z R. Then x = y 3 and x = z 3. Therefore y 3 = z 3. Therefore, y = z. This completes the proof. 8

Functions Example: Let F be the relation from R to R defined by F = {(x, y) R R x = y 2 }. Explain why F is not a function from R to R. 9

Functions Example: Let F be the relation from R to R defined by F = {(x, y) R R x = y 2 }. Explain why F is not a function from R to R. Solution: If (x, y) F, then x = y 2 0. the domain of F is [0, ), not R. Therefore Also, F is not single-valued. For example, when x = 4, we have y = ±2. That is, (4, 2) F and (4, 2) F. Hence, F is not a function. 10

Range of a Function If f : A B and the ordered pair (a, b) belongs to f, then we write f(a) = b and we say b the image of a under f. The range of f, denoted Rng(f), is the set of all images of elements of A. That is, Rng(f) = {b B (a, b) f for some a A} 11

Range of a Function Example: Find the range of each function. F : Z Z defined by F (x) = x 2. Rng(F ) = {0, 1, 4, 9, 16,...} F : R R defined by F (x) = sin(x). Rng(F ) = [ 1, 1] F : {1, 2, 3} {4, 5, 6} defined by F = {(1, 5), (2, 5), (3, 4)}. Rng(F ) = {4, 5} 12

Composition of Functions Theorem Assume f : A B and g : B C are functions. Then the composite relation g f, given by { } (x, z) A C y [(x, y) f and (y, z) g] is a function from A to C. 14

Proof: Assume f : A B and g : B C are functions. We want to show that the relation g f is a function from A to C. First we want to show that the domain of g f is A. Since g f A C, we have Dom(g f) A. Conversely, assume x A. Since f : A B is a function, there exists y B such that (x, y) f. Then, since g : B C is a function, there exists z C such that (y, z) g. Therefore, (x, z) g f, which shows x Dom(g f). This proves Dom(g f) = A. Next, we want to show that g f is singlevalued. Assume (x, z 1 ) g f and (x, z 2 ) g f. Then, there exist y 1 B such that (x, y 1 ) f and (y 1, z 1 ) g, and there exists y 2 B such that (x, y 2 ) f and (y 2, z 2 ) g.

In particular, (x, y 1 ) f and (x, y 2 ) f, and since f is single-valued, it follows that y 1 = y 2. Then, (y 1, z 1 ) g and (y 1, z 2 ) = (y 2, z 2 ) g, and since g is single-valued, it follows that z 1 = z 2. This proves g f is single-valued. Therefore, g f is a function from A to B.

Composition of Functions Theorem: Assume f : A B, g : B C, and h : C D are functions. Then, (h g) f = h (g f). That is, composition of functions is associative. 15

Proof: By the previous theorem, we have Dom((h g) f) = Dom(f) = A, Dom(h (g f)) = Dom((g f)) = Dom(f) = A. This shows that the domains of (h g) f and h (g f) are the same. Next, assume x A. Then, ((h g) f)(x) = (h g)(f(x)) = h(g(f(x))) = h((g f)(x)) = (h (g f))(x). Therefore, (h g) f = h (g f).

Composition of Functions Example: Let A = {1, 2, 3, 4, 5} and consider the functions f, g : A A given by f = {(2, 4), (5, 1), (3, 2), (1, 2), (4, 3)} g = {(4, 1), (5, 4), (1, 2), (2, 1), (3, 4)} Determine the following. (g f)(1) = (g f)(2) = (g f)(3) = (g f)(4) = (g f)(5) = g f = Rng(g f) = 16

Composition of Functions Example: Let A = {1, 2, 3, 4, 5} and consider the functions f, g : A A given by f = {(2, 4), (5, 1), (3, 2), (1, 2), (4, 3)} g = {(4, 1), (5, 4), (1, 2), (2, 1), (3, 4)} Determine the following. (g f)(1) = g(f(1)) = g(2) = 1 (g f)(2) = g(f(2)) = g(4) = 1 (g f)(3) = g(f(3)) = g(2) = 1 (g f)(4) = g(f(4)) = g(3) = 4 (g f)(5) = g(f(5)) = g(1) = 2 g f = {(1, 1), (2, 1), (3, 1), (4, 4), (5, 2)} Rng(g f) = {1, 2, 4} 17

One-To-One Function Let f : A B. We say that f is one-toone, or injective, if and only if (x 1, y) f (x 2, y) f x 1 = x 2 for all x 1, x 2 A and y B. 18

One-To-One Function Equivalently, f : A B and only if for all x 1, x 2 A is one-to-one if f(x 1 ) = f(x 2 ) x 1 = x 2 If f is one-to-one, we say f is an injection. 19

Onto Function Let f : A B. We say that f is onto, or surjective, if and only if for each y B there exists x A such that f(x) = y. That is, f is onto if and only if the range of f is equal to the codomain of f. If f is onto, we say that f is a surjection. 20

Examples Let A = {1, 2, 3, 4}, B = {a, b, c}, C = {α, β, γ} Determine if the given functions are oneto-one, onto, both or neither. 1. f : A B defined by 2. f : B C defined by 3. f : B A defined by 4. f : A C defined by f(1) = a f(2) = b f(3) = a f(4) = b f(a) = β f(b) = γ f(c) = α f(a) = 3 f(b) = 1 f(c) = 4 f(1) = α f(2) = β f(3) = β f(4) = γ 21

Proof Strategy To show f is injective Show that if f(x) = f(y), then x = y. To show f is not injective Show that there exist x and y such that f(x) = f(y) and x y. To show f is surjective Show that for each element y in the codomain there exists an element x in the domain such that f(x) = y. To show f is not surjective Show there exists an element y in the codomain such that y f(x) for any x in the domain. 22

Example Prove or disprove: The function f : Z Z defined by is injective. f(n) = 2n 3 23

Example Prove or disprove: The function f : Z Z defined by is injective. f(n) = 2n 3 f is injective. Proof: For all n, m Z we have f(n) = f(m) iff 2n 3 = 2m 3 iff 2n = 2m iff 2n 2m = 0 iff 2(n m) = 0 iff (n m) = 0 iff n = m. 24

In particular, f(n) = f(m) implies n = m for all n, m Z, which proves that f is injective. Note that we did not multiply both sides of the equation 2n = 2m by 1/2, since the codomain of f is Z and 1/2 is not an integer.

Example Prove or disprove: The function f : Z Z defined by is surjective. f(n) = 2n 3 25

Example Prove or disprove: The function f : Z Z defined by is surjective. f(n) = 2n 3 f is not surjective. The range of f contains only odd integers, therefore Rng(f) Z. For example, 0 / Rng(f) since the equation f(n) = 2n 3 = 0 has no solution in the domain Z. 26

Example Prove or disprove: The function f : Z Z defined by f(n) = is injective. n + 1 if n is odd n/2 if n is even 27

Example Prove or disprove: The function f : Z Z defined by f(n) = is injective. n + 1 if n is odd n/2 if n is even f is not injective. Let n = 1 and m = 4. Then, f(n) = f(1) = 1 + 1 = 2, and f(m) = f(4) = 4/2 = 2. Therefore f(m) = f(n), but m n. proves f is not injective. This 28

Example Prove or disprove: The function f : Z Z defined by f(n) = is surjective. n + 1 if n is odd n/2 if n is even 29

Example Prove or disprove: The function f : Z Z defined by f(n) = is surjective. n + 1 if n is odd n/2 if n is even f is surjective. Proof: We want to show that for all m Z (codomain), there exists n Z (domain) such that f(n) = m. Assume m Z. Let n = 2m. Then, n is an even integer. Therefore, f(n) = n/2 = 2m/2 = m. 30

This proves there exists an integer n, namely n = 2m, such that f(n) = m. Therefore, f is surjective. Note that if n is odd, then f(n) = n + 1 is even. So if m is an even number in the codomain, then there are both even and odd values of n that map to m. Either n = 2m (even) as above, or n = m 1 (odd), which gives f(n) = n + 1 = (m 1) + 1 = m. Since the former choice works even in the case when m is odd, there was no need to consider the latter choice for n.

Bijection A function f : A B is said to be a bijection, or one-to-one correspondence if f is both one-to-one and onto. Examples f : Z Z defined by f(n) = n + 1 f : R R defined by f(x) = 2x f : Z + Z + defined by f(n) = { n + 1 if n is odd n 1 if n is even 31

Bijection Example: Prove that f : R + (0, 1), defined by is a bijection. f(x) = 1 1 + x 32

Proof: We want to show that f is one-toone (injective) and onto (surjective). Step 1. (f is one-to-one.) For all x 1, x 2 R + we have f(x 1 ) = f(x 2 ) iff 1 = 1 1 + x 1 1 + x 2 iff 1 + x 1 = 1 + x 2 iff x 1 = x 2 In particular, f(x 1 ) = f(x 2 ) implies x 1 = x 2 for all x 1, x 2 R +, which proves that f is one-to-one. Step 2. (f is onto.) Let y = 1 1+x. Solving for x in terms of y we obtain x = 1 y 1.

Note that if 0 < y < 1, then x = 1 y 1 > 1 1 1 = 0. Therefore, for all y (0, 1), there exists x R +, namely x = 1 y 1, such that f(x) = 1 1 + x = 1 1 + ( 1 y 1) = 1 1 y = y This proves f is onto. Therefore, f is a bijection.

Image and Preimage If f : A B and S A, then the image of S under f is the set f(s) = {b B b = f(s) for some s S} If T B, then the preimage of T is the set f 1 (T ) = {a A f(a) T } 33

Image and Preimage Example: defined by f(x) = x 2. Consider the function f : R R codomain of f: range of f: If S = [ 2, 3), then f(s) = If T = ( 1, 4], then f 1 (T ) = 34

Image and Preimage Example: defined by f(x) = x 2. Consider the function f : R R codomain of f: R range of f: [0, ) If S = [ 2, 3), then f(s) = [0, 9) If T = ( 1, 4], then f 1 (T ) = [ 2, 2] 35

Image and Preimage Example: Consider the function f : R R defined by f(x) = x 2. (a) Let S = [ 2, 3). Find f(s). 36

(b) Let T = ( 1, 4]. Find f 1 (T ).

Image and Preimage Let f : A B, where A and B are nonempty sets. Prove that if S 1, S 2 A, then f(s 1 S 2 ) = f(s 1 ) f(s 2 ). 37

Proof: First assume y f(s 1 S 2 ). Then, there exists an element s S 1 S 2 such that y = f(s). Therefore y = f(s) for some s S 1, or y = f(s) for some s S 2. That is, y f(s 1 ) or y f(s 2 ). Therefore, y f(s 1 ) f(s 2 ). This proves f(s 1 S 2 ) f(s 1 ) f(s 2 ). Conversely, assume y f(s 1 ) f(s 2 ). Then, y f(s 1 ) or y f(s 2 ). Therefore, y = f(s) for some s S 1, or y = f(s) for some s S 2. Therefore, there exists s S 1 S 2 such that y = f(s). This proves f(s 1 ) f(s 2 ) f(s 1 S 2 ). Therefore, f(s 1 ) f(s 2 ) = f(s 1 S 2 ). 38

Image and Preimage Let f : A B, where A and B are nonempty sets. Prove that if T 1, T 2 B, then f 1 (T 1 T 2 ) = f 1 (T 1 ) f 1 (T 2 ) 39

Proof: For all a A, we have a f 1 (T 1 T 2 ) iff f(a) T 1 T 2 iff f(a) T 1 and f(a) T 2 iff a f 1 (T 1 ) and a f 1 (T 2 ) iff a f 1 (T 1 ) f 1 (T 2 ). Therefore, f 1 (T 1 T 2 ) = f 1 (T 1 ) f 1 (T 2 ). 40

Identity Function Let A be a set. The identity function on A is the function i A : A A defined by i A (x) = x for all x A. That is, i A = {(x, x) x A}. The identity function i A is one-to-one and onto, so it is a bijection. 41

Inverse Function Let f : A B be a bijection. The inverse function of f, denoted by f 1, is the function that assigns to an element b B the unique element a A such that f(a) = b. That is, f 1 (b) = a if and only if f(a) = b If f has an inverse function, we say that f is invertible. Note that we use the notation f 1 (T ) to denote the preimage of a set T B, even when f is not invertible. 42

Examples Let A = {1, 2, 3, 4}, B = {a, b, c}, C = {α, β, γ}. Determine if each function invertible. If so, find f 1. 1. f : B C defined by f(a) = β f(b) = γ f(c) = α 2. f : A B defined by f(1) = a f(2) = b f(3) = a f(4) = b 43

Example Determine if each function invertible. If so, find f 1. 1. f : Z Z defined by f(n) = n + 1 2. f : R R defined by f(x) = 2x + 3 3. f : R R defined by f(x) = x 2 44