computer-nec-license
  • NEC-Computer
  • 1. Concept of Basic Electrical and Electronics Engineering
    • 1.1 Basic Concepts
    • 1.2 Network Theorems
    • 1.3 Alternating Current Fundamentals
    • 1.4 Semiconductor Device
    • 1.5 Signal Generator
    • 1.6 Amplifiers
    • MCQs
      • MCQs On Basic Electrical
        • set-1
        • set-2
      • MCQs On Basic Electronics
        • set-1
        • set-2
  • 2. Digital Logic and Microprocessor
    • 2.1 Digital Logic
    • 2.2 Combinational & Arithmetic Circuit
    • 2.3 Sequential Logic Circuits
    • 2.4 Microprocessor
    • 2.5 Microprocessor System
    • 2.6 Interrupt Operations
    • MCQs
      • MCQs On Digital Logic
        • set-1
        • set-2
        • set-3
        • set-4
        • set-5
        • set-6
        • set-7
        • set-8
        • set-9
        • set-10
        • set-11
        • set-12
      • MCQs On Microprocessor
        • set-1
        • set-2
        • set-3
        • set-4
        • set-5
        • set-6
        • set-7
        • set-8
        • set-9
  • 3. Programming Language and Its Applications
    • 3.1 Introduction to C Programming
    • 3.2 Pointers, Structures, and Data Files
    • 3.3 C++ Language Constructs with Objects and Classes
    • 3.4 Features of Object-Oriented Programming
    • 3.5 Pure Virtual Functions and File Handling
    • 3.6 Generic Programming and Exception Handling
    • MCQs
      • set-1
      • set-2
      • set-3
      • set-4
      • set-5
  • 4. Computer Organization and Embedded System
    • 4.1 Control and CPU
    • 4.2 Computer Arithmetic and Memory System
    • 4.3 I/O Organization and Multiprocessor
    • 4.4 Embedded System Design
    • 4.5 Real-Time Operating and Control Systems
    • 4.6 Hardware Description Language (VHDL) and IC Technology
    • MCQs
      • set-1
      • set-2
      • set-3
      • set-4
      • set-5
      • set-6
      • set-7
      • set-8
      • set-9
      • set-10
      • set-11
  • 5. Concept of Computer Network and Network Security System
    • 5.1 Introduction to Computer Networks
    • 5.2 Data Link Layer
    • 5.3 Network Layer
    • 5.4 Transport Layer
    • 5.5 Application Layer
    • 5.6 Network Security
    • MCQs
      • Basic Networking
        • set-1
        • set-2
      • Advanced Networking
        • set-1
        • set-2
        • set-3
        • set-4
        • set-5
        • set-6
  • 6. Theory of Computation and Computer Graphics
    • 6.1 Introduction to Finite Automata
    • 6.2 Introduction to Context-Free Languages (CFL)
    • 6.3 Turing Machines (TM)
    • 6.4 Introduction to Computer Graphics
    • 6.5 Two-Dimensional Transformation
    • 6.6 Three-Dimensional Transformation
    • MCQs
      • MCQs on Theory of Computation
        • set-1
        • set-2
        • set-3
      • MCQs On Computer Graphics
        • set-1
        • set-2
        • set-3
        • set-4
        • set-5
        • set-6
  • 7. Data Structures and Algorithm, Database System and Operating System
    • 7.1 Introduction to Data Structures, Lists, Linked Lists, and Trees
    • 7.2 Sorting, Searching, Hashing and Graphs
    • 7.3 Introduction to Data Models, Normalization, and SQL
    • 7.4 Transaction Processing, Concurrency Control, and Crash Recovery
    • 7.5 Introduction to Operating System and Process Management
    • 7.6 Memory Management, File Systems, and System Administration
    • MCQs
      • MCQs ON DSA
        • set-1
        • set-2
        • set-3
        • set-4
        • set-5
        • set-6
      • MCQs On DBMS
        • set-1
        • set-2
      • MCQs On Operating System
        • set-1
        • set-2
        • set-3
        • set-4
        • set-5
        • set-6
        • set-7
        • set-8
        • set-9
        • set-10
        • set-11
        • set-12
  • 8. Software Engineering and Object-Oriented Analysis & Design
    • 8.1 Software Process and Requirements
    • 8.2 Software Design
    • 8.3 Software Testing, Cost Estimation, Quality Management, and Configuration Management
    • 8.4 Object-Oriented Fundamentals and Analysis
    • 8.5 Object-Oriented Design
    • 8.6 Object-Oriented Design Implementation
    • MCQs
      • set-1
      • set-2
      • set-3
      • set-4
      • set-5
      • set-6
      • set-7
      • set-8
      • set-9
  • 9. Artificial Intelligence and Neural Networks
    • 9.1 Introduction to AI and Intelligent Agents
    • 9.2 Problem Solving and Searching Techniques
    • 9.3 Knowledge Representation
    • 9.4 Expert System and Natural Language Processing
    • 9.5 Machine Learning
    • 9.6 Neural Networks
    • MCQs
      • set-1
      • set-2
      • set-3
      • set-4
      • set-5
      • set-6
      • set-7
      • set-8
      • set-9
  • 10. Project Planning, Design and Implementation
    • 10.1 Engineering Drawings and Its Concepts
    • 10.2 Engineering Economics
    • 10.3 Project Planning and Scheduling
    • 10.4 Project Management
    • 10.5 Engineering Professional Practice
    • 10.6 Engineering Regulatory Body
    • MCQs
      • MCQs On Engineering Drawing
        • set-1
        • set-2
      • MCQs On Engineering Economics
      • MCQs On Project Planning & Scheduling
      • MCQs On Project Mangement
      • MCQs On Engineering Professional Practice
      • MCQs On Engineering Regulatory Body
  • Questions Sets
    • Set 1 (Chaitra, 2080)
      • Short Questions (60*1=60 Marks)
      • Long Questions (20*2=40 Marks)
    • Set 2 (Aasadh, 2081)
      • Short Questions (60*1=60 Marks)
      • Long Questions (20*2=40 Marks)
    • Set 3 (Asojh, 2080)
      • Short Questions (60*1=60 Marks)
      • Long Questions (20*2=40 Marks)
    • Model Set - Computer Engineering By NEC
      • Short Questions (60*1=60 Marks)
      • Long Questions (20*2=40 Marks)
    • Model Set - Software Engineering By NEC
      • Short Questions (60*1=60 Marks)
      • Long Questions (20*2=40 Marks)
  • Tips & Tricks
