CS 441 Discrete Mathematics for CS Lecture 9. Functions II. CS 441 Discrete mathematics for CS. Functions

Similar documents
Cartesian Products and Relations

1 The Concept of a Mapping

Practice with Proofs

INTRODUCTORY SET THEORY

Cardinality. The set of all finite strings over the alphabet of lowercase letters is countable. The set of real numbers R is an uncountable set.

Lecture 16 : Relations and Functions DRAFT

You know from calculus that functions play a fundamental role in mathematics.

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

Geometric Transformations

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

GRE Prep: Precalculus

Chapter 7. Functions and onto. 7.1 Functions

Section 2.7 One-to-One Functions and Their Inverses

Lecture Notes on Topology for MAT3500/4500 following J. R. Munkres textbook. John Rognes

6.2 Permutations continued

( ) which must be a vector

Lecture Notes on Discrete Mathematics

Fixed Point Theorems in Topology and Geometry

BANACH AND HILBERT SPACE REVIEW

Basic Concepts of Point Set Topology Notes for OU course Math 4853 Spring 2011

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

Mathematics Review for MS Finance Students

1 if 1 x 0 1 if 0 x 1

Groups in Cryptography

1. Prove that the empty set is a subset of every set.

To define function and introduce operations on the set of functions. To investigate which of the field properties hold in the set of functions

Introduction to Theory of Computation

Lecture 13 - Basic Number Theory.

Mathematics Course 111: Algebra I Part IV: Vector Spaces

MA651 Topology. Lecture 6. Separation Axioms.

Functions CHAPTER 2. Introduction. 2.1 Some Basic Terminology. Terminology for Sets

Introduction to Topology

Discrete Mathematics. Hans Cuypers. October 11, 2007

Chapter 7. Permutation Groups

Metric Spaces. Chapter 1

Math 223 Abstract Algebra Lecture Notes

MA4001 Engineering Mathematics 1 Lecture 10 Limits and Continuity

T ( a i x i ) = a i T (x i ).

TOPIC 4: DERIVATIVES

We can express this in decimal notation (in contrast to the underline notation we have been using) as follows: b + 90c = c + 10b

Abstract Algebra Theory and Applications. Thomas W. Judson Stephen F. Austin State University

Elements of Abstract Group Theory

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

Chapter 7. Homotopy. 7.1 Basic concepts of homotopy. Example: z dz. z dz = but

4: EIGENVALUES, EIGENVECTORS, DIAGONALIZATION

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.436J/15.085J Fall 2008 Lecture 5 9/17/2008 RANDOM VARIABLES

Inverse Functions and Logarithms

Homework # 3 Solutions

Mathematical Methods of Engineering Analysis

Handout #1: Mathematical Reasoning

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

CS 103X: Discrete Structures Homework Assignment 3 Solutions

Continuity. DEFINITION 1: A function f is continuous at a number a if. lim

Metric Spaces Joseph Muscat 2003 (Last revised May 2009)

Introduction to Modern Algebra

THE BANACH CONTRACTION PRINCIPLE. Contents

Department of Mathematics, Indian Institute of Technology, Kharagpur Assignment 2-3, Probability and Statistics, March Due:-March 25, 2015.

P. Jeyanthi and N. Angel Benseera

Today s Topics. Primes & Greatest Common Divisors

Basic Concepts of Set Theory, Functions and Relations

Chapter 13: Basic ring theory

This chapter is all about cardinality of sets. At first this looks like a

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

Comments on Quotient Spaces and Quotient Maps

Chapter 3. Distribution Problems. 3.1 The idea of a distribution The twenty-fold way

Chapter 4 Lecture Notes

3. Prime and maximal ideals Definitions and Examples.

MATH 4330/5330, Fourier Analysis Section 11, The Discrete Fourier Transform

Linear Maps. Isaiah Lankham, Bruno Nachtergaele, Anne Schilling (February 5, 2007)

INTRODUCTION TO TOPOLOGY

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

MATH 304 Linear Algebra Lecture 9: Subspaces of vector spaces (continued). Span. Spanning set.

ALGEBRA REVIEW LEARNING SKILLS CENTER. Exponents & Radicals

The Mean Value Theorem

7 Relations and Functions

k, then n = p2α 1 1 pα k

RIGIDITY OF HOLOMORPHIC MAPS BETWEEN FIBER SPACES

GROUPS ACTING ON A SET

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

