Title: Lecture 2 Alphabets, Strings and Languages
1Lecture 2Alphabets, Strings and Languages
CSCE 355 Foundations of Computation
- Topics
- What I forgot from last lecture
- Proof techniques continued
- Alphabets, strings, languages
- Automata
Aug 27, 2007
2What I forgot from last lecture
- Slides skipped or not well covered
- 3 Course outcomes
- 8 Examples of Relations
- 9 POSETS
- 10 Equivalence relations
- 15 Equality of Sets
- 17 If and only if
- 25 Structural Induction Proof
3http//infolab.stanford.edu/ullman/ialc/slides/sl
ides1.pdf
4Recursive Def of Arithmetic Expressions
- Basis a number or a variable is an expression.
- If E and F are expressions then a new expression
G can be formed by applying one of the three
rules - G E F
- G E F
- G ( E )
5Graphs Visual representation of relations
(binary)
- a R b if and only if a?b in the graph
6The Pigeon Hole Principle
- Proof techniques Continued
- If you have n boxes and more than n balls to put
in the boxes then you must be two balls (at least
two) in the same box. - Formally If A and B are sets with A gt B then
there is no 1-1 function from A to B.
7Mutual Inductions
- Example 1.23 On-Off pushbutton automaton
8Languages
- Alphabet a finite set of symbols
- String finite sequence of characters from an
alphabet - Empty string, length of string
- Language (over an alphabet)
9Operations on Strings
10Examples of Languages
11Operations on Languages
- Suppose S and T are languages (sets of strings)
- Union, intersection, complement
- concatenation
12Powers, Kleene Closure
- S1 S
- Sn S Sn-1
- How would you prove Sn Sm Snm ?
- What is S0?
- S
13Some Special Languages
14Finite Automata - Informally
15Finite Automata - formally
- A Deterministic Finite Automata (DFA) is a
5-tuple -
16Transition Diagrams Transition Tables
- Conventions
- Notes
- Number of out-arcs
- Dead state
17Path determined by a string
18Language accepted by a DFA
19Example L(M) for DFA M
20Given L find DFA for it
21Important application of Pigeon Hole Principle to
DFAs
22Regular Expressions
23Homework
- Whats wrong with Ullmans proof of if a
complete binary tree has n leaves then it has
2n-1 nodes. (extra credit) - Operations on StringsGiven strings s abc and
t12 - What are st , s2, and s3?
- Is e (empty string) in every language?
- Is ? a language? It is a sublanguage of every
language? - Operations on Languages. Given S a, b, ab and
T 1, 22 - What is ST?
- What is TS?
- What is T2? T3?
24- 3. DFA recognizing the following languages
- w in a,b each a is immediately preceded
by a b - w in a,b neither aa nor bb is a substring
of w - 4. What language does the DFA below recognize
25References Mathematical Foundations
- http//infolab.stanford.edu/ullman/ialc.html -
The website for the textbook - Extended Proof techniques
- http//www.maths.uwa.edu.au/berwin/humour/invalid
.proofs.html - Fair Use Books Online
- http//fair-use.org/bertrand-russell/the-principle
s-of-mathematics/ - Books
- Dr. Euler's Fabulous Formula Cures Many
Mathematical Ills