CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett

Slides:



Advertisements
Similar presentations
Functions Reading: Epp Chp 7.1, 7.2, 7.4
Advertisements

CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Terminology Domain: set which holds the values to which we apply the function Co-domain: set which holds the possible values (results) of the function.
Lecture 3 Set Operations & Set Functions. Recap Set: unordered collection of objects Equal sets have the same elements Subset: elements in A are also.
Terminology Domain: set which holds the values to which we apply the function Co-domain: set which holds the possible values (results) of the function.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
1 CMSC 250 Chapter 7, Functions. 2 CMSC 250 Function terminology l A relationship between elements of two sets such that no element of the first set is.
February 12, 2015Applied Discrete Mathematics Week 2: Functions and Sequences 1Exercises Question 1: Given a set A = {x, y, z} and a set B = {1, 2, 3,
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Mathematics for Computing Lecture 8: Functions Dr Andrew Purkiss-Trew Cancer Research UK
1 Annoucement n Skills you need: (1) (In Thinking) You think and move by Logic Definitions Mathematical properties (Basic algebra etc.) (2) (In Exploration)
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,
Chapter 1 SETS, FUNCTIONs, ELEMENTARY LOGIC & BOOLEAN ALGEBRAs BY: MISS FARAH ADIBAH ADNAN IMK.
CSE 2353 – October 1 st 2003 Functions. For Real Numbers F: R->R –f(x) = 7x + 5 –f(x) = sin(x)
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Discrete Mathematics CS 2610 February 10, Agenda Previously Functions And now Finish functions Start Boolean algebras (Sec. 11.1)
1 Functions CS 202 Epp section ??? Aaron Bloomfield.
FUNCTIONS COSC-1321 Discrete Structures 1. Function. Definition Let X and Y be sets. A function f from X to Y is a relation from X to Y with the property.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Functions CSRU1400 Spring 2008Ellen Zhang 1 CISC1400, Fall 2010 Ellen Zhang.
Discrete Mathematics Functions
Functions 7/7/2016COCS - Discrete Structures1. Functions A function f from a set A to a set B is an assignment of exactly one element of B to each element.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Russell’s Paradox Is W in W? In words, W is the set that contains all the sets that don’t contain themselves. If W is in W, then W contains itself. But.
Functions Goals Introduce the concept of function
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Functions 1.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Applied Discrete Mathematics Week 2: Functions and Sequences
Properties of Functions
CSE 20 – Discrete Mathematics
Functions.
Chapter 2 Sets and Functions.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
S1: Prove that: Venn Diagram “Proof” Direct Proof A  (A  B) = A
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Functions Section 2.3.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Discrete Structures for Computer Science
CSE15 Discrete Mathematics 02/27/17
Functions CS 202 Epp section 7.1.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Functions.
Introduction to Relations and Functions
Ch 5 Functions Chapter 5: Functions
CPSC 121: Models of Computation 2016W2
Lecture # 18 Types of Functions
CPSC 121: Models of Computation
Functions Section 2.3.
REVISION Relation. REVISION Relation Introduction to Relations and Functions.
Presentation transcript:

CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett

Today’s Topics: Functions Properties of functions Inverse

1. Functions

Definition of a function A function 𝑓:𝑋→𝑌 is a mapping that maps each element of X to an element of Y Each element of X is mapped to exactly one element of Y Not two Not none Exactly one!

What is a function? Is the following a function from X to Y? Yes No X

What is a function? Is the following a function from X to Y? Yes No X

What is a function? Is the following a function from X to Y? Yes No X

What is a function? Is the following a function from X to Y? Yes Y No

What is a function? Is the following a function from Y to X? Yes Y No

What is a function A function f:XY maps any element of X to an element of Y Every element of X is mapped – f(x) is always defined Every element of X is mapped to just one value in Y

Properties of functions Injective, surjective, bijective

Injective, Surjective, Bijective… Function f:X  Y f is injective if: f(x1)=f(x2)  x1=x2 That is, no two elements in X are mapped to the same value f is surjective if: yY xX s.t. f(x)=y There is always an “pre-image” Could be more than one x! f is bijective if it is both injective and surjective

Injective, Surjective, Bijective… Is the following function Injective Surjective Bijective None X Y

Injective, Surjective, Bijective… Is the following function Injective Surjective Bijective None X Y

Injective, Surjective, Bijective… Is the following function Injective Surjective Bijective None X Y

Injective, Surjective, Bijective… Which of the following functions f:NN is not injective f(x)=x f(x)=x2 f(x)=x+1 f(x)=2x None/other/more than one

Injective, Surjective, Bijective… Which of the following functions f:NN is not surjective f(x)=x f(x)=x2 f(x)=x+1 f(x)=2x None/other/more than one

Inverses

Inverse functions Functions 𝑓:𝑋→𝑌 and 𝑔:𝑌→𝑋 are inverses if ∀𝑥∈𝑋, 𝑔 𝑓 𝑥 =𝑥 ∀𝑦∈𝑌, 𝑓 𝑔 𝑦 =𝑦 In this case we write 𝑔= 𝑓 −1 (and also 𝑓= 𝑔 −1 )

Inverse functions Does the following function have an inverse: f:R  R, f(x)=2x Yes No

Inverse functions Does the following function have an inverse: f:Z  Z, f(x)=2x Yes No

Inverse functions Does the following function have an inverse: f:{1,2}  {1,2,3,4}, f(x)=2x Yes No

Functions with an inverse are surjective Let f:XY, g:YX be inverse functions Theorem: f is surjective Proof (by contradiction): Assume not. That is, there is yY such that for any xX, f(x)y. Let x’=g(y). Then, x’X and f(x’)=y. Contradiction. Hence, f is surjective. QED

Functions with an inverse are injective Let f:XY, g:YX be inverse functions Theorem: f is injective Proof (by contradiction): Assume not. That is, there are distinct x1,x2X such that f(x1)=f(x2). Then g(f(x1))=g(f(x2)). But since f,g are inverses, g(f(x1))=x1 and g(f(x2))=x2. So x1=x2. Contradiction. Hence, f is injective. QED

Functions with an inverse are bijective Let f:XY, g:YX be inverse functions We just showed that f must be both surjective and injective Hence, bijective It turns out that the opposite is also true – any bijective function has an inverse. We might prove it later.