0% found this document useful (0 votes)
16 views

Turing Machine TM Part Eng 19

Hehehe hehehe avashesh svbababbabavvRvevsvhFhwhSbshbs. Sbbsbbebwb sbbsbebwb

Uploaded by

SANDEEP Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Turing Machine TM Part Eng 19

Hehehe hehehe avashesh svbababbabavvRvevsvhFhwhSbshbs. Sbbsbbebwb sbbsbebwb

Uploaded by

SANDEEP Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

www.gradeup.

co

1 | Page
www.gradeup.co
Turing Machine

Content:

1. Concept of Turing Machine


2. Algorithm of turing machine
3. Chomsky Hierarchy

1. The language accepted by Turing Machine is recursively enumerable language


(REL).
2. If we apply some restriction on Turing Machine, then the language accepted by
Truing Machine is called Recursive large( RL).
3. All recursive languages are recursively enumerable languages .

4. Non- deterministic Turing Machine or Deterministic Turing Machine have


same or equal powers.
5. Recursively enumerable language are closed under:
a. Union

2 | Page
www.gradeup.co
b. Intersection
c. Kleen star

It is not closer under:

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

Decidability of turing Machine

Decidability is no for all this

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.

THE CHOMSKY HIERARCHY

PHRASE-STRUCTRUE GRAMMARS

A phrase-structure grammar is a collection of three things:

1. A finite alphabet Σ of letters called terminals.

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.

A derivation in a phrase-structure grammar is a series of working string beginning with


that star symbol S, which by making substitution according to the productions, arrives
at a string of all terminals, at which point generation must stop.

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:

A → BA/∈ (P1 say)

B → aB/a (P2 say)

aaaB → ba (P3 say)

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.

The following is a summary of one possible derivation in this grammar:

A → BBBBBB

→ aaaaBBBBB

→ aabaBBBB

→ aabaaaBB

→ aabbaBB

→ aabbaaaB

→ aabbba

All CFG’s are phrase-structure grammars in which we restrict ourselves as to what we


put on the left side of productions. So, all CFLs can be generated by phrase-structure
grammars.

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 (Unrestricted grammar)

Type – 1 (Context sensitive grammar)

Type – 2 (Context free grammar)

Type – 3 (Regular grammar)

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

L = {an bn} ∪ {an b2n}

Is linear, but not deterministic. The relationship between, linear, deterministic context-free and
non-deterministic context-free language is shown in below figure.

In the last we can summarise our discussion as follows:

7 | Page
www.gradeup.co

Type Name of languages Production Restrictions Acceptor


generated A→B
0 Unrestricted A = any string with non-terminal Turing machine
(reversively- B = any string
enumerable)

1 Context-sentive A = any string with non Linear bound


terminals Automata
B = any string as long as or
longer than A.
2 Context-free Pushdown
A = one non-terminal Automata
B = any string
3 Regular Finite automata
A = one non-terminal
B = aX or B = a, where ‘a’ is a
terminal and X is non-terminal.

<<,,

UNRESTRICTED (TYPE-0) GRAMMARS

The unrestricted grammar is defined as

G = (Vn, Vt, P, S)

Where Vn = a finite set of non-terminal

Vt = a finite set of terminals

S = starting non-terminal, S ∈ Vn

And P is set of productions of the following form

α→β

where α and β are arbitrary string of grammar symbols with α ≠ ∈. These grammars are knows
as type-0, phase-structure or unrestricted grammars.
<,,,,

Context – Sensitive grammar (CSL):

Let G = (Vn, Vt, P, S) be context sentive grammar

Where Vn = finite set of non-terminals

Vt = finite set of terminals

8 | Page
www.gradeup.co
S = starting non-terminals S ∈ Vn

And P is the set of rules called productions defined as

α → β

where β is at least as long as α that is clearly

│α│ ≤ │β│

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.

For example, language L = {an bn cn : n ≥ 0} is context sensitive. We can show this


exhibiting a context sentive grammar for the language L1 grammar as

S → abc/aAbc

Ab → bA

Ac → Bbcc

bB → Bb

aB → aa/aaA

“A type 0 grammar is called length-increasing if for all rules α → β in P we have


│α│ ≤ │β│” (same as context sensitive grammar).

So we can say that ∈ free type-0 grammar is said to be length increasing grammar.

LINEAR BOUNDED AUTOMATA

A Linear Bounded Automata (LBA) is a non-deterministic turing machine satisfying the


following two conditions.

(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.

LBA will be denoted as

Tm = {Q, Σ, Γ, δ, q0, h, $1, $2) where Q, Σ, δ, S are as for non-deterministic turning


machine; $1 and $2 are symbols in Γ, the left and right end markers.

The L(Tm) the languages accepted by turning machine is

{W/W is in Σ* and (q0, $1 W $2) */Tm (h, $1 y $2}

Here y is for yes and h shows halting of LBA after accepting the string W.

RELATIONS BETWEEN CLASSES OF LANGUAGES

The four classes of languages-recursive sets, context sensitive languages, context-


free languages and regular sets are often referred to as language of types 0, 1, 2
and 3 respectively. We can find the relation between all those sets of language
through following theorems:

Theorems:

1. Every context sensitive language is recursive.


2. There is at least one language L that is recursive but not context-sensitive.

10 | P a g e
www.gradeup.co

11 | P a g e

You might also like