# Model Question Paper

Subject Code: MC 0082
Subject Name: Theory of computer science
Credits: 4 Marks: 140

Part A (One mark questions)

1. A ______ is a collection of objects in which we can say whether a given object is in the
collection.
a. Property
b. Data
c. set
d. Elements

2. The members of a set are called _______
a. Element
b. Sub set
c. Special set
d. Proper subset

3. A set A is said to be a _________ of B if there exists an element of B which
is not an element of A.
a. Proper subset
b. Special sets
c. Sub set
d. None of the above

4. A relation is said to be an _______________________ if it is
reflexive, symmetric and transitive.
a. Congruence relation
b. Binary relation
c. N-ary relation
d. equivalence relation

5. If x and y are rational numbers then x + y ________.

a. Is rational
b. Is not rational
c. It can be or can't be
d. None of the above

6. Binary tree of height n has at most _____ leaves.
a. 2n
b. 2
c. 2n
d. n2
7. A tree G with „n‟ vertices has ______ edges.
a.(n - 1) (n+ 1)
b. (n - 1)
c. (n +1)
d. n
8. which principle can be described by the given statement:
If A and B are finite sets and | A | > | B |, then there is no one-to-one function from A to B."
a .Proof by induction

c. The Pigeonhole Principle
d. The Diagonalization Principle

9. If there is more than one edge associated with a given pair of vertices, then these edges are called
___________
b. Non-parallel edges
c. Parallel edges
d. Diagonal edges

10. Graph containing either parallel edges or loops is referred as ____________
a. Simple Graph
b. General Graph.
c. Undirected Graph
d. Line Graphs

11. If a vertex v is an end vertex of some edge e, then v and e are said to be ________ with (or on, or to)
each other.
a.incident
b.Similar
d.Different

12. The sum of the degrees of the vertices of a graph G is ______________ the number of edges
a.3 times
b. 4 times
c. twice

d. one time

13. A simple method of specification which satisfies this requirement uses a generative device is referred
as ___________.
a. string
b. alphabet.
c. Variables
d. Grammar

14. A grammar in which there are no restrictions on its productions is called ____________
a. type – 0 grammar or unrestricted grammar
b. context sensitive grammar.
c. context free grammar.
d. Type 3 grammar

15. A grammar that contains only productions of the form where is called
_______________
a. context free grammar.
b. context sensitive grammar.
c. type – 0 grammar or unrestricted grammar
d. Type 3 grammar

16. The theory of formal languages exclusively involves the study of the language syntax and this theory
incepts from the works of well-known_____________
a.Ben Chifley
b.Teodoro Agoncillo
c. Noam Chomsky.
d.Renato Constantino
| o ÷ | o s

17. The main part of the machine itself is a “black box” , this black box - called the____________
A .Infinite control
b. initial state
c. finite control
18. ____________may take into consideration only the current input or both the current input and the
current state for determining the next output.
a .Input relation
b. States
c. State relation
d. output relation

19. The symbol E used for _______
a. Input alphabet
b. Output alphabet
c. States
d. Submission of stages

20. A finite directed labeled graph in which each node or vertex of the graph represents a state and the
directed edges from one node to another represent transition of a state is called_____________
a.Transition graph
b.Line Graph
c.Area Graph
d.Waterfall chart

21. There may be several possible next states for each of input value and state. Such
machines are called ____________
a. Deterministic
b. Nondeterministic
c. Finite Automata
d. None of the above

22. Which of the following is not the property of nondeterministic finite automata
a. o(q, .) = (q, .) = q
b. o(q, wa) = o( (q, w), a) = Aj
c. o(q, aw) = (o(q, a), w) = Aq,
d. o(q, wa) = o( (q, w), a)

23. An_________ is a system that performs some specific tasks without the direct intervention
of a human being.
a. automata
b. Machine
c. Transition function
d. States

24. In a moore machine,which one is the correct symbol for output alphabet
a. E
b. A
c. o
d. µ
.
o
.
o
.
o
.
o

25. ______________ are used to represent a set of strings, include symbols that are arranged
using certain syntax rules.
a. Regular expressions
b. Fuzzy regular expression
c. Pattern matching
d. General Expression

26. The___________ of a regular expression is also a regular expression
a. Submission
b. iteration
c. differentiation
d. Production

27. Which is a regular expression indicates the language containing an empty string.
a.{a}
b..
c.|
d. a
28. "Define the meaning of the given expression
(a+b)* (a + bb)"
a.Set of strings consisting of at least one „a‟ followed by string consisting of at least one „b‟
followed by string consisting of at least one „c‟.
b.Set of strings of a‟s and b‟s having a sub string aa.
c.Set of strings of a‟s and b‟s ending with either a or bb

