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

Assignment TOC 2023-24 EVEN

Uploaded by

sudha k
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Assignment TOC 2023-24 EVEN

Uploaded by

sudha k
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 9

K S R INSTITUTE FOR ENGINEERING AND TECHNOLOGY

(An Autonomous Institution)


Tiruchengode - 637215
(Approved by AICTE, Affiliated to Anna University, Accredited by NAAC (A+) & NBA)

Department of Computer Science and Engineering(Cybersecurity)


ASSIGNMENT - I
Academic Year 2023 - 2024
Degree / Program B.E / CSE(CS)
& Semester (Even)
Course Code & Course
CS3452 & Theory of Computation Year / Sem. II / IV
Name
Name of the Faculty &
Ms.K.Sudha, AP/CSE(CS) Regulation 2021
Department
Email [email protected] Contact No 6380118908

S.
WRITTEN ASSIGNMENT QUESTIONS Marks BL SL
No
UNIT - I (AUTOMATA AND REGULAR EXPRESSIONS)
1. Let M =(Q,,6,qo,F) be a DFA and let h be a state of Al called its "home".A
synchronizing sequence for M and h is a string s C E* where oi(q, s) = h for
every q e Q. (Here we have extended d to strings, so that 6(q, S) equals the state
where M ends up when M starts at state q and reads input s.) Say that M is 20 K4 A1
syncbronizable if it has a synchronizing sequence for some state h. Prove that,
if M is a k-state synchronizable DFA, then it has a synchronizing sequence of
length at most k3. Can you improve upon this bound?
2. A finite state transducer (FST) is a type of deterministic finite automaton whose 20 K4 A2
output is a string and not just accept or reject. The following are state diagrams
of finite state transducers T1 and T2 .

Each transition of an FST is labeled with two symbols, one designating the
input symbol for that transition and the other designating the output symbol.
The two symbols are written with a slash, /, separating them. In T1, the
transition from q1 to q2 has input symbol 2 and output symbol 1. Some
transitions may have multiple input-output pairs, such as the transition in T1
from q1 to itself. When an FST computes on an input string w, it takes the input
symbols WV. w, one by one and, starting at the start state, follows the
transitions by matching the input labels with the sequence of symbols wi ... w,
= w. Every time it goes along a transition, it outputs the corresponding output
symbol. For example, on input 2212011, machine T1 enters the sequence of
states q1, q2, q2, q2, q2, q1, q1, q1 and produces output 1111000. On input
abbb, T2 outputs 1011. Give the sequence of states entered and the output
produced in each of the following parts.
a. T1 on input 01l e. T2 on input b
b. T1 on input 211 f. T2 on input bbab
c. T1 on input 121 g. T2 on input bbbbbb
d. T1 on input 0202 h. T2 on input €