Solutions to TOPICS IN ALGEBRA I.N. HERSTEIN. Part II: Group Theory

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Basic Proof Techniques

1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal:

How To Understand The Theory Of Hyperreals

Discrete Mathematics Problems

HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)!

MATH PROBLEMS, WITH SOLUTIONS

Notes on Algebraic Structures. Peter J. Cameron

Cubes and Cube Roots

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

Matrix Representations of Linear Transformations and Changes of Coordinates

(Q, ), (R, ), (C, ), where the star means without 0, (Q +, ), (R +, ), where the plus-sign means just positive numbers, and (U, ),

3. Mathematical Induction

NOTES ON LINEAR TRANSFORMATIONS

CONTINUED FRACTIONS AND PELL S EQUATION. Contents 1. Continued Fractions 1 2. Solution to Pell s Equation 9 References 12

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

S on n elements. A good way to think about permutations is the following. Consider the A = 1,2,3, 4 whose elements we permute with the P =

Note on some explicit formulae for twin prime counting function

Proseminar on Semantic Theory Fall 2013 Ling 720. Problem Set on the Formal Preliminaries : Answers and Notes

Calculus. Contents. Paul Sutcliffe. Office: CM212a.

Transcription:

CS 441 Discrete Mathematics for CS Lecture 9 Functions II Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Functions Definition: Let and B be two sets. function from to B, denoted f : B, is an assignment of exactly one element of B to each element of. We write f(a) = b to denote the assignment of b to an element a of by the function f. f: B B 1

Functions Definition: Let and B be two sets. function from to B, denoted f : B, is an assignment of exactly one element of B to each element of. We write f(a) = b to denote the assignment of b to an element a of by the function f. f: B B Not allowed!!! Injective function Definition: function f is said to be one-to-one, or injective, if and only if f(x) = f(y) implies x = y for all x, y in the domain of f. function is said to be an injection if it is one-to-one. lternative: function is one-to-one if and only if f(x) f(y), whenever x y. This is the contrapositive of the definition. f: B B f: B B Not injective function Injective function 2

Surjective function Definition: function f from to B is called onto, or surjective, if and only if for every b B there is an element a such that f(a) = b. lternative: all co-domain elements are covered f: B B Bijective functions Definition: function f is called a bijection if it is both one-toone (injection) and onto (surjection). f: B B 3

Bijective functions Example 1: Let = {1,2,3} and B = {a,b,c} Define f as 1 c 2 a 3 b Is f a bijection?? Bijective functions Example 1: Let = {1,2,3} and B = {a,b,c} Define f as 1 c 2 a 3 b Is f a bijection? Yes. It is both one-to-one and onto. 4