d. ab(a+b)*

29. _____________ language is that language for which a FA cannot be constructed.
a. A regular
b. A non-regular
c. Formal language
d. Determinative

30. Which of the following is not the non-regular languages :-
a. {w e {0, 1} w contains an equal number of 0‟s and 1‟s}
b. {0
n
1
n
e {0, 1}* | n > 0}
c. {a
p
e {a}* | p > 2 is a prime number}
d. None of the above

31. Let E = {0, 1}, E = {0, 1, 2} and f(0) = 01, f(1) =112. and f(010)= 0111201. Write the
homomorphic image of L = {00, 010}.
a. L(00, 010) = L(0101, 0111201).
b. L(00, 010) = L(0111201, 0101 ).
c. L(00, 010) = L(0000, 0111201).
d. L(00, 010) = L(0100, 0111000).

32. Suppose there are n objects and m boxes where number of objects n, are greater than
number of boxes m. In this case, if all n objects are placed into m boxes, then at least one box
will have more than one object. This principle is called__________________

a. DFA
b .homomorphism
c. Pigeonhole principle
d. Pumping Lemma
33. CFL stands for________
a. Concept full language
b.context free language
c. context full language
d. Concept free language

34. We can context free grammar as a____________
a. type 0 grammar
b. type 1 grammar
c. type 2 grammar
d. type 3 grammar

35. In Backus – Naur Form (BNF) every non terminal symbol is enclosed in __________
a. Small brackets()
b. angle brackets < >.
c. Big brackets [ ]
d. Curly brackets { }

36. A ____________ is an ordered tree in which each vertex is labeled with the left sides of a
production and in which the children of a vertex represent its corresponding right sides
a. derivation tree

b. Binary Tree
c. B-Tree
d. Balanced Tree

37. By Pumping Lemma, it is assumed that string z e L is___________ and is context free
language
a.Infinite
b. finite
c.Empty
d.full

38. The Pumping Lemma for CFL‟s is used to prove that certain languages are __________ .
a. not context free
b. context free
c. finite
d. Infinite

39. According to the ________________turing machine can carry out any computation that can
also be carried out by a computer and human beings.
a. Alonzo Church
b. universal Turing machine
c. The Church-Turing theory
d. Alan Turing

40. The structure of the Turing machine is somewhat similar to the modern computer in which
the memory acts as the tape and the processor as _________

b. tape drive
c.memory drive
d.Hard disk

Part B (Two mark questions)

41. ____ describes connections between different elements of the same set, where as ________
describe connections between two different sets.
a. Function, Relation
b. Relation, functions
c. set, property
d. property, set

42. State whether the following statements are true of false.
1) If (a, b) is an element of the equivalence relation, then we write a ~ b .
2) Two sets A and B are said to be equal (denoted by A = B) if A is a subset of B, and B
is a subset of A.
a.1-T , 2-F
b.1-F , 2-T
c.1-T , 2-T
d.1-F , 2-F

43. Which of the following is not a type of special proof technique
a. Proof by induction

c. The pigeonhole principle
d. The alphanumaric Principle

44. The principle of mathematical induction states that any set of natural numbers containing__________,
and with the property that it contains__________ whenever it contains all the numbers up to and
including n, must in fact be the set of all natural numbers.
a. one,n+1
b. Zero, n + 1
c. Zero,n-1
d. Two,n

45. The vertices vi, vj associated with edge ek are called the __________ of ek. An edge
associated with a vertex pair {vi, vi} is called a _______.
a. Start vertices, Self-loop
b. End vertices,Self-loop
c. Self-loop, Start vertices
d. Self-loop, End vertices

46. 1. A connected graph is said to be _____________ if the removal of any one edge from the
graph provides a disconnected graph.
2. A tree in which one vertex is distinguished from all the other vertices, is called a
_____________

a. rooted tree, minimally connected
b. minimally connected, rooted tree
c. minimally disconnected, Free tree
d.free tree,minimally disconnected

47. The terms <noun>, <verb> and <adverb>, are known as _________ and the suitable words
that can sentences are known as __________.
a. terminals, variables
b. variables, terminals
c. sentences , String
d. String, sentences

48. Let x = 0100, y = 11. Find xy and yx.
a. xy = 110100, yx = 010011
b. xy = 010011, yx = 110100.
c. xy = 010000, yx = 110100.
d. xy = 010011, yx = 110111.

