Download presentation
Presentation is loading. Please wait.
Published byRandall Dickerson Modified over 9 years ago
1
Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007
2
Functions and Relations A function associates every element of its domain with exactly one element of its range, or codomain.
3
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).
4
Functions and Relations f is onto if for every y B, there is x A such that f(x) = y.
5
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.
6
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?
7
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?
8
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.
9
A One-to-one Correspondence Show that f is a one-to-one correspondence.
10
Functions and Relations A subset of A A is called a (binary) relation on A.
11
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.
12
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.
13
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.
14
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.
15
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.
16
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.
17
Strings and Languages Let the alphabet be = {a, b}. Some strings: aaa abb abbababbabbbababab
18
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.
19
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, …}
20
Computer Programs Can the set of all possible computer programs be arranged in lexicographical order?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.