Powered by GitBook
On this page
  1. 6. Theory of Computation and Computer Graphics
  2. MCQs
  3. MCQs on Theory of Computation

set-3

101. The set A={anbncn/n=1,2,3,…}A = \{a^n b^n c^n / n = 1, 2, 3, \ldots\}A={anbncn/n=1,2,3,…} is an example of

  1. Regular language

  2. Non context free language

  3. Context free language

  4. None of these

Show me the answer

Answer: 2. Non context free language

Explanation:

  • The language A={anbncn/n=1,2,3,…}A = \{a^n b^n c^n / n = 1, 2, 3, \ldots\}A={anbncn/n=1,2,3,…} is not context-free as it requires matching counts of aaa's, bbb's, and ccc's.

102. The intersection of CFL and a regular language

  1. Need not be regular

  2. Is always regular

  3. Need not be context free

  4. 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:

  1. The power of DFSM and NDFSM are same.

  2. The power of DFSM and NDFSM are different.

  3. The power of DPDM and NDPDM are different.

  4. 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?

  1. All strings in which a given symbol is present at least twice

  2. Even palindromes.

  3. Strings ending with a particular alphabet.

  4. 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

  1. Proving whether a promotive recursive function is Turing computable or not.

  2. Providing whether a primitive recursive function is a total function or not.

  3. Generating primitive recursive functions.

  4. Generating partial recursive functions.

Show me the answer

Answer: 3. Generating primitive recursive functions.

Explanation:

  • Bounded minimization is used to generate primitive recursive functions.

106. Universal Turing machine influenced the concept of

  1. Stored program computers

  2. Interpretive implementation of programming language

  3. Computability

  4. 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

  1. True

  2. Still at open question

  3. False

  4. 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

  1. Stable

  2. Partially solvable

  3. Unstable

  4. 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

  1. Regular language

  2. Context sensitive language

  3. Context free language

  4. 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

  1. Q = R

  2. Both A and B

  3. Q = P

  4. 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