49. An automata system in which the output depends only on the present input is called a
____________and an automata system in which the output depends both on the present input
and the present state is called ____________.
a. State machine, Mealy machine
b. Moore machine , Mealy machine
c. Deterministic finite state machine, finite state machine
d. Finite state machine, deterministic finite state machine

50. Which of the following is not the quintuple of deterministic finite automata?
a. Q is non-empty, finite set of states.
B. E is non-empty, finite set of input alphabet.
c. q0 e Q is the end state.
d. F _ Q is set of accepting or final states.

51. NFA have 5 tuples like M = (Q, E, o, q0, F) ,according to the given tuples what is the correct
description of o
a. It is a non-empty, finite set of states.
b. It is non-empty, finite set of input alphabet.
c. is transition function, which is a mapping from Q × E
d.it is the start state.

52. State whether the following statements are true or false:-
1. A string is a sequence of symbols obtained from E.
2 . In NFA F _ Q is set of accepting or final states.
a.1-T , 2-F
b.1-F , 2-T
c.1-T , 2-T
d.1-F , 2-F
53. In turing machine model the data stored in the cells of the tape can be read and written by
Read/Write (R/W) head whose one end is connected with the _________ and the other end is
connected with the _________.
a.tape, Infinite control
b. Infinite control,tape
c. tape, finite control
d. finite control, Infinite control

54. "The Turing Machine can do:
1. Halt and accept by entering into final state.
2. Halt and reject. This is possible if the transition is not defined.

3. TM will never halt and enter into an infinite loop.
Which of the above given statement/s are not correct.

a.1 and 2
b. 2 and 3
c.1 and 3
d. All are correct
55. State whether the given language L = {a
n
b
n
c
n
n > 0} is context free or not
a .It is context free
b. It is not context free
c. Data insufficient
d .It is finite

56. Verify that the given language L = {a
n!
n > 0} is context free or not.
a. It is not context free
b. It is context free
c. Data insufficient
d. It is finite

57. The pop transition, also known as ___________transition, refers to the transition process in
which the PDA moves from the current state to a new state without reading any input symbol. It
can be represented as ___________
a. lambda , ai bi ì ÷ aj bj.
b. read , ai bi wj ÷ bi bj.
c. write , a0 b0 w1 ÷ a0 b1.
d. alpha, ai bi α ÷ aj bj.

58. State whether the following statements are true or false for the construction of pushdown
automata .
1. Get the final state from the start state.
2. Get an empty stack from the start state
a.1-T , 2-F
b.1-F , 2-T
c.1-T , 2-T
d.1-F , 2-F

59. Which of the following description is not correct for context free grammar?
A grammar G is a quadruple G = (V
N
, V
T
, u, S), where
1. V
N
is set of variables or non-terminals
2. V
T
is set of productions
3. u is set of terminals symbols
4. S is the start symbol,
a. 1 and 2
b. 2 and 4
c. 2 and 3
d. 1,2 and 3

60. Consider the grammar
Where

These productions can be written in BNI notation as:
{ } { } ( )
, , , , , , G S A B a b S = u
: , , , . S aB A aB B bA B b u ÷ ÷ ÷ ÷

"
a.

b. <S> :: = b<B>
<B>::=b<B>
<A>::=a<B>\a
c. <S> :: = b<A>
<B>::=b<B>
<A>::=a<B>\b
d. <S> :: = b<a>
<B>::=b<a>
<B>::=a<B>\a

Part C (Four mark questions)

61. Which of the following is not the right way to describe set

1. Describe a set by describing the properties of the members of the set.
2. Describe a set by listing its elements.
3. Describe a set A by its characteristic function, defined as
µA(x) = 1 if x € A
= 0 if x e A
for all x in U, where U is the universal set, sometimes called the “universe of discourse ,” or just
universe.
4. Don't describe a set by recursive formula.
5. Describe a set by an operation (say union, intersection, complement etc) on some other sets.
a. 1,2 only
b. 4 only
c. 3 only
d. 4,5 only

::
::
:: |
S a B
A a b
B b A b
< > = < >
< > = < >
< > = < >

62. "State whether the following statements are true or false:-
1. √2 is a rational number.
2. According to the principle of mathematical induction
for all positive integer n.
3. for any finite set A, the cardinality of the power set of A is 2 raised to a power equal to the
cardinality of A.”

a. 1-T,2-T,3-T
b. 1-T,2-T,3-F
c. 1-T,2-F,3-T
d. 1-F,2-T,3-T

