You are on page 1of 8

B.E.

3/4 (CSE) I - Semester (Supplementary) Examination, June / July 2015


Subject: Automata Languages and Computation
1) Give grammar for the language L (G) = 0n | n ≥ 1.
S → 0S S → ᵋ

2) Mention closure properties of regular languages.


Closure Properties of Regular Languages are the theorems indicate that the regular
languages are closed under certain operations. • A closure property of regular languages
says that ``If a language is created from regular languages using the operation mentioned
in the theorem, it is also a regular language´´. • Closure properties also indicate that how
regular languages (their DFAs) can be created from other regular languages using certain
operations.
1. The union of two regular languages is regular. 2. The intersection of two regular
languages is regular. 3. The complement of a regular language is regular. 4. The
difference of two regular languages is regular. 5. The reversal of a regular language is
regular. 6. The closure (star) of a regular language is regular. 7. The concatenation of
regular languages is regular. 8. A homomorphism (substitution of strings for symbols) of
a regular language is regular. 9. The inverse homomorphism of a regular language is
regular.

3) What is a derivation tree? Explain.


A derivation of β is the sequence of steps that gets to β. A leftmost derivation is where at
each stage one replaces the leftmost variable. A rightmost derivation is defined similarly
In a derivation tree, the root is the start variable, all internal nodes are labeled with
variables, while all leaves are labeled with terminals. The children of an internal node are
labeled from left to right with the right-hand side of the production used.
4) State Church’s hypothesis.
Any mechanical computation can be performed by a Turing Machine
There is a TM-n corresponding to every computable problem
We can model any mechanical computer with a TM
The set of languages that can be decided by a TM is identical to the set of languages that
can be decided by any mechanical computing machine
If there is no TM that decides problem P, there is no algorithm that solves problem P.

5) Give the formal definition of PDA.


Just as a DFA is a way to implement a regular expression, a pushdown automata is a way
to implement a context free grammar – PDA equivalent in power to a CFG – Can choose
the representation most useful to our particular problem • Essentially identical to a
regular automata except for the addition of a stack – Stack is of infinite size – Stack
allows us to recognize some of the non-regular languages
6) What is universal language?

Universal language may refer to a hypothetical or historical language spoken and


understood by all or most of the world's population. In some contexts, it refers to a means
of communication said to be understood by all living things, beings, and objects alike.

7) Explain SAT problem.


Study of Boolean functions generally is concerned with the set of truth assignments
(assignments of 0 or 1 to each of the variables) that make the function true. NP-
completeness needs only a simpler question (SAT): does there exist a truth assignment
making the function true?
(x+y)(-x + -y) is satisfiable.  There are, in fact, two satisfying truth assignments: 1. x=0;
y=1. 2. x=1; y=0.  x(-x) is not satisfiable.
8) Give 2 applications of CFG’s.
S → NP VP Det → that | this | a | the S → Aux NP VP Noun → book | flight | meal | man
S → VP Verb → book | include | read NP → Det NOM Aux → does NOM → Noun
NOM → Noun NOM VP → Verb VP → Verb NP
9) What is undecidability?
There are two types of TMs (based on halting): (Recursive) TMs that TMs that always
halt, no matter accepting or non no matter accepting or non - accepting  DECIDABLE
PROBLEMS (Recursively enumerable) TMs that TMs that are guaranteed to halt are
guaranteed to halt only on acceptance only on acceptance. If non-accepting, it may or
may not halt (i.e., could loop forever).  Undecidability:  Undecidable problems are
those that are not i 2 recursive

10) Define inherent ambiguity.


A grammar is ambiguous if there exists a word with at least two derivation trees in its
generated language. I A context-free language L is ambiguous (inherently ambiguous) if
every grammar that generates L is ambiguous

11) A)
B) Define ε-closure of a state and explain with a suitable example.

12) A) Convert the following grammar to CNF.

B) State pumping Lemma for CFL’s. What are its applications?


The result from the previous slide (|w| ≤ 2 n-1 ) lets us define the pumping lemma for
CFL’s • The pumping lemma gives us a technique to show that certain languages are not
context free – Just like we used the pumping lemma to show certain languages are not
regular – But the pumping lemma for CFL’s is a bit more complicated than the pumping
lemma for regular languages • Informally – The pumping lemma for CFL’s states that for
sufficiently long strings in a CFL, we can find two, short, nearby substrings that we can
“pump” in tandem and the resulting string must also be in the language.
Let L be a CFL. Then there exists a constant p such that if z is any string in L where |z| ≥
p, then we can write z = uvwxy subject to the following conditions: 1. |vwx| ≤ p. This
says the middle portion is not larger than p. 2. vx ≠ . We’ll pump v and x. One may be
empty, but both may not be empty. 3. For all i ≥ 0, uv iwx iy is also in L. That is, we
pump both v and x.
13) How can a PDA be converted to a grammar? Explain the methodology with the
help of an example.
We first illustrate the PDA to CFG conversion algorithm with an example. As soon as we
present an example, we write the corresponding general rule in slant fonts. Further
details, should you need them, may be found in the textbook of Hop croft, Motwani, and
Ullman [60] whose algorithm we adopt. A slightly different algorithm appears in Sipser’s
Book

