Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Transformation - Discrete Mathematics - Lecture Slides, Slides of Discrete Mathematics

During the study of discrete mathematics, I found this course very informative and applicable.The main points in these lecture slides are:Transformation, Mapping, Unique Element, Function and Relation, Unique Ordered Pair, Domain and Range, Set of Positive Integers, Perfect Squares, Programming Languages, Domain of Floor Function, Real-Valued Functions

Typology: Slides

2012/2013

Uploaded on 04/27/2013

atasi
atasi 🇮🇳

4.6

(32)

136 documents

1 / 22

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSE115/ENGR160 Discrete Mathematics
02/17/11
1
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16

Partial preview of the text

Download Transformation - Discrete Mathematics - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

CSE115/ENGR160 Discrete Mathematics 02/17/

2.3 Functions

  • Assign each element of a set to a particular element of a second set

Function and relation

  • f:A→B can be defined in terms of a relation from A to B
  • Recall a relation from A to B is just a subset of A x B
  • A relation from A to B that contains one, and only one, ordered pair (a,b) for every element a ∈ A, defines a function f from A to B
  • f(a)=b where (a,b) is the unique ordered pair in the relation

Domain and range

  • If f is a function from A to B
    • A is the domain of f
    • B is the codomain of f
    • f(a)=b, b is the image of a and a is preimage of b
    • Range of f: set of all images of element of A
    • f maps A to B

Example

  • G: function that assigns a grade to a student, e.g., G(Adams)=A
  • Domain of G: {Adams, Chou, Goodfriend, Rodriguez, Stevens}
  • Codomain of G: {A, B, C, D, F}
  • Range of G is: {A, B, C, F}

Example

  • Let R be the relation consisting of (Abdul, 22), (Brenda, 24), (Carla, 21), (Desire, 22), (Eddie,
    1. and (Felicia, 22)
  • f: f(Abdul)=22, f(Brenda)=24, f(Carla)=21, f(Desire)=22, f(Eddie)=24, and f(Felicia)=
  • Domain: {Abdul, Brenda, Carla, Desire, Eddie, Felicia}
  • Codomain: set of positive integers
  • Range: {21, 22, 24}

Example

  • f: Z → Z, assigns the square of an integer to its integer, f(x)=x 2
  • Domain: the set of all integers
  • Codomain: set of all integers
  • Range: all integers that are perfect squares, i.e., {0, 1, 4, 9, …}

Example

  • In programming languages
    • int floor(float x){…} The domain of floor function is the set of real numbers and its codomain is the set of integers

Example

  • f 1 (x) =x 2 and f 2 (x)= x-x 2
    • (f 1 +f 2 )(x)= f 1 (x) +f 2 (x)= x 2 + x-x 2 =x
    • (f 1 f 2 )(x)= f 1 (x) f 2 (x)= x 2 (x-x 2 )=x 3 -x 4

Function and subset

  • When f is a function from A to B (f:A→B), the image of a subset of A can also be defined
  • Let S be a subset of A, the image of S under function f is the subset of B that consists of the images of the elements of S
  • Denote the image of S by f(S)
  • f(S) denotes a set, not the value of function f 14

or{ ( )| }as shorthand

( ) { | ( ( ))} f s s S

f S t s S t f s

= ∃ ∈ =

Example

  • f maps {a,b,c,d} to {1,2,3,4,5} with f(a)=4, f(b)=5, f(c)=1, f(d)=
  • Is f an one-to-one function?

Example

  • Let f(x)=x 2 , from the set of integers to the set of integers. Is it one-to-one?
  • f(1)=1, f(-1)=1, f(1)=f(-1) but 1≠-
  • However, f(x)=x 2 is one-to-one for Z +
  • Determine f(x)=x+1 from real numbers to itself is one-to-one or not
  • It is one-to-one. To show this, note that x+1 ≠ y+1 when x≠y

Onto functions

  • Onto : A function from A to B is onto or surjective , if and only if for every element b ∈ B there is an element a ∈ A with f(a)=b
  • Every element of B is the image of some element in A

19

yx ( f ( x ) = y ),where x isin thedomain and y is the codomain

f maps from {a, b, c, d} to {1, 2, 3}, is f onto?

Example

  • Is f(x)=x 2 from the set of integers to the set of integers onto? - f(x)=-1?
  • Is f(x)=x+1 from the set of integers to the set of integers onto? - It is onto, as for each integer y there is an integer x such that f(x)=y - To see this, f(x)=y iff x+1=y, which holds if and only if x=y-