63. "State whether the following statements are true or false:-
1. The number of edges incident on a vertex v is called the degree of v.
2.The number of vertices of odd degrees is always odd.
3. A connected graph without circuits is called a tree."
a. 1-T,2-T,3-T
b.1-T,2-T,3-F
c.1-T,2-F,3-T
d.1-F,2-T,3-T

64. Find the language for the grammar.
where the set of productions
a. L(G) = {0,00,000,0000,- - - - - - - -}
: 11 , 0. S S S u ÷ ÷
{ } { } ( )
0,1 , , ,
T N
G V V S S = = = u
{ } ( ) 0, 110 ,11110, 1111110, L G = ÷ ÷ ÷ ÷ ÷

b.
c. L(G) = {0,10,100,1000,- - - - - - - -}
d. L(G) = {0,01,001,0001,- - - - - - - -}

65. Draw a DFA to accept strings of a‟s and b‟s with even number of a‟s and even
number of b‟s. Also find the language accepted by DFA.

a. The language accepted by DFA is
L = {w | w € (a + b)* and total number of strings in both a and b are even}.

b. Obtain a DFA to accept strings of a‟s and b‟s with at most two consecutive b‟s.

c.The language accepted by DFA can be represented as L = {w | w € 00(0+1)*11}

d. language L = {w / |w | mod 5 ≠ 0} on ∑ = {a, b}.

66, Arrange the following steps of conversion of mealy machine into moore Machine into a proper
sequence
step 1:-For a state qi determine the number of different outputs that are available in u state table of the
Mealy machine.
Step 2:- Rearrange the states and outputs in the format of a Moore machine. The common output of the
new state table can be determined by examining the outputs under the next state columns of the original
Mealy machine.
Step 3:- If the outputs corresponding to state qi in the next state columns are same, then retain state qi as
it is. Else, break qi into different states with the number of new states being equal to the number of
different outputs of qi.
Step 4:-If the output in the constructed state table corresponding to the initial state is 1, then this specifies
the acceptance of the null string . by Mealy machine.
a.1,2,3,4
b.1,2,3,4

q
1

a
a
a

q
0

q
2

q
3

q
4

a a
a,
b

q
1

a
a
a

q
0

q
2

q
3

q
4

a a
a,
b

c.1,4,3,2
d.1,3,2,4

67. Obtain a left linear grammar for the DFA shown below.

a. the final left linear grammar is
G = (VN, VT, S, u), where
VN = {C, A, B}
VT = {0, 1}
The set of productions: C ÷ C1 B1
B ÷ B0 | A0 | C0
A ÷ A1 | .
b. The right linear grammar is given by
G = (VN, VT, S, u) where
VN = {S, A, B}
VT = {a, b}
The set of productions: S ÷ abA aabB .
A ÷ abA aabB .
B ÷ aabB abA
c. the grammar G is:
G = (VN, VT, S, u) where
VN = {S, A, B, C}
VT = {a, b}
The set of productions: S ÷ aA | bS .
A ÷ aA | bB .
B ÷ aA | bC .
C ÷ aC bC
d. G = (V
N
, V
T
, S, u), where
VN = {S, A, B, C}
VT = {a, b}
The set of productions: S ÷ aA bC
A ÷ aC bB
B ÷ aB bB .
C ÷ aC bC

68. According to pumping lemma verify that given languages are regular or
not:
1. L = {ww | w e {a, b}* }
2. L = {an | n = k2 for k > 0}
a. 1. Regular, 2. Not Regular
b. 1. Not Regular, 2. Regular
c. 1. Regular, 2. Regular
d. 1. Not Regular, 2. Not Regular

69. Let G = (V
N
, V
T
, u, S) be a CFG, where
V
N
= {S}
V
T
= {a, b}
u: S ÷ aSa bSb .
S: Starting symbol.
Find the language generated by this grammar.
a. L = {ww
R
w e {a}
*
}.
b. L = {ww
R
w e {a + b}}.
c. L = {ww
R
w e {a + b}
*
}.
d. L = {ww
R
w e {b + b}}.

70. Obtain a Context free grammar on {a, b} to generate a language

L = {a
n
ww
R
b
n
w e E
*
, n > 1}.