Bijective functions Example 2: Define g : W W (whole numbers), where g(n) = n/2 (floor function). 0 0/2 = 0 = 0 1 1/2 = 1/2 = 0 2 2/2 = 1 = 1 3 3/2 = 3/2 = 1... Is g a bijection? Bijective functions Example 2: Define g : W W (whole numbers), where g(n) = n/2 (floor function). 0 0/2 = 0 = 0 1 1/2 = 1/2 = 0 2 2/2 = 1 = 1 3 3/2 = 3/2 = 1... Is g a bijection? No. g is onto but not 1-1 (g(0) = g(1) = 0 however 0 1. 5

Bijective functions Theorem: Let f be a function f: from a set to itself, where is finite. Then f is one-to-one if and only if f is onto. ssume is finite and f is one-to-one (injective) Is f an onto function (surjection)? Bijective functions Theorem: Let f be a function f: from a set to itself, where is finite. Then f is one-to-one if and only if f is onto. Proof: is finite and f is one-to-one (injective) Is f an onto function (surjection)? Yes. Every element points to exactly one element. Injection assures they are different. So we have different elements points to. Since f: the co-domain is covered thus the function is also a surjection (and a bijection) is finite and f is an onto function Is the function one-to-one? 6

Bijective functions Theorem: Let f be a function f: from a set to itself, where is finite. Then f is one-to-one if and only if f is onto. Proof: is finite and f is one-to-one (injective) Is f an onto function (surjection)? Yes. Every element points to exactly one element. Injection assures they are different. So we have different elements points to. Since f: the co-domain is covered thus the function is also a surjection (and a bijection) is finite and f is an onto function Is the function one-to-one? Yes. Every element maps to exactly one element and all elements in are covered. Thus the mapping must be one-toone Bijective functions Theorem. Let f be a function from a set to itself, where is finite. Then f is one-to-one if and only if f is onto. Please note the above is not true when is an infinite set. Example: f: Z Z, where f(z) = 2 * z. f is one-to-one but not onto. 1 2 2 4 3 6 3 has no pre-image. 7

Functions on real numbers Definition: Let f1 and f2 be functions from to R (reals). Then f1 + f2 and f1 * f2 are also functions from to R defined by (f1 + f2)(x) = f1(x) + f2(x) (f1 * f2)(x) = f1(x) * f2(x). Examples: ssume f1(x) = x - 1 f2(x) = x 3 + 1 then (f1 + f2)(x) = x 3 + x (f1 * f2)(x) = x 4 -x 3 + x - 1. Increasing and decreasing functions Definition: function f whose domain and codomain are subsets of real numbers is strictly increasing if f(x) > f(y) whenever x > y and x and y are in the domain of f. Similarly, f is called strictly decreasing if f(x) < f(y) whenever x > y and x and y are in the domain of f. Example: Let g : R R, where g(x) = 2x - 1. Is it increasing? 8

Increasing and decreasing functions Definition: function f whose domain and codomain are subsets of real numbers is strictly increasing if f(x) > f(y) whenever x > y and x and y are in the domain of f. Similarly, f is called strictly decreasing if f(x) < f(y) whenever x > y and x and y are in the domain of f. Example: Let g : R R, where g(x) = 2x - 1. Is it increasing? Proof. For x>y holds 2x > 2y and subsequently 2x-1 > 2y-1 Thus g is strictly increasing. Increasing and decreasing functions Definition: function f whose domain and codomain are subsets of real numbers is strictly increasing if f(x) > f(y) whenever x > y and x and y are in the domain of f. Similarly, f is called strictly decreasing if f(x) < f(y) whenever x > y and x and y are in the domain of f. Note: Strictly increasing and strictly decreasing functions are oneto-one. Why? 9

Increasing and decreasing functions Definition: function f whose domain and codomain are subsets of real numbers is strictly increasing if f(x) > f(y) whenever x > y and x and y are in the domain of f. Similarly, f is called strictly decreasing if f(x) < f(y) whenever x > y and x and y are in the domain of f. Note: Strictly increasing and strictly decreasing functions are oneto-one. Why? One-to-one function: function is one-to-one if and only if f(x) f(y), whenever x y. Identity function Definition: Let be a set. The identity function on is the function i : where i (x) = x. Example: Let = {1,2,3} Then: i (1) =? 10

Identity function Definition: Let be a set. The identity function on is the function i : where i (x) = x. Example: Let = {1,2,3} Then: i (1) = 1 i (2) = 2 i (3) = 3. Bijective functions Definition: function f is called a bijection if it is both one-toone and onto. f: B B 11

Inverse functions Definition: Let f be a bijection from set to set B. The inverse function of f is the function that assigns to an element b from B the unique element a in such that f(a) = b. The inverse function of f is denoted by f -1. Hence, f -1 (b) = a, when f(a) = b. If the inverse function of f exists, f is called invertible. f: B B f -1 : B B f is bijective Inverse of f Inverse functions Note: if f is not a bijection then it is not possible to define the inverse function of f. Why? ssume f is not one-to-one:? f: B B f -1 : B B f Inverse 12

Inverse functions Note: if f is not a bijection then it is not possible to define the inverse function of f. Why? ssume f is not one-to-one: Inverse is not a function. One element of B is mapped to two different elements. f: B B f -1 : B B f Inverse Inverse functions Note: if f is not a bijection then it is not possible to define the inverse function of f. Why? ssume f is not onto:? f: B B f -1 : B B f Inverse 13

Inverse functions Note: if f is not a bijection then it is not possible to define the inverse function of f. Why? ssume f is not onto: Inverse is not a function. One element of B is not assigned any value in B. f: B B f -1 : B B f Inverse Inverse functions Example 1: Let = {1,2,3} and i be the identity function i (1) = 1 i -1 (1) = 1 i (2) = 2 i -1 (2) = 2 i (3) = 3 i -1 (3) = 3 Therefore, the inverse function of i is i. 14

Inverse functions Example 2: Let g : R R, where g(x) = 2x - 1. What is the inverse function g -1? Inverse functions Example 2: Let g : R R, where g(x) = 2x - 1. What is the inverse function g -1? pproach to determine the inverse: y = 2x - 1 => y + 1 = 2x => (y+1)/2 = x Define g -1 (y) = x= (y+1)/2 Test the correctness of inverse: g(3) =.. 15

Inverse functions Example 2: Let g : R R, where g(x) = 2x - 1. What is the inverse function g -1? pproach to determine the inverse: y = 2x - 1 => y + 1 = 2x => (y+1)/2 = x Define g -1 (y) = x= (y+1)/2 Test the correctness of inverse: g(3) = 2*3-1 = 5 g -1 (5) = Inverse functions Example 2: Let g : R R, where g(x) = 2x - 1. What is the inverse function g -1? pproach to determine the inverse: y = 2x - 1 => y + 1 = 2x => (y+1)/2 = x Define g -1 (y) = x= (y+1)/2 Test the correctness of inverse: g(3) = 2*3-1 = 5 g -1 (5) = (5+1)/2 = 3 g(10) = 16

Inverse functions Example 2: Let g : R R, where g(x) = 2x - 1. What is the inverse function g -1? pproach to determine the inverse: y = 2x - 1 => y + 1 = 2x => (y+1)/2 = x Define g -1 (y) = x= (y+1)/2 Test the correctness of inverse: g(3) = 2*3-1 = 5 g -1 (5) = (5+1)/2 = 3 g(10) = 2*10-1 = 19 g -1 (19) = Inverse functions Example 2: Let g : R R, where g(x) = 2x - 1. What is the inverse function g -1? pproach to determine the inverse: y = 2x - 1 => y + 1 = 2x => (y+1)/2 = x Define g -1 (y) = x= (y+1)/2 Test the correctness of inverse: g(3) = 2*3-1 = 5 g -1 (5) = (5+1)/2 = 3 g(10) = 2*10-1 = 19 g -1 (19) = (19+1)/2 = 10. 17

Composition of functions Definition: Let f be a function from set to set B and let g be a function from set B to set C. The composition of the functions g and f, denoted by g f is defined by (g f)(a) = g(f(a)). f: B B g: B C C Composition of functions Example 1: Let = {1,2,3} and B = {a,b,c,d} g :, f: B 1 3 1 b 2 1 2 a 3 2 3 d f g : B: 1 18

Composition of functions Example 1: Let = {1,2,3} and B = {a,b,c,d} g :, f: B 1 3 1 b 2 1 2 a 3 2 3 d f g : B: 1 d 2 Composition of functions Example 1: Let = {1,2,3} and B = {a,b,c,d} g :, f: B 1 3 1 b 2 1 2 a 3 2 3 d f g : B: 1 d 2 b 3 19

Composition of functions Example 1: Let = {1,2,3} and B = {a,b,c,d} g :, f: B 1 3 1 b 2 1 2 a 3 2 3 d f g : B: 1 d 2 b 3 a Composition of functions Example 2: Let f and g be two functions from Z to Z, where f(x) = 2x and g(x) = x 2. f g : Z Z (f g)(x) = f(g(x)) = f( x 2 ) = 2(x 2 ) g f : Z Z (g f)(x) =? 20

Composition of functions Example 2: Let f and g be two functions from Z to Z, where f(x) = 2x and g(x) = x 2. f g : Z Z (f g)(x) = f(g(x)) = f( x 2 ) = 2(x 2 ) g f : Z Z (g f)(x) = g(f(x)) = g(2x) = (2x) 2 = 4x 2 Note that the order of the function composition matters Composition of functions Example 3: (f f -1 )(x) = x and (f -1 f)(x) = x, for all x. Let f : R R, where f(x) = 2x 1 and f -1 (x) = (x+1)/2. (f f -1 )(x)= f(f -1 (x)) = f( (x+1)/2 ) = 2( (x+1)/2 ) - 1 = (x+1) - 1 = x 21

Composition of functions Example 3: (f f -1 )(x) = x and (f -1 f)(x) = x, for all x. Let f : R R, where f(x) = 2x 1 and f -1 (x) = (x+1)/2. (f f -1 )(x)= f(f -1 (x)) = f( (x+1)/2 ) = 2( (x+1)/2 ) - 1 = (x+1) - 1 = x (f -1 f)(x) = f -1 (f(x)) = f -1 ( 2x - 1 ) = (2x)/2 = x Some functions Definitions: The floor function assigns a real number x the largest integer that is less than or equal to x. The floor function is denoted by x. The ceiling function assigns to the real number x the smallest integer that is greater than or equal to x. The ceiling function is denoted by x. Other important functions: Factorials: n! = n(n-1) such that 1! = 1 22