Upload
edholecom
View
29
Download
0
Tags:
Embed Size (px)
DESCRIPTION
free video lectures for all courses
Citation preview
FREE VIDEO LECTURES FOR MCA
By:video.edhole.com
CHOMSKY HIERARCHYLANGUAGE OPERATIONS AND PROPERTIES
video.edhole.com
THE CHOMSKY HIERARCHY
Type
Language Grammar Automaton
0 Partially Computable
Unrestricted DTM - NTM
1 Context Sensitive
Context Sensitive
Linearly Bounded Automaton
2 Context Free Context Free NPDA
3 Regular right regular, left regular
DFA, NFA
0 Type 1 Type 2 Type 3 Type
You don’thave to know this
video.edhole.com
THE CHOMSKY HIERARCHY
Context Free Languages
Computable Languages
Partially Computable Languages
{an bn , n ≥ 0}
Regular Languages
{an bn cn , n ≥ 0}
{am bn , m,n ≥ 0}
{M, H(<M>)}
video.edhole.com
REGULAR LANGUAGES
To prove that a language is regular: Find a DFA (NFA, NFAε) that recognizes it. Find a regular expression that represents is. Find a (right or left) regular grammar that
generates it.
video.edhole.com
CONTEXT FREE LANGUAGES
To prove that a language is context free: Find a NPDA that recognizes it. Find a context free grammar that generates
it.
video.edhole.com
COMPUTABLE LANGUAGES
To prove that a language is computable you must find a Turing Machine that decides membership in the language:
If the string is in the language then the machine should accept.
If the string is not in the language then the machine should reject.
The machine shouldn’t loop for any input.
video.edhole.com
PARTIALLY COMPUTABLE LANGUAGE
To prove that a language is partially computable:
Find a Turing Machine that recognizes it: if the string is in the language the machine
should accept. if the string is not in the language the machine
should loop. Give an unrestricted grammar that
represents it (you won’t be asked to do that…)
video.edhole.com
CLOSURE UNDER OPERATIONS
• Regular Languages are closed under: Union, Concatenation, Star, Intersection and Complement
• Context Free Languages are closed under: Union, Concatenation, Star. They are not closed under: Intersection, Complement.
• Computable Languages are closed under: Union, Concatenation, Star, Intersection, Complement
• Partially Computable Languages are closed under: Union, Concatenation, Star, Intersection. They are not closed under Complement. video.edhole.com
COMPUTABLE AND PARTIALLY COMPUTABLE LANGUAGES
• Computable languages most of the times are called Decidable Languages because a Turing Machine can decide membership in those languages (it can either accept or reject a string). They are also called Recursive.
• Partially Computable Languages most of the times are called Recognizable because a Turing Machine can recognize a string in the language (accept it) but it might not be able to decide if a string is not in the language (it might loop). They are also called Recursively Enumerable.
video.edhole.com
COMPUTABLE LANGUAGES ARE ALSO PARTIALLY COMPUTABLE
Proof:If L is Computable then there is a Turing Machine M
that decides membership in L:– M accepts on x if x is in L– M rejects on x if x is not in L
Change M to M’ in the following way:– For all the combinations (q,a) for which the machine
rejects add the transition δ(q,a) = (q, a, S)
Now the new machine M’:– Accepts on x if x is in L– Loops on x is x is not in L
So M’ recognizes L.video.edhole.com
PROPERTIES OF COMPUTABLE AND PARTIALLY COMPUTABLE LANGUAGES
If a language L and its complement are both partially computable then the language is computableBoth L and its complement have TMs M and M’ that
recognize them. To decide if x is in L: Run both machines M and M’ in parallel. Eventually one will halt. If M halts accept. If M’ halts reject.
video.edhole.com