Automata Theory
Automata Theory
Lecture 2
Lecture’s Objective
Part 1: Understanding the concept of sets and languages.
Part 2: How these two concepts are related to our course?
Part 3: Important terminologies and properties related to languages.
Part 1
Highlights
• Sets
• Languages
Basics - Sets
B = {3, 5, 7, …}
Ambiguity: Set of odd numbers > 1 or set of primes?
B = {x | x is an odd integer greater than 1}
More descriptive
Basics - Sets
More examples
C = {x | x Ɛ B and x < 11}
D = {x | there exist integers i and j, both >= 0, with x = 3i+7j }
D = {3i + 7j | i,j are non-negative}
D = {3i+7j | i,j Ɛ N}
Basics - Sets
Complement of a set
A’ = {x Ɛ U | x ∉ A}
Basics - Sets
Union of two sets
A U B = {x | x Ɛ A or x Ɛ B}
NOTE
No need to memorize these
properties. Just have a look at
these to refresh your concept.
Basics - Sets
Intersection of two sets
A Π B = {x | x Ɛ A and x Ɛ B}
NOTE
No need to memorize these
properties. Just have a look at
these to refresh your concept.
Basics - Sets
Subtraction
A - B = {x | x Ɛ A and x ∉ B}
A - B = {x | x Ɛ A} Π {x | x ∉ B}
A – B = A Π B’
Basics - Sets
A few more properties
NOTE
No need to memorize these
properties. Just have a look at
these to refresh your concept.
Basics - Sets
Symmetric difference
A ⊕ B = (A – B) U (B – A)
A ⊕(B ⊕ C) = (A ⊕ B) ⊕ C
Basics - Sets
Cartesian product
A X B = {(a , b) | a Ɛ A and b Ɛ B}
Where (a , b) are ordered pairs
Basics - Sets
Disjoint sets
Intersection of sets is an empty set.
Basics – Sets – Important symbols
Symbol Meaning Symbol Meaning
A ⊆ B Subset: A has some (or all) elements of B b ∉ A Not element of: b is not in A
Proper Superset: A has B's elements and more A=B Equality: both sets have the same members
A ⊃ B
A×B Cartesian Product: set of ordered pairs from A and B
A ⊅ B Not a Superset: A is not a superset of B
|A| Cardinality: the number of elements of set A
A ∪ B Union: in A or B (or both)
| Such that
A ∩ B Intersection: in both A and B
: Such that
Ac Complement: elements not in A NOTE
∀ For all (∀x>1, x >x)
2
No need to memorize these
A−B Difference: in A but not in B ∃ There Exists (∃ x | x2>x) symbols. Just have a look at
these to get familiar with
these.
Basics – Languages
• A natural languages involves A natural language is a
• Alphabet set set of all legal sentences
• Vocabulary constructed by obeying
• Grammatical rules grammatical rules.
• Sentences
• Paragraphs etc.
A programming language
• A programming language involves
is a set of all legal
• Keywords/operators
statements constructed
• Syntactic rules
by obeying syntactic
• Statements
rules.
• Program
Part 2
Now lets relate the concepts of sets and languages with automata
Sets
N – A binary number N – A Natural number
Yes No Yes No
L = {1, 01, 11, 001, 011, 101, 111, ……} YES L = {1, 3, 5, 7, 9, 11, 13, 15, 17, ……} YES
L’ = {0, 00, 10, 000, 010, 100, 110, ……} NO L’ = {2, 4, 6, 8, 10, 12, 14, 16, ……} NO
Yes No
L = {1, 01, 11, 001, 011, 101, 111, ……} YES
L’ = {0, 00, 10, 000, 010, 100, 110, ……} NO
The concept of languages in automata
N – A binary number
Yes No
L = {1, 01, 11, 001, 011, 101, 111, ……} YES
L’ = {0, 00, 10, 000, 010, 100, 110, ……} NO
The concept of languages in automata
N – A binary number
Example:
Is odd number? ∑ = {0 , 1}
Model of Computation L = {x Ɛ ∑* | x ends with 1}
Conclusion:
The concept of language is used to
Yes No
formulate a decision problem.
L = {1, 01, 11, 001, 011, 101, 111, ……} YES
L’ = {0, 00, 10, 000, 010, 100, 110, ……} NO
Part 3
Languages – Terminologies and properties
Important definitions
• ∑ = {a , b}
• Word & string
• Null string (^)
• Length of string = |abbba| = 5
• Substring, prefix, suffix
Languages – Terminologies and properties
Important operations
• Concatenation of two words or languages
• If A = abba, B = aab then AB = abbaaab
• ab^b = abb^ = ^abb =abb
• L1L2 = {xy | x Ɛ L1 and y Ɛ L2}
• {ab, ba} {a, b} = {aba, abb, baa, bab}
• ∑2 = {a , b}2 = {a, b} {a, b} = {aa, ab, ba, bb}
• a4 = aaaa where a can be a word or language or even an alphabet set
• Kleene star and kleene plus operators
• ∑* = {a , b}* = {^, a, b, aa, ab, ba, bb, …..}
• Complement of a language
• L’ = ∑* - L
• Union, intersection and difference of languages
Discuss alphabet set with symbols like ∑ = {ab , baa} etc. Note: No symbol should be prefix of other
symbol.
Languages – Few examples
• L = {x Ɛ {a,b}* | |X| <= 8}
• L = {x Ɛ {a,b}* | |X| is odd}
• L = {x Ɛ {a,b}* | na (x) >= nb (x)}
• L = {x Ɛ {a,b}* | |X| >= 2 and x begins and ends with b}