101. The set A={anbncn/n=1,2,3,…} is an example of
Regular language
Non context free language
Context free language
None of these
Show me the answer
Answer: 2. Non context free language
Explanation:
The language A={anbncn/n=1,2,3,…} is not context-free as it requires matching counts of a's, b's, and c's.
102. The intersection of CFL and a regular language
Need not be regular
Is always regular
Need not be context free
None of these
Show me the answer
Answer: 2. Is always regular
Explanation:
The intersection of a context-free language (CFL) and a regular language is always context-free.
103. Choose the correct statements:
The power of DFSM and NDFSM are same.
The power of DFSM and NDFSM are different.
The power of DPDM and NDPDM are different.
Both (A) and (C) above.
Show me the answer
Answer: 4. Both (A) and (C) above.
Explanation:
Deterministic and non-deterministic finite state machines (DFSM and NDFSM) are equivalent in power, while deterministic and non-deterministic pushdown automata (DPDM and NDPDM) are not.
104. Which of the following is accepted by an NDPDM but not by a DPDM?
All strings in which a given symbol is present at least twice
Even palindromes.
Strings ending with a particular alphabet.
None of these.
Show me the answer
Answer: 2. Even palindromes.
Explanation:
Even palindromes are accepted by non-deterministic pushdown automata (NDPDM) but not by deterministic pushdown automata (DPDM).
105. Bounded minimization is a technique for
Proving whether a promotive recursive function is Turing computable or not.
Providing whether a primitive recursive function is a total function or not.
Bounded minimization is used to generate primitive recursive functions.
106. Universal Turing machine influenced the concept of
Stored program computers
Interpretive implementation of programming language
Computability
All of these
Show me the answer
Answer: 4. All of these
Explanation:
The Universal Turing Machine influenced the concepts of stored program computers, interpretive implementation of programming languages, and computability.
107. The statement "A Turing machine can't solve halting problem" is
True
Still at open question
False
All of these
Show me the answer
Answer: 1. True
Explanation:
The halting problem is undecidable, meaning no Turing machine can solve it.
108. If there exists a TM which when applied to any problem in the class, terminates, if the correct answer is yes and may or may not terminate otherwise is said to be
Stable
Partially solvable
Unstable
Unstable
Show me the answer
Answer: 2. Partially solvable
Explanation:
A problem is partially solvable if a Turing machine terminates for "yes" instances but may not terminate for "no" instances.
109. The vernacular language English, if considered a formal language is a
Regular language
Context sensitive language
Context free language
None of these
Show me the answer
Answer: 3. Context free language
Explanation:
English, as a formal language, is context-free.
110. P, Q, R are three languages, if P and R are regular and if PQ = R then
Q = R
Both A and B
Q = P
None of these
Show me the answer
Answer: 4. None of these
Explanation:
The relationship between P, Q, and R cannot be determined from the given information.
111. Consider the grammar
N
n + 1
2^n
2^{n-1}
Show me the answer
Answer: 4. 2^{n-1}
Explanation:
112. The following grammar
CFG
Context sensitive
Regular
None of these
Show me the answer
Answer: 2. Context sensitive
Explanation:
The grammar is context-sensitive as it allows for context-dependent productions.
Regular, regular
Regular, not regular
Not regular, regular
Not regular, not regular
Show me the answer
Answer: 2. Regular, not regular
Explanation:
114. Which of the following is not possible algorithmically?
Regular grammar to context free grammar
Non-deterministic finite state Automata to deterministic FSA
Non-deterministic PDA to deterministic PDA
None of these
Show me the answer
Answer: 3. Non-deterministic PDA to deterministic PDA
Explanation:
Converting a non-deterministic PDA to a deterministic PDA is not always possible algorithmically.
115. As FSM can be used to add two given integers. That is
True
False
May be true
None of these
Show me the answer
Answer: 2. False
Explanation:
Finite state machines (FSMs) cannot perform arithmetic operations like addition.
Show me the answer
Explanation:
117. In given fig
Both are equivalent
The first FSM accepts nothing
None of these
Show me the answer
Answer: 4. None of these
Explanation:
118. The number of tokens in the Fortran statement DO 10 I = 1.25 is
3
4
5
None of these
Show me the answer
Answer: 4. None of these
Explanation:
The number of tokens in the statement is 6.
119. The word 'formal' in formal languages means
The symbols used have well-defined language meaning
They are unnecessary in reality
Only the form of the string of symbols is significant
None of these
Show me the answer
Answer: 3. Only the form of the string of symbols is significant
Explanation:
In formal languages, the structure (form) of the string is significant, not the meaning.
Show me the answer
Explanation:
121. A mealy machine
May be machine
Has an equivalent more
Only context-free grammar
All of these
Show me the answer
Answer: 2. Has an equivalent more
Explanation:
A Mealy machine has an equivalent Moore machine.
122. The recognizing capability of NDFSM and DFSM
May be different
Must be same
Must be different
None of these
Show me the answer
Answer: 2. Must be same
Explanation:
Non-deterministic finite state machines (NDFSM) and deterministic finite state machines (DFSM) have the same recognizing capability.
123. Which of the following are not regular
String of 0's whose length is a perfect square
Set of all palindromes made up of 0's and 1's
Strings of 0's, whose length is a prime number
All of these
Show me the answer
Answer: 4. All of these
Explanation:
None of the given languages are regular.
124. Which of the following pairs of regular expressions are equivalent?
All of these
Show me the answer
Answer: 4. All of these
Explanation:
All the given pairs of regular expressions are equivalent.
125. The logic of pumping Lemma is a good example of
The pigeon-hole principle
The divide and conquer technique
Recursion
Iteration
Show me the answer
Answer: 1. The pigeon-hole principle
Explanation:
The Pumping Lemma is based on the pigeon-hole principle.
126. The FSM pictured shown in the figure
Mealy machine
Kleene machine
Moore machine
None of these
Show me the answer
Answer: 1. Mealy machine
Explanation:
The FSM represents a Mealy machine as its output depends on both the current state and input.
127. The above machine
Complements a given bit pattern
Generates all strings of 0's and 1's
Adds 1 to a given bit pattern
None of these
Show me the answer
Answer: 1. Complements a given bit pattern
Explanation:
The machine complements a given bit pattern.
128. The language of all words with at least 2a's can be described by the regular expression
All of these
Show me the answer
Answer: 4. All of these
Explanation:
All the given regular expressions describe the language of words with at least 2a's.
129. For the following figure
Complements a given bit pattern
Finds 2's complement of a given bit pattern
Increment a given bit pattern by 1
Change the sign bit
Show me the answer
Answer: 3. Increment a given bit pattern by 1
Explanation:
The machine increments a given bit pattern by 1.
130. For which of the following applications regular expression can't be used?
Designing compilers
Simulating sequential circuits
Developing text editors
All of these
Show me the answer
Answer: 2. Simulating sequential circuits
Explanation:
Regular expressions are not suitable for simulating sequential circuits.
131. The following CFG
All of these
Show me the answer
Answer: 4. All of these
Explanation:
The CFG is equivalent to all the given regular expressions.
132. Any string of terminals that can be generated by the following CFG
Has at least one b
Has no consecutive a's or b's
Should end in an 'a'
Has at least two a's
Show me the answer
Answer: 4. Has at least two a's
Explanation:
The CFG generates strings with at least two a's.
133. The following CFG
Equal number of a's and b's
Odd number of a's and odd number of b's
Even number of a's and number of b's
Odd number a's and een number of a's
Show me the answer
Answer: 1. Equal number of a's and b's
Explanation:
The CFG generates strings with an equal number of a's and b's.
Show me the answer
Explanation:
135. Which of the following CFG's can't be simulated by an FSM?
None of these
Show me the answer
Explanation:
136. CFG is not closed under
Union
Complementation's
Kleene star
Product
Show me the answer
Answer: 2. Complementation's
Explanation:
Context-free grammars (CFGs) are not closed under complementation.
Regular
Not context free
Context-free
None of these
Show me the answer
Answer: 2. Not context free
Explanation:
138. Let
None of these
Show me the answer
Explanation:
139. The intersection of a CFL, and a regular language
Need not be regular
Is always regular
Need not be context free
None of these
Show me the answer
Answer: 3. Need not be context free
Explanation:
The intersection of a context-free language (CFL) and a regular language is always context-free.
140. A PDM behave lie an FSM when the number of auxiliary memory it has is
0
1
2
None of these
Show me the answer
Answer: 1. 0
Explanation:
A pushdown automaton (PDM) behaves like a finite state machine (FSM) when it has no auxiliary memory (stack).
141. CSG can be recognized by a
FSM
NDPDM
DPDM
Linearly bounded memory machine
Show me the answer
Answer: 4. Linearly bounded memory machine
Explanation:
Context-sensitive grammars (CSG) are recognized by linearly bounded memory machines.
142. An FSM with
A stack is more powerful than a FSM with no stack.
2 stacks is more powerful than a FSM 1 stack
Both (A) and (B) above
None of these
Show me the answer
Answer: 3. Both (A) and (B) above
Explanation:
Adding stacks to an FSM increases its computational power.
143. Recursive languages are
Closed under intersection
Closed under complementation
Recursively enumerable
All of these
Show me the answer
Answer: 4. All of these
Explanation:
Recursive languages are closed under intersection, complementation, and are recursively enumerable.
Even
Odd
Null
None of these
Show me the answer
Answer: 1. Even
Explanation:
One to one not onto
Not one to one and not onto
One to one and onto
Not one to one and onto
Show me the answer
Answer: 1. One to one not onto
Explanation:
Show me the answer
Explanation:
147. What is the highest type number which can be applied to the following grammar
Type0
Type1
Type2
Type3
Show me the answer
Answer: 4. Type3
Explanation:
The grammar is of Type 3 (regular grammar).
None of these
Show me the answer
Explanation:
149. Which string recognize it?
Information is not complete
Show me the answer
Answer: 4. Information is not complete
Explanation:
The question lacks sufficient information to determine the correct answer.
150. Regular expression corresponding to the state diagram given in below figure
Show me the answer
Explanation:
Regular
Accepted by DFA
Not regular
Accepted by PDA
Show me the answer
Answer: 3. Not regular
Explanation:
152. Regular expression corresponding to the automata given in figure below are:
Show me the answer
Explanation:
LR(1) not in LR(0)
LR(0) but not in LR(1)
Both LR(0) and LR(1)
Neither LR(0) nor in LR(1)
Show me the answer
Answer: 1. LR(1) not in LR(0)
Explanation:
The grammar is LR(1) but not LR(0).
Regular language
Context-free language
Context-sensitive language
Recursively enumerable language
Show me the answer
Answer: 3. Context-sensitive language
Explanation:
None of these
Show me the answer
Explanation:
156. Which of the following CFG's can't be simulated by an FSM?
None of these
Show me the answer
Explanation:
Regular language
Non context free language
Context free language
None of these
Show me the answer
Answer: 2. Non context free language
Explanation:
158. The intersection of CFL and a regular language
Need not be regular
Is always regular
Need not be context free
None of these
Show me the answer
Answer: 2. Is always regular
Explanation:
The intersection of a context-free language (CFL) and a regular language is always context-free.
159. Choose the correct statements:
The power of DFSM and NDFSM are same.
The power of DFSM and NDFSM are different.
The power of DPDM and NDPDM are different.
Both (A) and (C) above.
Show me the answer
Answer: 4. Both (A) and (C) above.
Explanation:
Deterministic and non-deterministic finite state machines (DFSM and NDFSM) are equivalent in power, while deterministic and non-deterministic pushdown automata (DPDM and NDPDM) are not.
160. Which of the following is accepted by an NDPDM but not by a DPDM?
All strings in which a given symbol is present at least twice
Even palindromes.
Strings ending with a particular alphabet.
None of these.
Show me the answer
Answer: 2. Even palindromes.
Explanation:
Even palindromes are accepted by non-deterministic pushdown automata (NDPDM) but not by deterministic pushdown automata (DPDM).
S→PQ/SQ/PSP→X,Q→Y
To get string of n terminals, the number of productions to be used is
The number of productions required to generate a string of n terminals is 2n−1.
S→aab/bac/abS→abb/abS→aS/bB→bab/b
113. Let A={0,1} and L=A∗. Let R={0n,n>0} then the language L∪R and R are respectively.
L∪R is regular, while R is not regular.
116. A grammar is said to be in CNF, if all the productions are of the form A→BC or A→a. Let G be a CFG in CNF. To derive a string of terminals of length x, the number of production to be used is
2x−1
2x
2x+1
2x
Answer: 1. 2x−1
In Chomsky Normal Form (CNF), deriving a string of length x requires 2x−1 productions.
The second FSM accepts ϵ-only
The given FSMs are not equivalent, and neither accepts only ϵ.
120. If A={0,1}, the number of possible strings of length 'n' is
n!
n×n
nn
2n
Answer: 4. 2n
For alphabet A={0,1}, the number of possible strings of length n is 2n.
1(01)∗ and (10)∗
y+ and y∗y+
Y(yy)∗ and (yy)∗y
(a+b)∗a(a+b)∗a(a+b)∗
b∗a∗b∗a(a+b)∗
(a+b)∗ab∗a(a+b)∗
S→xS/yS/x/y
Is equivalent to the regular expression
(x+y)∗
(x+y)∗(x+y)
(x+y)(x+y)∗
S→ABA→aA/bB/aB→Ba/Bb/a
S→aB/bAA→b/aS/bAAB→b/bs/aBB
Generates strings of terminals that have
134. The set {anbn/n=1,2,…} can be generated by a CFG
S→ab/aSb
S→ab/aSb/ϵ
S→aSbb/ab
S→aSbb/ab/aabb
Answer: 1. S→ab/aSb
The CFG S→ab/aSb generates the set {anbn/n=1,2,…}.
S→Sa/a
S→a/X,X→cY,Y→−d/aX
S→aSb/ab
Answer: 3. S→aSb/ab
The CFG S→aSb/ab generates a non-regular language and cannot be simulated by an FSM.
137. The set A={anbncn/n=1,2,3,…} is an example of a grammar that is
The language A={anbncn/n=1,2,3,…} is not context-free.
L1={anbnam/n,m=1,2,3,…}L2={anbmam/n,m=1,2,3,…}L3={anbncn/n=1,2,3,…}
Of the following the correct answer is
L3=L1∩L2
L1 and L2 are not CFL, but L3 is CFL
L1 is a subset of L3
Answer: 1. L3=L1∩L2
The language L3 is the intersection of L1 and L2.
144. If ω∈(a,b)∗ satisfy abω=ωab then ′ω′ is
The string ω must be even in length to satisfy the equation abω=ωab.
145. Let f:(a,b)∗→(a,b)∗ be given by f(n)=ax for every value of n∈{a,b} then f is
The function f is one-to-one but not onto.
146. Let if G=({S},{a},{S→SS},S), find language generated by G
L(G)=ϕ
L(G)=a∗
L(G)=an
L(G)=anban
Answer: 2. L(G)=a∗
The grammar generates the language a∗.
Sφ→Aa;A→Ba,B→abc
148. Construct a grammar to generate {(ab)n/n≥1}∪{(ba)n/n≥1}