You are on page 1of 9

ASSIGNMENT # 04

Submission Deadline: November 9, 2022

Submission: [1 Mark]

1. Answer with True/False


a. It is feasible to implement the deterministic finite automata (DFA) practically.(T)

b. In automata theory “Un-decidable” means that program to solve the problem is available but solution

is not fast.(F)

c. If L (M) is a language which is recognized by DFA M, then we can say that L (M) is a regular

language.(T)

d. A problem is said to be “un-decidable” if it is not possible to get the solution by using turning

machine (TM).(T)

e. The string "ababb" is chosen from binary alphabet ∑ = {0, 1}.(F)

f. ∑* denotes the set of all strings over an alphabet ∑.(T)

g. The set of all strings over an alphabet ∑ is denoted ∑* and ∑* = ∑0 U ∑1 U ∑2 U …(T)

h. Turing machines (TM) are deterministic.(T)

i. In Turing machine (TM), blank symbols on the tape indicate the boundary of data.(T)

j. Lambda transitions are not allowed in Turing machine (TM). (T)

k. Turing machine (TM) will halt if there are no possible transitions to follow. (T)

l. Input will be rejected in Turing machine (TM) in case of infinite loop. (T)

m. In Turing machine (TM), it is not possible that machine enter in infinite loop. (T)

n. Input will be accepted in Turing machine (TM) if machine enter to the infinite loop. (F)

o. In Turing machines (TM), the final state may have outgoing transition. (F)

p. In Turing machine (TM), head starts at the rightmost position of the input string. (F)

q. A string “NajraN” can be defined from the regular expression [A-Z] [a-z] *[ ][A-Z][A-Z].(F)

Page 1 of 4
r. If Σ = {a, b, c} then string “abac” can be generated by regular expression ab* + c. (F)

s. If language L1 = {ε, 11, 010, 0} and language L2 = {00, 11, 111} then L1 U L2 = { ε, 0, 11, 11,

010, 111} (F)

t. If Σ = {a, b}, then the regular expression (ab)+ represents the language {ε, a, b, aba, bab, ……}(F)

u. Regular expression (RE) is used to define regular languages. (T)

v. If “01” and “101” are regular expressions, then 01 + 101 is a regular expression, and language

L(01 + 101) = L (01) U L (101). (T)

w. If Σ = {0, 1} then string “0100” can be generated by regular expression 01(0|1)*. (T)

x. If language L1 = {ε, 01, 010, 0 } and language L2 = {00, 11} then concatenation of L1 and L2 =

{00, 11, 0100, 0111, 01000, 01011, 000, 011}.(T)

2. Select the best possible option from option list.


1. A string is a:
a. Finite set of symbols.
b. Finite sequence of symbols.
c. Finite set of words.
d. Finite set of sentences.

2. Which of the following does not belong to Deterministic Finite Automata (DFA)
a. A finite set of input symbols.
b. A Finite set of states,
c. A start states.
d. δ the transition function that takes a state in Q and an input symbol in ∑ as argument and return a
subset of Q.
3. An alphabet is a:
a. Finite set of symbols.
b. Finite sequence of symbols.
c. Finite set of words.
d. Finite set of sentences.

4. Which one of the following string does not belong to binary alphabet?
a. 011010.
b. 210101.
c. 111010.
d. 100001.

Page 2 of 4
5. Which of the following is a not a part of 5-tuple finite automata?
a. Input alphabet
b. Transition function
c. Initial State
d. Output Alphabet

6. Transition function maps.


a. Σ * Q Σ
b. Q * Q Σ
c. Σ * Σ Q
d. Q * Σ Q

7. Which statement does not belong to PDA?


a. Stack in PDA is used to store string of “input symbols”.
b. Transition function in PDA takes three arguments.
c. ε-transitions are possible in PDA.
d. One of the output of transition function in PDA is string of stack symbols.

8. Consider the grammar G with grammar rules;


E→E+B|b
B→a|c|f

Which of the following strings can be generated by this grammar?


a. ba.
b. b + a + b + d.
c. a + c.
d. b + a + c + f.

9. Consider the following transition in Pushdown Automata (PDA).

Which option will be true for the above transition?


