Functions Rosen 6th ed., §2.3.

Slides:



Advertisements
Similar presentations
1.6 Functions. Chapter 1, section 6 Functions notation: f: A B x in A, y in B, f(x) = y. concepts: –domain of f, –codomain of f, –range of f, –f maps.
Advertisements

Functions Section 2.3 of Rosen Fall 2008
Lecture 3 Set Operations & Set Functions. Recap Set: unordered collection of objects Equal sets have the same elements Subset: elements in A are also.
CSE115/ENGR160 Discrete Mathematics 02/16/12 Ming-Hsuan Yang UC Merced 1.
Functions Goals Introduce the concept of function Introduce injective, surjective, & bijective functions.
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,
Functions.
Functions. Let A and B be sets A function is a mapping from elements of A to elements of B and is a subset of AxB i.e. can be defined by a set of tuples!
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.
2.1 Sets 2.2 Set Operations 2.3 Functions ‒Functions ‒ Injections, Surjections and Bijections ‒ Inverse Functions ‒Composition 2.4 Sequences and Summations.
FUNCTION Discrete Mathematics Asst. Prof. Dr. Choopan Rattanapoka.
Functions. Copyright © Peter Cappello2 Definition Let D and C be nonempty sets. A function f from D to C, for each element d  D, assigns exactly 1 element.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
Fall 2002CMSC Discrete Structures1 … and the following mathematical appetizer is about… Functions.
10/26/20151 … and the following mathematical appetizer is about… Functions.
Discrete Mathematics CS 2610 September 12, Agenda Last class Functions  Vertical line rule  Ordered pairs  Graphical representation  Predicates.
4.1 CompSci 102© Michael Frank Today’s topics FunctionsFunctions – –Notations and terms – –One-to-One vs. Onto – –Floor, ceiling, and identity Reading:
Functions Section 2.3 of Rosen Spring 2012 CSCE 235 Introduction to Discrete Structures Course web-page: cse.unl.edu/~cse235 Questions: Use Piazza.
MSU/CSE 260 Fall Functions Read Section 1.8.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,
Functions1 Elementary Discrete Mathematics Jim Skon.
Chapter 1 SETS, FUNCTIONs, ELEMENTARY LOGIC & BOOLEAN ALGEBRAs BY: MISS FARAH ADIBAH ADNAN IMK.
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl Module #4.
1.4 Sets Definition 1. A set is a group of objects . The objects in a set are called the elements, or members, of the set. Example 2 The set of positive.
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 
강원대학교 컴퓨터과학전공 문양세 이산수학 (Discrete Mathematics)  함수 (Functions)
Basic Structures: Functions Muhammad Arief download dari
CSE 2353 – October 1 st 2003 Functions. For Real Numbers F: R->R –f(x) = 7x + 5 –f(x) = sin(x)
Functions. L62 Agenda Section 1.8: Functions Domain, co-domain, range Image, pre-image One-to-one, onto, bijective, inverse Functional composition and.
Basic Structures: Sets, Functions, Sequences, and Sums.
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.
1 Lecture 5 Functions. 2 Functions in real applications Curve of a bridge can be described by a function Converting Celsius to Fahrenheit.
Section 2.3. Section Summary  Definition of a Function. o Domain, Cdomain o Image, Preimage  One-to-one (Injection), onto (Surjection), Bijection 
FUNCTIONS.
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.
Functions Goals Introduce the concept of function
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Functions Section 2.3.
CS 2210:0001 Discrete Structures Sets and Functions
Applied Discrete Mathematics Week 2: Functions and Sequences
COT 3100, Spring 2001 Applications of Discrete Structures
Functions.
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
… and the following mathematical appetizer is about…
Functions.
Discrete Math for Computer Science CSC 281
Functions Section 2.3.
Discrete Math (2) Haiming Chen Associate Professor, PhD
Functions.
CSE15 Discrete Mathematics 02/27/17
Discrete Mathematics and its Applications
… and the following mathematical appetizer is about…
Functions CS 202 Epp section 7.1.
Rosen 5th ed., §1.8 ~44 slides, ~2 lectures
CS 220: Discrete Structures and their Applications
Functions.
Dept. of Mathematics 이산수학 Discrete Mathematics Dr. Chae, Gab-Byung
ICS 253: Discrete Structures I
… and the following mathematical appetizer is about…
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
Properties of Functions
Discrete Mathematics and its Applications
Functions Section 2.3.
Copyright © Zeph Grunschlag,
Discrete Mathematics and its Applications
Presentation transcript:

Functions Rosen 6th ed., §2.3

Definition of Functions Given any sets A, B, a function f from (or “mapping”) A to B (f:AB) is an assignment of exactly one element f(x)B to each element xA.

Graphical Representations Functions can be represented graphically in several ways: A B f • • f • • • • y • a b • • • • x A B Graph Plot Like Venn diagrams

