Docsity

Functions - Elementary Discrete Math - Lecture Slides, Slides of Discrete Mathematics

Partial preview of the text

Download Functions - Elementary Discrete Math - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

Functions

Elementary Discrete Mathematics

Functions

  • Definition: A function consists of three things:
    1. A non empty set A, called the domain of the function
    2. A non empty set B, called the codomain of the function
    3. A rule that assigns to each element of A one and only one , element of B

Function Notations

  • If ƒ :A → B, and a ∈ A and b ∈ B, and a is assigned to b by the function ƒ , then we say ƒ ( a ) = b
  • If ƒ ( a ) = b , then the element ƒ ( a ) or b is called the value of ƒ at a , or the image of a under the function ƒ.

a f(a)=b

A B f

Function Example

  • Let A = {1,2,3} and B = {a,b,c} Let ƒ (1) = b ƒ (2) = c ƒ (3) = a
  • c is the image of 2 under the function ƒ.
  • The image f (A) of function f is B = {a, b, c}

1 2 3

b c a A B

ƒ

Docsity.com

Functions

  • From rule 3 of the definition, elements of the domain can map to at most one element of the codomain.
  • Multiple elements of the domain may map to the same element of the range:

1 2 3

b c a A B

ƒ

function

Functions

  • The domain may not map to multiple elements of the range:
  • This is called the uniqueness condition of functions

1 2 3

b c a A B

ƒ

not a function

Function Examples:

  • Consider again A = {1,2,3} and B = {a,b,c}

Let ƒ (1) = b

ƒ (2) = c

ƒ (3) = a

ƒ = {(1, b), (2, c), (3, a) }

Function Examples

  • Consider ƒ : R → R where R is reals

Let ƒ ( x ) = x^2.

Alternately: ƒ = {( x , x^2 ) | x ∈ R }

Then ƒ : R → R

Function Examples

  • Let S be a finite non-empty set. We may define the function:

ƒ :P(S) → N as ƒ (A) = |A|.

  • Alternately: ƒ = {( a , n ) | a ∈ P(S) ∧ n ∈ N ∧ | a | = n }
  • This is the set size function.

Function Examples

  • Consider the function ƒ : N × N → N

N × N are pairs of natural numbers. Let ƒ ( x,y ) = x^2 + y ƒ = {(( x,y ), x^2 + y )}

Function Examples

  • Consider in general n-ary functions , which are of the form

ƒ :A1 × A 2 ... × A n → B.

  • These are called n-ary functions or functions of n variables , and are written:

ƒ ( a 1 , a 2 , ..., an ) = b

Function Examples

  • Consider a function ƒ : N × N × N × N → I

Let ƒ ( w , x , y , z ) = 2 w + 3( xy ) - 4 z

ƒ = {( ( w , x , y , z ), 2 w + 3( xy ) - 4 z ) }

Function Examples

  • Consider a function ƒ : A × B → N

A = { x | x is a first names} B = { x | x is a last name} Let ƒ ( x, y ) = student x y ’s box number.

  • Not a function! Why?

Function Examples

  • Consider function ƒ : R → I where:

ƒ ( x ) = Largest integer less than or equal to x. ƒ ( x ) =  x

  • called the floor function.
  • Consider function ƒ : R → I where:

ƒ ( x ) = Least integer greater than or equal to x. ƒ ( x ) =  x

  • called the ceiling function.