Beruflich Dokumente
Kultur Dokumente
1
Grading Scheme Academic Honesty
http://www.vanderbilt.edu/student_handbook/Honor_System.htm
Homework: 35%
In class Exams: 40% total (20% each)
What constitutes cheating?
Final Exam: 25%
2
Fundamental Questions Sets
Fundamental Questions of Computer A = {a, b, aa, bb} B = {a, b, ab, ba, aba}
Science:
Union
Intersection
What can and cannot be computed?
Complement A
What can and cannot be computed
efficiently?
C = {a, b}
What is the power set of C?
In order to answer these questions we need a
universal model of computation.
Sets Sets
A = {2,13,15,25,37,49,55} A = {a, b}, B = {4, 5, 6}, C = {$, #}
What is a subset of A?
What is A x B (Cartesian or cross product)?
What is a proper subset of A?
What is A x B x C?
C = {2, 13, 5, 2, 6, 2, 2}
What type of set is C?
Is {2} identical to {2, 2, 2, 2}?
Common infinite sets
N = {1,2,3,…}
Z = {…, -2, -1, 0, 1, 2, …}
3
Functions Graphs
Let D and R be sets. A function f from D to R, What is the outdegree of node 4?
f:D →R, is a relation from D to R such that for
What is the indegree of node 4?
every d∈D, there exists a unique r∈R such that
<d, r> ∈f. If <d, r> ∈f, then f(d) = r. Define a directed path between two nodes
D is the domain Is this graph strongly connected?
R is the range
1 2
Graphs Languages
What is the degree of node 5? A language is a set of strings involving
Is the degree of all the nodes equivalent? symbols from some alphabet.
Define a subgraph H An alphabet is a finite set of indivisible
3 4
{0, 1}
5
6
7
{a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v,
8
w, x, y, z}
{α, β, γ, δ}
4
Strings Languages
A string over Σ is finite (possibly empty) The set of all strings over Σ is denoted by
sequence of element of Σ. Σ*.
For example, some strings over the alphabet
For example,
{0, 1} are: {0, 1}* = {Λ, 0, 1, 00, 01, 10, 11, 000, 001, …}
Λ, 0, 1, 10010011101, and 000000 {a}* = {Λ, a, aa, aaa, aaaa, aaaaa, …}
Λ denotes the null string.
What is the set of all strings for {a, b, c}*?
The empty sequence of elements of Σ.
Strings Languages
The following are not strings over {0, 1}. Why A language over Σ is a subset over Σ*.
not?
Examples of languages over {0, 1}:
1021 {1, 010, 111000, 110}
1111111111…
∅
{Λ}
Ifx is a string over Σ, |x| denotes the length of x: {0, 1}*
the number of alphabet symbols in the string. {x ∈{0, 1}* | |x| is even}
For example, |1| = 1, |10010011101| = 11, and {x ∈ {0, 1}* | x (viewed as an integer) is prime}
|00000| = 5.
Which of the above languages are infinite?
What is |Λ|?
5
Languages Operations on Strings
Since languages are sets of strings, new
x is a substring of y if an only if there exist
languages can be constructed using set w, z ∈Σ* such that wxz = y.
operations (for instance, union, intersection, and
x is a prefix of y if and only if there exists a
complementation). z ∈ Σ* such that xz = y.
If L is a language over Σ, then L (the complement
X is a suffix of y if and only if there exists a
of L) is Σ* - L. z ∈Σ* such that zx = y.
What is L0?
6
Operations on Languages
∞ ∞
L* =U
i =0
Li and L+ = U
i =1
iL