S→PQ/SQ/PSS \rightarrow PQ/SQ/PSS→PQ/SQ/PS P→X,P \rightarrow X,P→X, Q→YQ \rightarrow YQ→Y To get string of n terminals, the number of productions to be used is

  1. N

  2. n + 1

  3. 2^n

  4. 2^{n-1}

Show me the answer

Answer: 4. 2^{n-1}

Explanation:

  • The number of productions required to generate a string of nnn terminals is 2n−12^{n-1}2n−1.

112. The following grammar

S→aab/bac/abS \rightarrow aab/bac/abS→aab/bac/ab S→abb/abS \rightarrow abb/abS→abb/ab S→aS/bS \rightarrow aS/bS→aS/b B→bab/bB \rightarrow bab/bB→bab/b

  1. CFG

  2. Context sensitive

  3. Regular

  4. None of these

Show me the answer

Answer: 2. Context sensitive

Explanation:

  • The grammar is context-sensitive as it allows for context-dependent productions.

113. Let A={0,1}A = \{0,1\}A={0,1} and L=A∗L = A^*L=A∗. Let R={0n,n>0}R = \{0^n, n > 0\}R={0n,n>0} then the language L∪RL \cup RL∪R and RRR are respectively.

  1. Regular, regular

  2. Regular, not regular

  3. Not regular, regular

  4. Not regular, not regular

Show me the answer

Answer: 2. Regular, not regular

Explanation:

  • L∪RL \cup RL∪R is regular, while RRR is not regular.

114. Which of the following is not possible algorithmically?

  1. Regular grammar to context free grammar

  2. Non-deterministic finite state Automata to deterministic FSA

  3. Non-deterministic PDA to deterministic PDA

  4. 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

  1. True

  2. False

  3. May be true

  4. None of these

Show me the answer

Answer: 2. False

Explanation:

  • Finite state machines (FSMs) cannot perform arithmetic operations like addition.

116. A grammar is said to be in CNF, if all the productions are of the form A→BCA \rightarrow BCA→BC or A→aA \rightarrow aA→a. Let GGG be a CFG in CNF. To derive a string of terminals of length xxx, the number of production to be used is

  1. 2x−12x - 12x−1

  2. 2x2x2x

  3. 2x+12x + 12x+1

  4. 2x2^x2x

Show me the answer

Answer: 1. 2x−12x - 12x−1

Explanation:

  • In Chomsky Normal Form (CNF), deriving a string of length xxx requires 2x−12x - 12x−1 productions.

117. In given fig

  1. Both are equivalent

  2. The first FSM accepts nothing

  3. The second FSM accepts ϵ\epsilonϵ-only

  4. None of these

Show me the answer

Answer: 4. None of these

Explanation:

  • The given FSMs are not equivalent, and neither accepts only ϵ\epsilonϵ.

118. The number of tokens in the Fortran statement DO 10 I = 1.25 is

  1. 3

  2. 4

  3. 5

  4. 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

  1. The symbols used have well-defined language meaning

  2. They are unnecessary in reality

  3. Only the form of the string of symbols is significant

  4. 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.

120. If A={0,1}A = \{0, 1\}A={0,1}, the number of possible strings of length 'n' is

  1. n!n!n!

  2. n×nn \times nn×n

  3. nnn^nnn

  4. 2n2^n2n

Show me the answer

Answer: 4. 2n2^n2n

Explanation:

  • For alphabet A={0,1}A = \{0, 1\}A={0,1}, the number of possible strings of length nnn is 2n2^n2n.

