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

Properties of Functions - 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:Properties of Functions, Two Example Algorithms, Linear Functions, Logarithmic Function, Exponential Function, Quadratic Function, Growth of Functions, Algorithm Analysis, Constant Factors, Type of Function, Large Values

Typology: Slides

2012/2013

Uploaded on 04/27/2013

atasi
atasi 🇮🇳

4.6

(32)

136 documents

1 / 35

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 173:
Discrete Mathematical Structures
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23

Partial preview of the text

Download Properties of Functions - Discrete Mathematics - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

CS 173:

Discrete Mathematical Structures

Functions - misc. properties

f(A ∩ B) ⊆ f(A) ∩ f(B)?

f(A ∩ B) = {x : ∃a ∈ (A ∩ B), f(a) = x}

Choose an arbitrary b ∈ f(A ∩ B), and show that it must also be an element of f(A) ∩ f(B).

So, ∃a ∈ (A ∩ B) such that f(a) = b.

If a ∈ A (it is), then f(a) = b ∈ f(A).

If a ∈ B (it is), then f(a) = b ∈ f(B).

b ∈ f(A), and b ∈ f(B), so b ∈ f(A) ∩ f(B).

CS 173

Functions - injection

A function f: A → B is one-to-one

(injective, an injection) if ∀a,b,c,

(f(a) = b ∧ f(c) = b) → a = c

Not one-to-one

Every b ∈ B has at most 1 preimage.

Michael Tito Janet Cindy Bobby

Katherine Scruse

Carol Brady

Mother Teresa

CS 173

Functions - surjection

A function f: A → B is onto (surjective,

a surjection) if ∀b ∈ B, ∃a ∈ A f(a) =

b

Not onto

Every b ∈ B has at least 1 preimage.

Michael Tito Janet Cindy Bobby

Katherine Scruse

Carol Brady

Mother Teresa

Functions - examples

Suppose f: R +^ → R +^ , f(x) = x 2.

Is f one-to-one?

Is f onto?

Is f bijective?

yes yes yes

Functions - examples

Suppose f: R → R +^ , f(x) = x 2.

Is f one-to-one?

Is f onto?

Is f bijective?

no yes no

Functions - composition

Let f:A→B, and g:B→C be functions.

Then the composition of f and g is:

(g o f)(x) = g(f(x))

Functions - a little problem

Let f:A→B, and g:B→C be functions.

Prove that if f and g are one to one, then g o f :A→C is one to one.

Recall defn of one to one: f:A->B is 1to1 if f(a)=b and f(c)=b --> a=c.

Suppose g(f(x)) = y and g(f(w)) = y. Show that x=w.

f(x) = f(w) since g is 1 to 1.

Then x = w since f is 1 to 1.

Familiar functions

Polynomials: f(x) = a 0 x n^ + a 1 x n-1^ + … + an-1 x 1 + anx 0

Ex: f(x) = x 3 - 2x 2 + 15

Exponentials: f(x) = c dx

Ex: f(x) = 3 10x^ , f(x) = ex

Logarithms: log 2 x = y, where 2 y^ = x. In this course, log 2 n is written lg n. If we write log n, assume log 2 n.

Familiar functions

Ceiling: f(x) = x the least integer y so that x ≤ y.

Ex: 1.2 = 2; -1.2 = -1;  1  = 1

Floor: f(x) = x the greatest integer y so that x ≥ y.

Ex: 1.8 = 1; -1.8 = -2; -5 = -

Quiz: what is -1.2 + 1.1?

0

Two example algorithms.

I have a number between 0 and 63.

You ask a question, I’ll tell you yes

or no.

How long will it take you to find my

secret number?

Suppose it takes 1 time unit to answer a query about my number.

We really have no clue how long the algorithm takes to run, but we have an inkling that it depends logarithmically on n.

In this case the algorithm takes about lg n time units.

We say the algorithm has “order log n” running time.

Who wins the race?

The following graph gives times for

completing races of length x, for 4

different competitors.

Who is the tortoise?

time

distance

Who is the hare?

How would you describe blue’s performance?

At each distance, who wins?

Quiz time…

Describe this function:

Very slow growing.

Logarithmic function

Quiz time…

Describe this function:

Very fast growing.

Exponential function