Definition of Functions (cont’d) Formally: given f:AB “x is a function” : (x,y: x=y  f(x)  f(y)) or “x is a function” : ( x,y: (x=y)  (f(x)  f(y))) or “x is a function” : ( x,y: (x=y)  (f(x) = f(y))) or “x is a function” : ( x,y: (x=y)  (f(x) = f(y))) or “x is a function” : ( x,y: (f(x)  f(y))  (x  y))

Some Function Terminology If f:AB, and f(a)=b (where aA & bB), then: A is the domain of f. B is the codomain of f. b is the image of a under f. a is a pre-image of b under f. In general, b may have more than one pre-image. The range RB of f is {b | a f(a)=b }.

Range vs. Codomain - Example Suppose that: “f is a function mapping students in this class to the set of grades {A,B,C,D,E}.” At this point, you know f’s codomain is: __________, and its range is ________. Suppose the grades turn out all As and Bs. Then the range of f is _________, but its codomain is __________________. {A,B,C,D,E} unknown! {A,B} still {A,B,C,D,E}!

Function Addition/Multiplication We can add and multiply functions f,g:RR: (f  g):RR, where (f  g)(x) = f(x)  g(x) (f × g):RR, where (f × g)(x) = f(x) × g(x)

Function Composition For functions g:AB and f:BC, there is a special operator called compose (“○”). It composes (i.e., creates) a new function out of f,g by applying f to the result of g. (f○g):AC, where (f○g)(a) = f(g(a)). Note g(a)B, so f(g(a)) is defined and C. The range of g must be a subset of f’s domain!! Note that ○ (like Cartesian , but unlike +,,) is non-commuting. (In general, f○g  g○f.)

Function Composition

Images of Sets under Functions Given f:AB, and SA, The image of S under f is simply the set of all images (under f) of the elements of S. f(S) : {f(s) | sS} : {b |  sS: f(s)=b}. Note the range of f can be defined as simply the image (under f) of f’s domain!

One-to-One Functions May Be Larger A function is one-to-one (1-1), or injective, or an injection, iff every element of its range has only one pre-image. Only one element of the domain is mapped to any given one element of the range. Domain & range have same cardinality. What about codomain? May Be Larger

One-to-One Functions (cont’d) Formally: given f:AB “x is injective” : (x,y: xy  f(x)f(y)) or “x is injective” : ( x,y: (xy)  (f(x)f(y))) or “x is injective” : ( x,y: (xy)  (f(x)  f(y))) or “x is injective” : ( x,y: (xy)  (f(x)  f(y))) or “x is injective” : ( x,y: (f(x)=f(y))  (x =y))

One-to-One Illustration Graph representations of functions that are (or not) one-to-one: • • • • • • • • • • • • • • • • • • • • • • • • • • • Not one-to-one Not even a function! One-to-one

Sufficient Conditions for 1-1ness Definitions (for functions f over numbers): f is strictly (or monotonically) increasing iff x>y  f(x)>f(y) for all x,y in domain; f is strictly (or monotonically) decreasing iff x>y  f(x)<f(y) for all x,y in domain; If f is either strictly increasing or strictly decreasing, then f is one-to-one. e.g. f(x)=x3

Onto (Surjective) Functions A function f:AB is onto or surjective or a surjection iff its range is equal to its codomain (bB, aA: f(a)=b). An onto function maps the set A onto (over, covering) the entirety of the set B, not just over a piece of it. e.g., for domain & codomain R, x3 is onto, whereas x2 isn’t. (Why not?)

Illustration of Onto Some functions that are or are not onto their codomains: • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • Onto (but not 1-1) Not Onto (or 1-1) Both 1-1 and onto 1-1 but not onto

Bijections A function f is a one-to-one correspondence, or a bijection, or reversible, or invertible, iff it is both one-to-one and onto.

Inverse of a Function For bijections f:AB, there exists an inverse of f, written f 1:BA, which is the unique function such that:

Inverse of a function (cont’d)

The Identity Function For any domain A, the identity function I:AA (variously written, IA, 1, 1A) is the unique function such that aA: I(a)=a. Some identity functions you’ve seen: ing with T, ing with F, ing with , ing with U. Note that the identity function is both one-to-one and onto (bijective).

Identity Function Illustrations The identity function: • • • y • • • • • • x Domain and range

Graphs of Functions We can represent a function f:AB as a set of ordered pairs {(a,f(a)) | aA}. Note that a, there is only one pair (a, f(a)). For functions over numbers, we can represent an ordered pair (x,y) as a point on a plane. A function is then drawn as a curve (set of points) with only one y for each x.

Graphs of Functions

A Couple of Key Functions In discrete math, we frequently use the following functions over real numbers: x (“floor of x”) is the largest integer  x. x (“ceiling of x”) is the smallest integer  x.

Visualizing Floor & Ceiling Real numbers “fall to their floor” or “rise to their ceiling.” Note that if xZ, x   x & x   x Note that if xZ, x = x = x. 3 . 1.6=2 2 . 1.6 . 1 1.6=1 1.4= 1 . 1 . 1.4 . 2 1.4= 2 . . . 3 3 3=3= 3

Plots with floor/ceiling: Example Plot of graph of function f(x) = x/3: f(x) Set of points (x, f(x)) +2 3 x +3 2