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 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.
Prof. Shachar Lovett Clicker frequency: CA CSE 20 Discrete math 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.
Functions, Pigeonhole Principle Lecture 14: Nov 4 A B f( ) =
Functions Section 2.3 of Rosen Fall 2008
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.
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.
Functions f( ) = A B Lecture 15: Nov 4.
1 Section 1.8 Functions. 2 Loose Definition Mapping of each element of one set onto some element of another set –each element of 1st set must map to something,
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Section 1.8: Functions A function is a mapping from one set to another that satisfies certain properties. We will first introduce the notion of a mapping.
Functions A B f( ) =. This Lecture We will define a function formally, and then in the next lecture we will use this concept in counting. We will also.
FUNCTION Discrete Mathematics Asst. Prof. Dr. Choopan Rattanapoka.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Mathematics. Session Set, Relation & Function Session - 3.
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.
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFunctions.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
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.
Functions Section 2.3 of Rosen Spring 2012 CSCE 235 Introduction to Discrete Structures Course web-page: cse.unl.edu/~cse235 Questions: Use Piazza.
1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,
Example Prove that: “IF 3n + 2 is odd, then n is odd” Proof by Contradiction: -p = 3n + 2 is odd, q = n is odd. -Assume that ~(p  q) is true OR -(p 
Chapter 9 Functions Let A and B be nonempty sets. A function f from A to B, written f: A  B is a relation from A to B with the property that every element.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
COMPSCI 102 Introduction to Discrete Mathematics.
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)
CSC102 - Discrete Structures Functions
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.
Functions CSRU1400 Spring 2008Ellen Zhang 1 CISC1400, Fall 2010 Ellen Zhang.
Discrete Mathematics Lecture # 19 Inverse of Functions.
DEFINITION A function f : A  B is onto B (called a surjection) iff Rng(f) = B. We write f : A  B to indicate that f is a surjection. Look at the illustration.
Discrete Structures Li Tak Sing( 李德成 ) Lectures
CMSC250 S ECTIONS 0303 & 0304 M IDTERM R EVIEW Sri Kankanahalli Discussion 10: 9 March 2016 Office Hrs: Mon. and Wed. 4-6PM AVW 1112.
1 Lecture 5 Functions. 2 Functions in real applications Curve of a bridge can be described by a function Converting Celsius to Fahrenheit.
FUNCTIONS.
Discrete Mathematics Functions
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
CSE 20 – Discrete Mathematics
S1: Prove that: Venn Diagram “Proof” Direct Proof A  (A  B) = A
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Functions Section 2.3.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE15 Discrete Mathematics 02/27/17
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Functions.
Ch 5 Functions Chapter 5: Functions
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
Functions Section 2.3.
Presentation transcript:

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

Today’s Topics: 1. Functions 2. Properties of functions 3. Inverse 2

1. Functions 3

Definition of a function 4

What is a function?  Is the following a function from X to Y? A. Yes B. No 5 XY

What is a function?  Is the following a function from X to Y? A. Yes B. No 6 XY

What is a function?  Is the following a function from X to Y? A. Yes B. No 7 XY

What is a function?  Is the following a function from X to Y? A. Yes B. No 8 X Y

What is a function?  Is the following a function from Y to X? A. Yes B. No 9 X Y

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 10

Properties of functions Injective, surjective, bijective 11

Injective, Surjective, Bijective…  Function f:X  Y  f is injective if: f(x)=f(y)  x=y  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 12

Injective, Surjective, Bijective…  Is the following function A. Injective B. Surjective C. Bijective D. None 13 XY

Injective, Surjective, Bijective…  Is the following function A. Injective B. Surjective C. Bijective D. None 14 XY

Injective, Surjective, Bijective…  Is the following function A. Injective B. Surjective C. Bijective D. None 15 XY

Injective, Surjective, Bijective…  Which of the following functions f:N  N is not injective A. f(x)=x B. f(x)=x 2 C. f(x)=x+1 D. f(x)=2x E. None/other/more than one 16

Injective, Surjective, Bijective…  Which of the following functions f:N  N is not surjective A. f(x)=x B. f(x)=x 2 C. f(x)=x+1 D. f(x)=2x E. None/other/more than one 17

Inverses 18

Inverse functions 19

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

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

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

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 23

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 x 1,x 2  X such that f(x 1 )=f(x 2 ).  Then g(f(x 1 ))=g(f(x 2 )).  But since f,g are inverses, g(f(x 1 ))=x 1 and g(f(x 2 ))=x 2.  So x 1 =x 2.  Contradiction. Hence, f is injective. QED 24

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. 25