mathematical notions and terminology lecture 2 section 0.2 fri, aug 24, 2007

20
Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Upload: randall-dickerson

Post on 05-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Mathematical Notions and Terminology

Lecture 2Section 0.2

Fri, Aug 24, 2007

Page 2: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Functions and Relations

• A function associates every element of its domain with exactly one element of its range, or codomain.

Page 3: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Functions and Relations

• Let f : A B be a function.• f is one-to-one if

f(x) = f(y) x = y.• Equivalently,

x y f(x) f(y).

Page 4: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Functions and Relations

• f is onto if for every y B, there is x A such that f(x) = y.

Page 5: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

A One-to-one Correspondence

• A hallway has 100 lockers, numbered 1 through 100.

• All 100 lockers are closed.• There are 100 students, numbered

1 through 100.

Page 6: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

A One-to-one Correspondence

• For each k, student k’s instructions are to reverse the state of every k-th locker door, starting with locker k.

• If all 100 students do this, which lockers will be left open?

Page 7: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

A One-to-one Correspondence• Which students should be sent down the

hall so that exactly the prime-numbered lockers are left open?

• Is it possible to leave any specified set of lockers open?

• Is it possible for two different sets of students to leave the same lockers open?

Page 8: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

A One-to-one Correspondence

• Let L be the set of all lockers and let S be the set of all students.

• Let f :(S) (L) be defined as• f(A) is the set of locker doors left open

after the students in A have gone down the hall.

Page 9: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

A One-to-one Correspondence

• Show that f is a one-to-one correspondence.

Page 10: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Functions and Relations

• A subset of A A is called a (binary) relation on A.

Page 11: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Functions and Relations

• A binary relation R is an equivalence relation if it is • Reflexive: (x, x) R.• Symmetric: (x, y) R (y, x) R.• Transitive: (x, y) R and (y, z) R

(x, z) R.

for all x, y, z R.

Page 12: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Equivalence Relations

• We may define two computer programs to be equivalent if they always produce the same output for the same input.

• Show that this is an equivalence relation.

• Describe an equivalence class under this relation.

Page 13: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Graphs

• A graph consists of a finite set of vertices and a finite set of edges.

• In a directed graph, each edge has a direction from one vertex to another.

Page 14: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Graphs and Relations

• A graph may be used to represent a relation.• Draw a vertex for every element in A.• If a has the relation to b, then draw

an edge from a to b.

Page 15: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Graphs and Relations

• If the relation is reflexive, we may choose not to draw the loops.

• If the relation is symmetric, we do not need to show the arrowheads.

• If the relation is transitive, we may show only a minimal set of egdes.

Page 16: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Strings and Languages

• An alphabet is a finite set of symbols, typically letters, digits, and punctuation.

• A string is a finite sequence of symbols from the alphabet.

• The empty string is the unique string of length 0.

Page 17: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Strings and Languages

• Let the alphabet be = {a, b}.• Some strings:

• aaa• abb• abbababbabbbababab

Page 18: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Lexicographical Order

• Assume that the symbols themselves are ordered.

• Group the strings according to their length.

• Then, within each group, order the strings “alphabetically” according to the ordering of the symbols.

Page 19: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Lexicographical Order

• Let the alphabet be = {a, b}.• The set of all strings in

lexicographical order is{, a, b, aa, ab, ba, bb, aaa, …,

bbb, aaaa, …, bbbb, …}

Page 20: Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007

Computer Programs

• Can the set of all possible computer programs be arranged in lexicographical order?