121. A mealy machine

  1. May be machine

  2. Has an equivalent more

  3. Only context-free grammar

  4. 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

  1. May be different

  2. Must be same

  3. Must be different

  4. 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

  1. String of 0's whose length is a perfect square

  2. Set of all palindromes made up of 0's and 1's

  3. Strings of 0's, whose length is a prime number

  4. 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?

  1. 1(01)∗1(01)^*1(01)∗ and (10)∗(10)^*(10)∗

  2. y+y^+y+ and y∗y+y^*y^+y∗y+

  3. Y(yy)∗Y(yy)^*Y(yy)∗ and (yy)∗y(yy)^*y(yy)∗y

  4. 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

  1. The pigeon-hole principle

  2. The divide and conquer technique

  3. Recursion

  4. 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

  1. Mealy machine

  2. Kleene machine

  3. Moore machine

  4. 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

  1. Complements a given bit pattern

  2. Generates all strings of 0's and 1's

  3. Adds 1 to a given bit pattern

  4. 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

  1. (a+b)∗a(a+b)∗a(a+b)∗(a + b)^*a(a + b)^*a(a + b)^*(a+b)∗a(a+b)∗a(a+b)∗

  2. b∗a∗b∗a(a+b)∗b^*a^*b^*a(a + b)^*b∗a∗b∗a(a+b)∗

  3. (a+b)∗ab∗a(a+b)∗(a + b)^*ab^*a(a + b)^*(a+b)∗ab∗a(a+b)∗

  4. 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

  1. Complements a given bit pattern

  2. Finds 2's complement of a given bit pattern

  3. Increment a given bit pattern by 1

  4. 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?

  1. Designing compilers

  2. Simulating sequential circuits

  3. Developing text editors

  4. 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

S→xS/yS/x/yS \rightarrow xS/yS/x/yS→xS/yS/x/y Is equivalent to the regular expression

  1. (x+y)∗(x + y)^*(x+y)∗

  2. (x+y)∗(x+y)(x + y)^*(x + y)(x+y)∗(x+y)

  3. (x+y)(x+y)∗(x + y)(x + y)^*(x+y)(x+y)∗

  4. 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

S→ABS \rightarrow ABS→AB A→aA/bB/aA \rightarrow aA/bB/aA→aA/bB/a B→Ba/Bb/aB \rightarrow Ba/Bb/aB→Ba/Bb/a

  1. Has at least one b

  2. Has no consecutive a's or b's

  3. Should end in an 'a'

  4. 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

S→aB/bAS \rightarrow aB/bAS→aB/bA A→b/aS/bAAA \rightarrow b/aS/bAAA→b/aS/bAA B→b/bs/aBBB \rightarrow b/bs/aBBB→b/bs/aBB Generates strings of terminals that have

  1. Equal number of a's and b's

  2. Odd number of a's and odd number of b's

  3. Even number of a's and number of b's

  4. 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.

134. The set {anbn/n=1,2,…}\{a^n b^n / n = 1, 2, \ldots\}{anbn/n=1,2,…} can be generated by a CFG

  1. S→ab/aSbS \rightarrow ab/aSbS→ab/aSb

  2. S→ab/aSb/ϵS \rightarrow ab/aSb/\epsilonS→ab/aSb/ϵ

  3. S→aSbb/abS \rightarrow aSbb/abS→aSbb/ab

  4. S→aSbb/ab/aabbS \rightarrow aSbb/ab/aabbS→aSbb/ab/aabb

Show me the answer

Answer: 1. S→ab/aSbS \rightarrow ab/aSbS→ab/aSb

Explanation:

  • The CFG S→ab/aSbS \rightarrow ab/aSbS→ab/aSb generates the set {anbn/n=1,2,…}\{a^n b^n / n = 1, 2, \ldots\}{anbn/n=1,2,…}.

135. Which of the following CFG's can't be simulated by an FSM?

  1. S→Sa/aS \rightarrow Sa/aS→Sa/a

  2. S→a/X,X→cY,Y→−d/aXS \rightarrow a/X, X \rightarrow cY, Y \rightarrow -d/aXS→a/X,X→cY,Y→−d/aX

  3. S→aSb/abS \rightarrow aSb/abS→aSb/ab

  4. None of these

Show me the answer

Answer: 3. S→aSb/abS \rightarrow aSb/abS→aSb/ab

Explanation:

  • The CFG S→aSb/abS \rightarrow aSb/abS→aSb/ab generates a non-regular language and cannot be simulated by an FSM.

136. CFG is not closed under

  1. Union

  2. Complementation's

  3. Kleene star

  4. Product

Show me the answer

Answer: 2. Complementation's

Explanation:

  • Context-free grammars (CFGs) are not closed under complementation.

137. The set A={anbncn/n=1,2,3,…}A = \{a^n b^n c^n / n = 1, 2, 3, \ldots\}A={anbncn/n=1,2,3,…} is an example of a grammar that is

  1. Regular

  2. Not context free

  3. Context-free

  4. None of these

