Turing Machine TM Part Eng 19
Turing Machine TM Part Eng 19
co
1 | Page
www.gradeup.co
Turing Machine
Content:
2 | Page
www.gradeup.co
b. Intersection
c. Kleen star
1. Complement
2. Set difference
• If L is recursive then its complement is also recursive
• If L is RE , then its kleen star is also RE
• Two language are RE , then its concatenation is also RE
• Union of two RE language is also RE
• Recursively enumerable use unrestricted grammar
1. No algorithm to check whether the machine will accept something or not means
emptiness expression for Regular Expression cannot be decided by Turing
Machine.
2. There does not exist a Turing Machine that can decide for any encoded Turing
Machine T fed into it, whether or not the language T is finite or infinite.
PHRASE-STRUCTRUE GRAMMARS
2. A finite set of symbols called non-terminal that includes the start symbol .S
3 | Page
www.gradeup.co
3. A finite set of production of the forms
String 1 → String 2
Where string 1 can be any string of terminals and non-terminals that contains at least
one non-terminals and where string 2 is any string of terminals and non-terminals what
so ever.
TIPS
The language generated by a phrase structure grammar is the set of all strings of
terminals that can be derived string at S.
Example: The following is a phrase structure grammar over Σ = {a, b} with non
terminals A and B:
Solution: The first production P1 say that we can start with A and derive number of
symbols of the type B, for example
A → BA
→ BBA
→ BBBA
4 | Page
www.gradeup.co
→ BBBBA
→ BBBB
The second production shows us that each B can be any string of a’s (with at least
one a):
B → aB
→ aaB
→ aaaB
→ aaaaB
→ aaaaa
The third production (P3) says that any time we find three a’s and B, we can replace
these four symbols with the two-terminal string ba.
A → BBBBBB
→ aaaaBBBBB
→ aabaBBBB
→ aabaaaBB
→ aabbaBB
→ aabbaaaB
→ aabbba
5 | Page
www.gradeup.co
CHOMSKY HIERARCHY
We can exhibit the relationship between grammars by the Chomsky Hierarchy. Noum
Chomsky, a founder of formal language theory, provided an initial classification in to
four language types:
Type 0 languages are those generated by unrestricted grammars, that is, the
recursively enumerable languages. Type 1 consist of the context-sentive languages,
Type 2 consists of the context-free languages and Type 3 consists of the regular
languages. Each languages family of type k is a proper subset of the family of type k
– 1. Following diagram shows the original Chomsky Hierarchy.
We have also met several other language families that can be fitted in to this picture.
Including the families of deterministic context-free languages (LDCF), and recursive
languages (LREC). The modified Chomsky Hierarchy can be seen in below figure.
6 | Page
www.gradeup.co
We know that L = {w : na (w) = nb(w) } is deterministic, but not linear. On the other hand, the
language
Is linear, but not deterministic. The relationship between, linear, deterministic context-free and
non-deterministic context-free language is shown in below figure.
7 | Page
www.gradeup.co
<<,,
G = (Vn, Vt, P, S)
S = starting non-terminal, S ∈ Vn
α→β
where α and β are arbitrary string of grammar symbols with α ≠ ∈. These grammars are knows
as type-0, phase-structure or unrestricted grammars.
<,,,,
8 | Page
www.gradeup.co
S = starting non-terminals S ∈ Vn
α → β
│α│ ≤ │β│
The term “context-sentive” comes from a normal form for these grammars, where
each production is of the form α1 → α1 β α2, with β ≠ ∈. Replacement of variable A
by string β is permitted in the “context” of α1 and α2.
S → abc/aAbc
Ab → bA
Ac → Bbcc
bB → Bb
aB → aa/aaA
So we can say that ∈ free type-0 grammar is said to be length increasing grammar.
(a) Its input alphabet includes two special symbols $1 nd $2 the left and right end
marker, respectively.
9 | Page
www.gradeup.co
(b) The LBA has no more left from $1 and no right form $2 nor may it print another
symbol over $1 or $2.
The linear bound automata is simply a turning machine which instead of having
potentially infinite tape on which to compute, is restricted to the portion of the tape
containing the input plus the two tape squares bolding the end markers.
Here y is for yes and h shows halting of LBA after accepting the string W.
Theorems:
10 | P a g e
www.gradeup.co
11 | P a g e