a. Pop symbol “c”
b. Push symbol “b”
c. Pop symbol “b”
d. Input symbol “b”

10. In Push down automata head always starts at the………


a. Leftmost position of string.
b. In between of string.
c. Head not used in PDA.
d. Rightmost position of string.

11. What will be the top of stack in PDA after transition from q1 to q2

Page 3 of 4
a. p
b. s
c. c
d. q

12. A language is considered context free if it is accepted by


a. DFA
b. PDA
c. LBA
d. Turing machine

13. The maximum number of transitions which can be performed over a state in a DFA?
∑= {0, 1}
a. 1
b. 2
c. 3
d. 4

14. A push down automaton employs data structure.


a. Queue
b. Linked List
c. Hash Table
d. Stack

15. A string is accepted by a PDA when


a. Stack is not empty
b. Acceptance state
c. All of the mentioned
d. None of the mentioned

16. If the PDA does not stop on an accepting state and the stack is not empty, the string is:
a. Rejected
b. goes into loop forever
c. all of the mentioned
d. none of the mentioned

17. Suppose A->xBz and B->y, then the simplified grammar would be:
a. A->xyz
b. A->xBz|xyz
c. A->xBz|B|y
d. none of the mentioned

Page 4 of 4
18. The length of tape in Turing machine is……….. and the length of input language is………….:
a. Finite, infinite
b. Finite, finite
c. Infiniti, finite
d. Infinite, infinite

19. d(q,X)=(r,Y,D) where D cannot be:

a. L
b. R
c. S
d. None of the mentioned

20. For S->0S1|e for ∑={0,1}*, which of the following is wrong for the language produced?
a. Non regular language
b. 0 n 1n | n>=0
c. 0 n 1 n | n>=1
d. None of the mentioned

3. Suppose we have three states q0, q1, and q2. Consider that q0 is start state and q2 is final state. Consider the
following transition functions;
δ(q0, 0) =q1
δ(q0, 1) =q0
δ(q1, 0) =q2
δ(q1, 1) =q0
δ(q2, 0) =q2
δ(q2, 1) =q2

a. Make transition table for given transition functions.

b. Construct transition diagram for transition table defined in "a".

Page 5 of 4
c. Illustrate which type of language will be accepted by transition diagram defined in "b".

DFA accepts (0+1)*00(0+1)* or substring 00.

4. Construct NFA for 0 (1 0)* + 0 ( 1 0 1)*

5. Consider the following Non-deterministic finite automata (NFA).

Page 6 of 4
Construct the equivalent Deterministic Finite Automata (DFA) using subset construction method. Also show the
state transition table.

Page 7 of 4
6. Consider the regular expressions given in column one and recognize which string/type of string can be
generated from the strings given in column two for each regular expression.

Regular expression String/Type of Strings generated


Begin with one capital letter or underscore,
1111
1 [A-Z_ ] [0-9a-zA-Z_]* followed by one or more digits, letters and
underscore.
Begin with one capital letter or underscore,
[A-Z_ ]* [A-Za-z]+ 1
2

2 followed by zero or more digits, letters and


underscore.
Begin with one capital letter or underscore,
3 ab (a + b)+ ba followed by zero or more digits and
underscore.
Begin with zero or more capital letter or
4 *
(a + c + e) b (a + d) +
underscore, followed by one or more letters
and underscore.

5 (a + b + c )+ de ( d + f )* Begin with zero or more capital letter or


2
underscore, followed by one or more letters.
(b+c)*a(b+c)* All strings containing exactly one a
6 6

7 (aaa+b+c)* All strings in which all runs of a's have lengths


7
that are multiples of three
8 a* | a* b a* ababbab
5
9 a* b (a | b)* bded

10 (a | b)* bbb abbabaa

Page 8 of 4
11 3
abaaaba

The set of strings over {a,b} that have at most


12 8
one b.

13 acaddd

The set of strings over {a,b} that end in 3


14 10
consecutive b's.
15 4
abddd

The set of strings over {a,b} that have at least


16 9
one b.
`
7. Design a DFA that accepts a+ b (a | b) * ba over the language ∑ = {a, b}.

8. Design a Pushdown Automata (PDA) from following transition functions. (Consider q0 is start state and q3 is

final state).

Page 9 of 4

You might also like