






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Alphabet An alphabet is any finite set of symbols. ∑ = {a, b, c, d} is an alphabet set where ‘a’, ‘b’, ‘c’, and ‘d’ are symbols. String A string is a finite sequence of symbols taken from ∑. ‘cabcad’ is a valid string on the alphabet set ∑ = {a, b, c, d} Language A language is a subset of ∑* for some alphabet ∑. It can be finite or infinite. If the language takes all possible strings of length 2 over ∑ = {a, b}, then L = { ab, bb, ba, bb}
A grammar G can be formally written as a 4-tuple (V, T, S, P) where −
According to chomsky hierarchy, grammars are divided of 4 types:
Automatons are abstract models of machines that perform computations on an input by moving through a series of states or configurations. At each state of the computation, a transition function determines the next configuration on the basis of a finite portion of the present configuration. As a result, once the computation reaches an accepting configuration, it accepts that input. Characteristics of such machines include:
There are four major families of automaton :
Finite Automata(FA) is the simplest machine to recognize patterns. An automaton can be represented by a 5-tuple (Q, ∑, δ, q (^) 0, F), where −Q : Finite set of states. ∑ : set of Input Symbols. q0 : Initial state. F : set of Final States. δ : Transition Function.
(iv) r1, r2 ( kleen closure of r1 and r2 ) are also regular expressions
A grammar is regular if it has rules of form A -> a or A -> aB or A -> ɛ where 0 25 Bis a special symbol called NULL.
A language is regular if it can be expressed in terms of regular expression.
We can use Thompson's Construction to find out a Finite Automaton from a Regular Expression. We will reduce the regular expression into smallest regular expressions and converting these to NFA and finally to DFA. Method Step 1 Construct an NFA with Null moves from the given regular expression. Step 2 Remove Null transition from the NFA and convert it into its equivalent DFA.
Some basic RA expressions are the following − Case 1 − For a regular expression ‘a’, we can construct the following FA −
Case 2 − For a regular expression ‘ab’, we can construct the following FA −
Case 3 − For a regular expression (a+b), we can construct the following FA −
Case 4 − For a regular expression (a+b)*, we can construct the following FA −
Theorem Let L be a regular language. Then there exists a constant ‘c’ such that for every string w in L − |w| ≥ c We can break w into three strings, w = xyz , such that −
Prove that L = {a ibi^ | i ≥ 0} is not regular. Solution −
Basically a pushdown automaton is − "Finite state machine" + "a stack" A pushdown automaton has three components −
A context-free grammar (CFG) consisting of a finite set of grammar rules is a quadruple (V,T,S,P) where
Context-free languages are closed under −
Intersection with Regular Language − If L1 is a regular language and L2 is a context free language, then L1 ∩ L2 is a context free language.
Chomsky Normal Form A CFG is in Chomsky Normal Form if the Productions are in the following forms −
Any context-free language is generated by a context-free grammar in Chomsky normal form.
Greibach Normal Form A CFG is in Greibach Normal Form if the Productions are in the following forms −
If L is a context-free language, there is a pumping length p such that any string w ∈ L of length ≥ p can be written as w = uvxyz , where vy ≠ ε , |vxy| ≤ p , and for all i ≥ 0, uvixyi^ z^ ∈^ L.
Example Find out whether the language L = {x nyn^ zn^ | n ≥ 1} is context free or not. Solution Let L is context free. Then, L must satisfy pumping lemma. At first, choose a number n of the pumping lemma. Then, take z as 0 n1n2n. Break z into uvwxy, where |vwx| ≤ n and vx ≠ ε. Hence vwx cannot involve both 0s and 2s, since the last 0 and the first 2 are at least (n+1) positions apart. There are two cases −
Here the transition 1Rq 1 implies that the write symbol is 1, the tape moves right, and the next
state is q1. Similarly, the transition 1Lq 2 implies that the write symbol is 1, the tape moves left, and the next state is q2.
Recursive Enumerable (RE) or Type -0 Language RE languages or type-0 languages are generated by type-0 grammars. An RE language can be accepted or recognized by Turing machine which means it will enter into final state for the strings of language and may or may not enter into rejecting state for the strings which are not part of the language. It means TM can loop forever for the strings which are not a part of the language. RE languages are also called as Turing recognizable languages. Recursive Language (REC) A recursive language (subset of RE) can be decided by Turing machine which means it will enter into final state for the strings of language and rejecting state for the strings which are not part of the language. REC languages are also called as Turing decidable languages.
Closure Properties of Recursive Languages
Recursively enumerable languages are not closed under set difference or complementation. The set difference L - P may or may not be recursively enumerable. If L is recursively enumerable, then the complement of L is recursively enumerable if and only if L is also recursive.
we can restrict power of Turing Machine in following ways:
LBA is powerful than PDA
A context-sensitive language is a language over some alphabet generated by some grammar known as a context-sensitive grammar.
Formally, a context-sensitive language is a formal grammar G=(V,T,S,P) such that given any production in P, either has the form
Examples of Context Sensitive Languages