Show me the answer

Answer: 2. Not context free

Explanation:

  • The language A={anbncn/n=1,2,3,…}A = \{a^n b^n c^n / n = 1, 2, 3, \ldots\}A={anbncn/n=1,2,3,…} is not context-free.

138. Let

L1={anbnam/n,m=1,2,3,…}L_1 = \{a^n b^n a^m / n, m = 1, 2, 3, \ldots\}L1​={anbnam/n,m=1,2,3,…} L2={anbmam/n,m=1,2,3,…}L_2 = \{a^n b^m a^m / n, m = 1, 2, 3, \ldots\}L2​={anbmam/n,m=1,2,3,…} L3={anbncn/n=1,2,3,…}L_3 = \{a^n b^n c^n / n = 1, 2, 3, \ldots\}L3​={anbncn/n=1,2,3,…} Of the following the correct answer is

  1. L3=L1∩L2L_3 = L_1 \cap L_2L3​=L1​∩L2​

  2. L1L_1L1​ and L2L_2L2​ are not CFL, but L3L_3L3​ is CFL

  3. L1L_1L1​ is a subset of L3L_3L3​

  4. None of these

Show me the answer

Answer: 1. L3=L1∩L2L_3 = L_1 \cap L_2L3​=L1​∩L2​

Explanation:

  • The language L3L_3L3​ is the intersection of L1L_1L1​ and L2L_2L2​.

139. The intersection of a CFL, and a regular language

  1. Need not be regular

  2. Is always regular

  3. Need not be context free

  4. 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

  1. 0

  2. 1

  3. 2

  4. 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

  1. FSM

  2. NDPDM

  3. DPDM

  4. 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

  1. A stack is more powerful than a FSM with no stack.

  2. 2 stacks is more powerful than a FSM 1 stack

  3. Both (A) and (B) above

  4. 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

  1. Closed under intersection

  2. Closed under complementation

  3. Recursively enumerable

  4. All of these

Show me the answer

Answer: 4. All of these

Explanation:

  • Recursive languages are closed under intersection, complementation, and are recursively enumerable.

144. If ω∈(a,b)∗\omega \in (a, b)^*ω∈(a,b)∗ satisfy abω=ωabab\omega = \omega ababω=ωab then ′ω′'\omega'′ω′ is

  1. Even

  2. Odd

  3. Null

  4. None of these

Show me the answer

Answer: 1. Even

Explanation:

  • The string ω\omegaω must be even in length to satisfy the equation abω=ωabab\omega = \omega ababω=ωab.

145. Let f:(a,b)∗→(a,b)∗f : (a, b)^* \rightarrow (a, b)^*f:(a,b)∗→(a,b)∗ be given by f(n)=axf(n) = axf(n)=ax for every value of n∈{a,b}n \in \{a, b\}n∈{a,b} then fff is

  1. One to one not onto

  2. Not one to one and not onto

  3. One to one and onto

  4. Not one to one and onto

Show me the answer

Answer: 1. One to one not onto

Explanation:

  • The function fff is one-to-one but not onto.

146. Let if G=({S},{a},{S→SS},S)G = (\{S\}, \{a\}, \{S \rightarrow SS\}, S)G=({S},{a},{S→SS},S), find language generated by GGG

  1. L(G)=ϕL(G) = \phiL(G)=ϕ

  2. L(G)=a∗L(G) = a^*L(G)=a∗

  3. L(G)=anL(G) = a^nL(G)=an

  4. L(G)=anbanL(G) = a^n ba^nL(G)=anban

Show me the answer

Answer: 2. L(G)=a∗L(G) = a^*L(G)=a∗

Explanation:

  • The grammar generates the language a∗a^*a∗.

147. What is the highest type number which can be applied to the following grammar

Sφ→Aa;A→Ba,B→abcS \varphi \rightarrow Aa; A \rightarrow Ba, B \rightarrow abcSφ→Aa;A→Ba,B→abc

  1. Type0

  2. Type1

  3. Type2

  4. Type3

Show me the answer

Answer: 4. Type3

Explanation:

  • The grammar is of Type 3 (regular grammar).