14) A) Construct a TM to accept the language of palindromes over the alphabet {a, b}.
B) Explain Halting problem of a TM.
The HaltingProblem states that it is impossible to write a program that runs in finite time that is
able to decide whether an arbitrary program will halt (with a certain input).
The HaltingProblem does not state that it is impossible to decide for a specific program whether
it is going to halt. It is even possible to write programs that make this decision. They simply
work only on a subset of all programs.
To be correct about terms, the HaltingProblem is actually the question, "Given this code
X, will it terminate (halt)?". Usually the only reason to ask this formulated in such a way
is to give an example of a problem for which there is no recursive enumerable algorithm,
i.e. an algorithm that will itself always produce a result.
Here is the proof of the HaltingProblem:

 Assume I have a program P that can tell you whether any program halts or not for given
input data.
 I construct a program Q based on P which, if P says its input program doesn't halt,
immediately halts, and if P says the program halts, goes into an infinite loop.
 Feeding Q(Q) to P I can see that if P says it halts, it won't, and if P says it doesn't halt, it
will.
 Therefore I don't have any such program P and anyone else who says they do is full of it.

15) B) State and explain the properties of recursively enumerable languages.


Recursive: They allow a function to call itself. Or, a recursive language is a recursive
subset in the set of all possible words over alphabet Σ of that language. Non-recursive
should not be taken as simpler version of computation, i.e., e.g., obtaining factorial value
without recursion method. Regular languages ⊆ context free languages ⊆ context
sensitive languages ⊆ recursive languages ⊆ recursive enumerable languages. A
language is Recursively Enumerable (RE) if some Turing machine accepts it. - A TM M
with alphabet Σ accepts L if L = {w ∈ Σ∗ |M halts with input w } - Let L be a RE
language and M the Turing Machine that accepts it. ∴, for w ∈ L, M halts in final state.
For w ∈/ L, M halts in non-final state or loops for ever. A language is Recursive (R) if
some Turing machine M recognizes it and halts on every input string, w ∈ Σ∗ .
Recognizable = Decidable. Or a language is recursive if there is a membership algorithm
for it. Let L be a recursive language and M the Turing Machine that accepts (i.e.
recognizes) it. For string w, if w ∈ L, then M halts in final state. If w ∈/ L, then M halts in
non-final state. (halts always!).
Every Recursive language is RE. ∴, if M is TM recognizing L, the M can be easily
modified so its accepts L. The languages which are non-RE cannot be recognized by TM.
These are diagonal (Ld ) languages of the diagonal of x −y, where xi is language string wi
, and yi is TM Mi . Language < M,w >, where M is TM and w is string, is not RE
language, since its generalized form is not Turing decidable (undecidability proof), ∴, it
is non-RE language.
16) Consider the CFG : S → A1A2 | A2A3 ; A1 → A2A1 | 0 ; A2 → A3A3 | 1 ;
A3 → A1A2 | 0 10 Test if “10010” is a member or not using CYK algorithm.

17) A) CHOMSKY hierarchy


A containment hierarchy (strictly nested sets) of classes of formal grammars
B) LBA
Suppose we modify our model to allow just a finite tape, initially containing just the test
string s with end markers on either side: he many the machines therefore have just a finite
amount of memory, determined by the length of the input string. We call this a linear
bounded automaton. (LBAs are sometimes defined as having tape length bounded by a
constant multiple of length of input string — doesn’t make any difference in principle.)
Theorem: A language L ⊆ Σ ∗ is context-sensitive if and only if L = L (T) for some non-
deterministic linear bounded automaton T. Rough idea: we can guess at a derivation for s.
We can check each step since each sentential form fits within the tape. Suppose T is an
LBA. How might we detect that s is not in L (T)? Clearly, if there’s an accepting
computation for s, there’s one that doesn’t pass through exactly the same machine
configuration twice (if it did, we could shorten it). Since the tape is finite, the total
number of machine configurations is finite (though large). So in theory, if T runs for long
enough without reaching the final state, it will enter the same configuration twice, and we
may as well abort. Note that on this view, repeated configurations would be spotted not
by T itself, but by ‘us watching’, or perhaps by some super-machine spying on T.

You might also like