a.The final grammar is
VN = (S}
VT = {a, b}
u: S ÷ aSb aAa
A ÷ aAa bAa ., and
S is the start symbol.
b.The final grammar is
VN = (S}
VT = {a, b}
u: S ÷ bSb aAb
A ÷ bAa bAb ., and
S is the start symbol.
c.The final grammar is
VN = (S}
VT = {a, b}
u: S ÷ aSb aAb
A ÷ aAa bAb ., and
S is the start symbol.
d.The final grammar is
VN = (S}
VT = {a, b}
u: S ÷ aSb A
A ÷ aAa | ., and
S is the start symbol.

71. Obtain the context free grammar for the regular expression
(011 + 1)
*
(01)
*
.
a. Therefore, the final grammar G = (V
N
, V
T
, u, S), where
V
N
: {S, A, B}
V
T
: {0, 1}
u: S ÷ AB,
A ÷ 011A 1A .
B ÷ 01B .
S : start symbol.

b. Therefore, the final grammar G = (V
N
, V
T
, u, S), where
V
N
: {S, A, B}
V
T
: {0, 1}
u: S ÷ AB,
A ÷ 111B 1A .
B ÷ 01B .
S : start symbol.

c. Therefore, the final grammar G = (V
N
, V
T
, u, S), where
V
N
: {S, A, B}
V
T
: {0, 1}
u: S ÷ AB,
A ÷ 110B 1A .
B ÷ 11B .
S : start symbol.

d. Therefore, the final grammar G = (V
N
, V
T
, u, S), where
V
N
: {S, A, B}
V
T
: {0, 1}
u: S ÷ AB,
A ÷ 101B 1A .
B ÷ 00B .
S : start symbol.

72. Match the following states in a graph to the corresponding notations:
Sates
1. The states of the PDA correspond to the nodes
2. The start state of the PDA
3. The nodes of the graph
Notations
a. circles

b. arrow
c. two concentric circles "
a. 1-a, 2-b, 3-c
b. 1-b,2-c,3-a
c. 1-c, 2-b, 3-a
d. 1-b, 2-a, 3-c

73. State whether the following statements are true or false:-
1. Context free languages are closed under stat-closure.
2. The context free languages are not closed under complementation.
3. If L1 and L2 are context free languages, then L1 € L2 is also a context free language. "
a. 1-T,2-T,3-T
b. 1-T,2-T,3-F
c. 1-T,2-F,3-T
d. 1-F,2-T,3-T
74. Obtain a Turing machine to accept the language containing strings of 0’s and 1’s ending with 011.
a. the TM to recognize the given language is given by
Q = {q0, q1, q2, q3}
E = {0, 1}
I = {0, 1, □}, o is defined above.
q0 is the start state
□ is the blank character
F = {q4} is the final character

b. the TM to recognize the given language is given by
Q = {q0, q1, q2, q3}
E = {0, 1}
G = {0, 1, □}, d is defined above.
q0 is the start state
□ is the blank character
F = {q4} is the final character

c. the TM to recognize the given language is given by
Q = {q0, q1, q2, q4}
E = {0, 1}
I = {0, 1, □}, o is defined above.
q0 is the start state
□ is the blank character
F = {q3} is the final character

d. the TM to recognize the given language is given by
Q = {q0, q2, q3, q4}
E = {0, 1}
I = {0, 1, □}, o is defined above.
q1 is the start state
□ is the blank character
F = {q2} is the final character

75. State whether the following statements are true or false:-
1. Instantaneous Description refers to the operating state of the Turing machine and turing machine
includes the current state of the machine .
2. The Turing machine is a state machine that consists of a finite number of states
3. The transition diagram consists of nodes corresponding to the states of Turing Machine.
a. 1-T,2-T,3-T
b.1-T,2-T,3-F
c.1-T,2-F,3-T
d.1-F,2-T,3-T

Part - A Part - B Part - C
Q. No. Ans. Key Q. No. Ans. Key Q. No. Ans. Key Q. No. Ans. Key
1 C 21 B 41 B 61 B
2 A 22 D 42 C 62 D
3 A 23 A 43 D 63 C
4 D 24 B 44 B 64 B
5 A 25 A 45 B 65 A
6 C 26 B 46 B 66 D
7 B 27 B 47 B 67 A
8 C 28 C 48 B 68 D
9 C 29 B 49 B 69 C
10 B 30 D 50 C 70 C
11 A 31 A 51 C 71 A
12 C 32 C 52 C 72 A
13 D 33 B 53 C 73 B
14 A 34 C 54 D 74 A
15 B 35 B 55 B 75 A
16 C 36 A 56 A
17 C 37 B 57 A
18 D 38 A 58 C
19 A 39 C 59 C
20 A 40 A 60 A