148. Construct a grammar to generate {(ab)n/n≥1}∪{(ba)n/n≥1}\{(ab)^n / n \geq 1\} \cup \{(\text{ba})^n / n \geq 1\}{(ab)n/n≥1}∪{(ba)n/n≥1}

  1. S→S1,S1→abS1,S1→ab,S→S2,S2→baS2,S2→baS \rightarrow S_1, S_1 \rightarrow abS_1, S_1 \rightarrow ab, S \rightarrow S_2, S_2 \rightarrow baS_2, S_2 \rightarrow baS→S1​,S1​→abS1​,S1​→ab,S→S2​,S2​→baS2​,S2​→ba

  2. S→S1,S1→aS1,S1→ab,S→S2,S2→bS2,S2→bcS \rightarrow S_1, S_1 \rightarrow aS_1, S_1 \rightarrow ab, S \rightarrow S_2, S_2 \rightarrow bS_2, S_2 \rightarrow bcS→S1​,S1​→aS1​,S1​→ab,S→S2​,S2​→bS2​,S2​→bc

  3. S→S1,S1→S2,S2→S1a,S1→ab,S2→baS \rightarrow S_1, S_1 \rightarrow S_2, S_2 \rightarrow S_1a, S_1 \rightarrow ab, S_2 \rightarrow baS→S1​,S1​→S2​,S2​→S1​a,S1​→ab,S2​→ba

  4. None of these

Show me the answer

Answer: 1. S→S1,S1→abS1,S1→ab,S→S2,S2→baS2,S2→baS \rightarrow S_1, S_1 \rightarrow abS_1, S_1 \rightarrow ab, S \rightarrow S_2, S_2 \rightarrow baS_2, S_2 \rightarrow baS→S1​,S1​→abS1​,S1​→ab,S→S2​,S2​→baS2​,S2​→ba

Explanation:

  • The grammar generates the language {(ab)n/n≥1}∪{(ba)n/n≥1}\{(ab)^n / n \geq 1\} \cup \{(\text{ba})^n / n \geq 1\}{(ab)n/n≥1}∪{(ba)n/n≥1}.

149. Which string recognize it?

  1. (a+b)∗(a + b)^*(a+b)∗

  2. a+b(a+bb)∗(a+(b+aa)∗)∗a + b (a + bb)^* (a + (b + aa)^*)^*a+b(a+bb)∗(a+(b+aa)∗)∗

  3. a∗b(b+aa)∗ba(b+aa)∗aa^*b (b + aa)^*ba(b + aa)^*aa∗b(b+aa)∗ba(b+aa)∗a

  4. 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

  1. (0+1(1+01)′00)′(0 + 1 (1 + 01) '00)'(0+1(1+01)′00)′

  2. (0+1(1+10)00)′(0 + 1 (1 + 10) 00)'(0+1(1+10)00)′

  3. (1+0)(0+10)′00)′(1 + 0)(0 + 10) '00)'(1+0)(0+10)′00)′

  4. (1+0(1+00)11)′(1 + 0 (1 + 00) 11)'(1+0(1+00)11)′

Show me the answer