3. Give state diagrams of DFAs recognizing the following languages. In all parts
the alphabet is {0,1 }
a. {wI w begins with a 1 and ends with a }
b. {wl w contains at least three 1s}
c. {wl w contains the substring 0101, i.e., w = xOiOiy for some x
and y}
d. {w I w has length at least 3 and its third symbol is a 0}
e. {wl wi starts with 0 and has odd length, or starts with 1 and
has even length}
f {wI wi doesn't contain the substring 1101
20 K3 B1
g. {uw the length of w is at most 5}
h. {wl w is any string except 11 and 1111
i. {wj every odd position of w is a ll
j. {w I w contains at least two Os and at most one 11
k. {s, 0}
1. {w I w contains an even number of Os, or contains exactly two
ls}
m. The empty set
n. All strings except the empty string

4. In certain programming languages, comments appear between delimiters such


as/# and #/. Let C be the language of all valid delimited comment strings. A
member of C must begin with /# and end with #/ but have no intervening #V.
For simplicity, we’ll say that the comments themselves are written with only
the symbols a 20 K3 B2
and b; hence the alphabet of C is ∑ = {a, b, /I #}.
a. Give a DFA that recognizes C.
b. Give a regular expression that generates C.

5. Convert the following ε-NFA to a DFA using subset construction method. 20 K3 B3


6. Find the equivalence and minimization of finite automata for the following FA.
[Table filling method/State partition method I & II]

20 K2 C1

UNIT - II (REGULAR EXPRESSIONS AND LANGUAGES)


1.
(i) For any string aw W=W1W2.. .Wn the reverse of w, written wR, is the string
w in reverse order, Wn ... W2W1 . For any language A, let A R = { wR │ w€A}.
Show that if A is regular, so is AR .

(ii) Let

∑ 3 contains all size 3 columns of Os and 1s. A string of symbols in ∑ 3 gives 20 K4 A1


three rows of Os and 1s. Consider each row to be a binary number and let

B = {w € ∑*3 │ the bottom row of w is the sum of the top two rows}.

For example,

Show that B is regular.


2. Write regular expressions for the following languages:
a) The set of strings over alphabet {a, b, c} containing at least one a and at
least one b.
b) The set of strings of 0`s and 1`s whose tenth symbol from the right end
20 K4 A2
is 1.
c) The set of strings of 0`s and 1`s with at most one pair of consecutive
1`s.
3. The pumping lemma says that every regular language has a pumping length p,
such that every string in the language can be pumped if it has length p or more.
If p is a pumping length for language A, so is any length p' > p. The minimum
pumping length for A is the smallest p that is a pumping length for A. For
example, if A = 01*, the minimum pumping length is 2. The reason is that the
string s = 0 is in A and has length 1 yet s cannot be pumped, but any string in A
of length 2 or more contains a 1 and hence can be pumped by dividing it so that
20 K3 B1
x = O. y = 1, and z is the rest. For each of the following languages, give the
minimum pumping length and justify your answer.
a. 0001* f. €
b. 0*1* g. 1*01*01*
c. 001 U O*1* h. 10(11*0)*0
d. 0*1+0+1* U 10*1 i. 1011
e. (01)* j. ∑*
4.
Let B and C be languages over ∑= {0. I}. Define B C = {w €B│ for some
y € C, strings w and y contain equal numbers of 1s}. Show that the class of 20 K3 B2

regular languages is closed under the operation.


5. Convert the following DFA to a regular expression,
using the state elimination technique

20 K3 B3

6. (i) Construct finite automata equivalent to the regular


expression (ab+a)*
(ii) Convert the RE for the given DFA by using Arden
theorem.
20 K2 C1

Case Studies / Seminar / Mini project QUESTIONS Marks BL SL

UNIT - I (AUTOMATA AND REGULAR EXPRESSIONS)


1. A case study of flipped classroom for automata theory in secondary education. 40 K4 A3
2. Conversion of NFA into DFA. 40 K3 B4
3. Minimization of DFAs. 40 K3 C2
UNIT - II (REGULAR EXPRESSIONS AND LANGUAGES)
1. Case study of Finite Automata (Vending machine and spell checker) 40 K4 A4
2. Proving languages to be not regular. 40 K4 B5
3. DFA into Regular Expression 40 K3 B6
4. Closure properties of regular languages. 40 K3 C3
UNIT – III (CONTEXT FREE GRAMMAR AND PUSH DOWN AUTOMATA)
1 Pushdown Automata in Statistical Machine Translation. 40 K4 A5
2 Ambiguity in grammars and languages. 40 K4 B7
3 Deterministic Pushdown Automata 40 K3 B8

CO1 Construct automata theory using Finite Automata


CO2 Write regular expressions for any pattern

CO3 Design context free grammar and Pushdown Automata

Course Instructor Course Coordinator Program Coordinator


K S R INSTITUTE FOR ENGINEERING AND TECHNOLOGY
(An Autonomous Institution)
Tiruchengode - 637215
(Approved by AICTE, Affiliated to Anna University, Accredited by NAAC (A+) & NBA)

Department of Computer Science and Engineering(Cybersecurity)

ASSIGNMENT - II
Academic Year 2023 - 2024
Degree / Program B.E / CSE(CS)
& Semester (Even)
Course Code & Course
CS3452 & Theory of Computation Year / Sem. II / IV
Name
Name of the Faculty &
Ms.K.Sudha, AP/CSE(CS) Regulation 2021
Department
Email [email protected] Contact No 6380118908

S.
WRITTEN ASSIGNMENT QUESTIONS Marks BL SL
No
UNIT – III (CONTEXT FREE GRAMMAR AND PUSH DOWN AUTOMATA)
1. Show using mathematical induction that every string produced by the
context-free grammar with productions
20 K4 A3
S →a | aS | bSS | SSb | SbS
has more a’s than b’s.
2. Design a PDA to accept each of the following language. You may accept either
by final state or by empty stack, whichever is more convenient.
a) {0n1n|n>=1} 20 K4 A4
b The set of all strings of 0`s and 1`s such that no prefix has more 1`s than 1`s
c The set of all strings of 0`s and 1`s with an equal number of 0`s and 1`s
3. Prove that the CFG with productions S → aSbS | aSbS | Δ generates the
20 K3 B4
language L = {x ∈ {a, b}∗ | na(x) = nb(x)}.
4. Convert the PDA P =({p,q},{0,1},{X,Z0},δ,q,Z0) to a CFG, if δ is given by:
1. δ(q,1, Z0)={(q,XZ0)}
2. δ(q,1, X)={(q,XX)}
3. δ(q,0, X)={(p,X)} 20 K3 B5
4. δ(q, ε, X)={(q, ε)}
5. δ(p,1, X)={(p, ε)}
6. δ(p,0, Z0)={(q,Z0)}
5. Give deterministic pushdown automata to accept the following languages:
1. {0n1m| n<=m}
20 K3 B6
2. {0n1m| n>=m}
3. {0n1m0n| n and m are arbitary}
6. Show that every regular language is a context free language Hint: Construct a 20 K4 C2
CFG by induction on the number of operators in the regular expression.
7. Find context-free grammars generating each of the languages below.
a. {aibj | i ≤ j}
b. {aibj | i < j}
c. {aibj | j = 2i} 20 K4 C3
d. {aibj | i ≤ j ≤ 2i}
e. {aibj | j ≤ 2i}
f. {aibj | j < 2i}
UNIT - IV (NORMAL FORMS AND TURING MACHINES)
1. Reduce the following grammars to Greibach normal form:
(a) S  SS, S  0S1 | 01
20 K4 A3
(b) S  AB, A  BSB, A  BB, B  aAb, B  a, A  b
(c) S A0, A  0B, B  A0, B  1
2. Below is a transition table for a TM with input alphabet {a, b}.

20 K4 A5

What is the final configuration if the TM starts with input string x?


3. For each of the following languages, draw a transition diagram for a
Turing machine that accepts that language.
a. AnBn = {anbn | n ≥ 0}
20 K3 B4
b. {aibj | i < j}
c. {aibj | i ≤ j}
d. {aibj | i ≠ j}
4. Consider the grammar G which has the following productions
S -> aB|bA. A -> aS|bAA|a. B -> bS|aBB|b.
and state whether the following statements are true or false.
(a) L(G) is finite.
20 K3 B5
(b) abbbaa ∈ L(G)
(c) aab ∉ L(G)
(d) L(G) has some strings of odd length.
(e) L(G) has some strings of even length.
5. Draw a transition diagram for a TM with input alphabet {0, 1} that interprets
the input string as the binary representation of a nonnegative integer and adds 1 20 K3 B7
to it.
6. Show how a two-stack automaton can simulate a Post machine, using the first 20 K2 B8
stack to represent the queue and using the second stack to help carry out the
various Post machine operations. The first step in the simulation is to load the
input string onto stack 1, using stack 2 first in order to get the symbols in the
right order. Give an informal argument that any language that can be accepted
by a Post machine can be accepted by a two-stack automaton. (The conclusion
from this exercise and the preceding ones is that the three types of machines—
Turing machines, Post machines, and two-stack automata—are equivalent with
regard to the languages they can accept.)
7. Does every TM compute a partial function? Explain. 20 K2 C2
UNIT - V (UNDECIDABILITY)
1. The DFA M is given by
M = ({q0,q1,q2,q3},{0,1}, δ , q0,{q0})
Where δ is defined by the transition table

20 K4 A4

Answer the following:


(a) Is (M, 001101) in ADFA?
(b) Is (M, 01010101) in ADFA?
(c) Does M ∈ ADFA?
(d) Find w such that (M, w) ∉ ADFA.
2. Suppose L is recursively enumerable but not recursive. Show that if T is a TM
accepting L, there must be infinitely many input strings for which T loops 20 K3 A5
forever.
3. Put the following boolean expressions into 3CNF:
a) xy + x̄ z
20 K3 B6
b) wxyz + u+ v
c) wxy + x̄ uv
4. The coloring problem is: given a graph G and an integer k, is G “k-colorable” 20 K3 B7
that is, can we assign one of k colors to each node of G in such a way that no
edge has both of its ends colored with the same color. For example, the graph
of Figure is 3-colorable, since we can assign nodes 1 and 4 the color red, 2
green, and 3 blue. In general, if a graph has a k-clique, then it can be no less
than k-colorable, although it might require many more than k-colors.
5. Describe how a universal Turing machine could be used in the proof that
20 K2 B8
SA is recursively enumerable.
6. Show that the PCP with S = {(0, 10), (120, 03), (021, 10)} has no solution. 20 K4 C3

S. No Case Studies / Seminar / Mini project QUESTIONS Marks BL SL


UNIT - IV (NORMAL FORMS AND TURING MACHINES)
1. Case Study on Self-constructing Evolutionary Turing Machine. 40 K4 A1
2. Closure properties of Context Free Languages. 40 K3 B1
3. Programming techniques for Turing machines. 40 K3 B2
UNIT - V (UNDECIDABILITY)
1. On undecidability bounds for matrix decision problems. 40 K4 A2
2. Modified Post`s Correspondence Problem. 40 K2 B3
3. Travelling Salesman Problem. 40 K2 C3

CO3 Design context free grammar and Pushdown Automata


CO4 Design Turing machine for computational functions
CO5 Differentiate between decidable and undecidable problems

Course Instructor Course Coordinator Program Coordinator

You might also like