Answer: 1. (0+1(1+01)′00)′(0 + 1 (1 + 01) '00)'(0+1(1+01)′00)′

Explanation:

  • The regular expression (0+1(1+01)′00)′(0 + 1 (1 + 01) '00)'(0+1(1+01)′00)′ corresponds to the given state diagram.

151. L={ap/p is a prime}L = \{a^p / p \text{ is a prime}\}L={ap/p is a prime} is a

  1. Regular

  2. Accepted by DFA

  3. Not regular

  4. Accepted by PDA

Show me the answer

Answer: 3. Not regular

Explanation:

  • The language L={ap/p is a prime}L = \{a^p / p \text{ is a prime}\}L={ap/p is a prime} is not regular as it requires checking for primality, which cannot be done by a finite automaton.

152. Regular expression corresponding to the automata given in figure below are:

  1. 1(1+0(0+10)′11)′0(0+10)′11 (1 + 0 (0 + 10) '11)' 0 (0 + 10) '11(1+0(0+10)′11)′0(0+10)′1

  2. 0(1+0(1+01)′11)′1(1+10)′10 (1 + 0 (1 + 01) '11)' 1 (1 + 10) '10(1+0(1+01)′11)′1(1+10)′1

  3. 1(1+0(1+01)′00)′1(1+01)′1 (1 + 0 (1 + 01) '00)' 1 (1 + 01)'1(1+0(1+01)′00)′1(1+01)′

  4. 0(1+0(1+01)′00)′1(1+01)′10 (1 + 0 (1 + 01) '00)' 1 (1 + 01)' 10(1+0(1+01)′00)′1(1+01)′1

Show me the answer

Answer: 1. 1(1+0(0+10)′11)′0(0+10)′11 (1 + 0 (0 + 10) '11)' 0 (0 + 10) '11(1+0(0+10)′11)′0(0+10)′1

Explanation:

  • The regular expression 1(1+0(0+10)′11)′0(0+10)′11 (1 + 0 (0 + 10) '11)' 0 (0 + 10) '11(1+0(0+10)′11)′0(0+10)′1 corresponds to the given automaton.

153. Grammar S→aAb,A→aAb/aS \rightarrow aAb, A \rightarrow aAb/aS→aAb,A→aAb/a is in

  1. LR(1) not in LR(0)

  2. LR(0) but not in LR(1)

  3. Both LR(0) and LR(1)

  4. 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).

154. The language L={anbncn/n≥1}L = \{a^n b^n c^n / n \geq 1\}L={anbncn/n≥1} is a

  1. Regular language

  2. Context-free language

  3. Context-sensitive language

  4. Recursively enumerable language

Show me the answer

Answer: 3. Context-sensitive language

Explanation:

  • The language L={anbncn/n≥1}L = \{a^n b^n c^n / n \geq 1\}L={anbncn/n≥1} is context-sensitive as it requires matching counts of aaa's, bbb's, and ccc's.

155. The set {anbn/n=1,2,3,…}\{a^n b^n / n = 1, 2, 3, \ldots\}{anbn/n=1,2,3,…} can be generated by the CFG

  1. S→ab/aSbS \rightarrow ab/aSbS→ab/aSb

  2. S→ab/aSb/ϵS \rightarrow ab/aSb/\epsilonS→ab/aSb/ϵ

  3. S→aaSbb/abS \rightarrow aaSbb/abS→aaSbb/ab

  4. None of these

Show me the answer

Answer: 1. S→ab/aSbS \rightarrow ab/aSbS→ab/aSb

Explanation:

  • The CFG S→ab/aSbS \rightarrow ab/aSbS→ab/aSb generates the set {anbn/n=1,2,3,…}\{a^n b^n / n = 1, 2, 3, \ldots\}{anbn/n=1,2,3,…}.

156. Which of the following CFG's can't be simulated by an FSM?

  1. S→Sa/aS \rightarrow Sa/aS→Sa/a

  2. S→abX,X→cY,Y→a/aXS \rightarrow abX, X \rightarrow cY, Y \rightarrow a/aXS→abX,X→cY,Y→a/aX

  3. S→aSb/abS \rightarrow aSb/abS→aSb/ab

  4. None of these

Show me the answer

Answer: 3. S→aSb/abS \rightarrow aSb/abS→aSb/ab

Explanation:

  • The CFG S→aSb/abS \rightarrow aSb/abS→aSb/ab generates a non-regular language and cannot be simulated by an FSM.

157. The set A={anbncn/n=1,2,3,…}A = \{a^n b^n c^n / n = 1, 2, 3, \ldots\}A={anbncn/n=1,2,3,…} is an example of

  1. Regular language

  2. Non context free language

  3. Context free language

  4. None of these

Show me the answer

Answer: 2. Non context free language

Explanation:

  • The language A={anbncn/n=1,2,3,…}A = \{a^n b^n c^n / n = 1, 2, 3, \ldots\}A={anbncn/n=1,2,3,…} is not context-free.

158. The intersection of CFL and a regular language

  1. Need not be regular

  2. Is always regular

  3. Need not be context free

  4. 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:

  1. The power of DFSM and NDFSM are same.

  2. The power of DFSM and NDFSM are different.

  3. The power of DPDM and NDPDM are different.

  4. 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?

  1. All strings in which a given symbol is present at least twice

  2. Even palindromes.

  3. Strings ending with a particular alphabet.

  4. 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).

Previousset-2NextMCQs On Computer Graphics

Last updated 4 months ago