Multiple choice question for engineering
Set 1
1. Which of the following regular expression resembles the given diagram?
a) {a}*{b}*{a,b}
b) {a,b}*{aba}
c) {a,b}*{bab}
d) {a,b}*{a}*{b}*
Answer
Answer: b [Reason:] The given diagram is a transition graph for a turing machine which accepts the language with the regular expression {a,b}*{aba}.
2. Construct a turing machine which accepts a string with ‘aba’ as its substring.
a)
b)
c)
d)
Answer
Answer: c [Reason:] The language consist of strings with a substring ‘aba’ as fixed at its end and the left part can be anything including epsilon. Thus the turing machine uses five states to express the language excluding the rejection halting state which if allowed can modify the graph as:
3. The number of states required to automate the last question i.e. {a,b}*{aba}{a,b}* using finite automata:
a) 4
b) 3
c) 5
d) 6
Answer
Answer: a [Reason:] The finite automata can be represented as:
4. The machine accept the string by entering into hA or it can:
a) explicitly reject x by entering into hR
b) enter into an infinte loop
c) Both (a) and (b)
d) None of the mentioned
Answer
Answer: c [Reason:] Three things can occur when a string is tested over a turing machine:
a) enter into accept halting state
b) enter into reject halting state
c) goes into loop forever
5. d(q,X)=(r,Y,D) where D cannot be:
a) L
b) R
c) S
d) None of the mentioned
Answer
Answer: c [Reason:] D represents the direction in which automata moves forward as per the queue which surely cannot be a starting variable.
6. Which of the following can accept even palindrome over {a,b}
a) Push down Automata
b) Turing machine
c) NDFA
d) All of the mentioned
Answer
Answer: c [Reason:] A language generating strings which are palindrome is not regular, thus cannot b represented using a finite automaton.
7. Which of the functions can a turing machine not perform?
a) Copying a string
b) Deleting a symbol
c) Accepting a pal
d) Inserting a symbol
Answer
Answer: d [Reason:] Different turing machines exist for operations like copying a string, deleting a symbol, inserting a symbol and accepting palindromes.
8. If T1 and T2 are two turing machines. The composite can be represented using the expression:
a) T1T2
b) T1 U T2
c) T1 X T2
d) None of the mentioned
Answer
Answer: a [Reason:] If T1 and T2 are TMs, with disjoint sets of non halting states and transition function d1 and d2, respectively, we write T1T2 to denote this composite TM.
9. The following turing machine acts like:
a) Copies a string
b) Delete a symbol
c) Insert a symbol
d) None of the mentioned
Answer
Answer: b [Reason:] A turing machine does the deletion by changing the tape contents from yaz to yz, where y belongs to (S U {#})*.
10. What does the following transition graph shows:
a) Copies a symbol
b) Reverses a string
c) Accepts a pal
d) None of the mentioned
Answer
Answer: c [Reason:] The composite TM accepts the language of palindromes over {a, b} by comparing the input string to its reverse and accepting if and only if the two are equal.
Set 2
1. The automaton which allows transformation to a new state without consuming any input symbols:
a) NFA
b) DFA
c) NFA-l
d) All of the mentioned
Answer
Answer: c [Reason:] NFA-l or e-NFA is an extension of Non deterministic Finite Automata which are usually called NFA with epsilon moves or lambda transitions.
2. e-transitions are
a) conditional
b) unconditional
c) input dependent
d) none of the mentioned
Answer
Answer: b [Reason:] An epsilon move is a transition from one state to another that doesn’t require any specific condition.
3. The __________ of a set of states, P, of an NFA is defined as the set of states reachable from any state in P following e-transitions.
a) e-closure
b) e-pack
c) Q in the tuple
d) None of the mentioned
Answer
Answer: a [Reason:] The e-closure of a set of states, P, of an NFAis defined as the set of states reachable from any state in P following e-transitions.
4. The e-NFA recognizable languages are not closed under :
a) Union
b) Negation
c) Kleene Closure
d) None of the mentioned
Answer
Answer: The languages which are recognized by an epsilon Non deterministic automata are closed under the following operations:
a) Union
b) Intersection
c) Concatenation
d) Negation
e) Star
f) Kleene closure
5. Is the language preserved in all the steps while eliminating epsilon transitions from a NFA?
a) yes
b) no
Answer
Answer: a [Reason:] Yes, the language is preserved during the dteps of construction: L(N)=L(N1)=L(N2)=L(3).
6. An e-NFA is ___________ in representation.
a) Quadruple
b) Quintuple
c) Triple
d) None of the mentioned
Answer
Answer: b [Reason:] An e-NFA consist of 5 tuples: A=(Q, S, d, q0, F)
Note: e is never a member of S.
7. State true or false:
Statement: Both NFA and e-NFA recognize exactly the same languages.
a) true
b) false
Answer
Answer: a [Reason:] e-NFA do come up with a convenient feature but nothing new.They do not extend the class of languages that can be represented.
Set 3
1. YACC is a computer program for ______ operation system.
a) Windows
b) DOS
c) Unix
d) openSUSE
Answer
Answer: c [Reason:] YACC technique is a computer code for the Unix operating system. It is a LALR parser generator, generating a parser, the part of a compiler that tries to make syntactic sense of the source code.
2. YACC is an acronym for:
a) Yes Another Compile Compiler
b) Yet Another Compile Compiler
c) Yet Another Compiler Compiler
d) Yes Another Compiler Compiler
Answer
Answer: c [Reason:] YACC stands for ‘Yet another compiler compiler’ and it was developed by Stephen Johnson in B programming language later translated to C.
3. The YACC takes C code as input and outputs_________
a) Top down parsers
b) Bottom up parsers
c) Machine code
d) None of the mentioned
Answer
Answer: b [Reason:] The YACC takes C code as input and produces shift reduce parsers in C,also known as Bottom up parsers which execute C snippets with the associated rule.
4. The _______ table is created by YACC.
a) LALR parsing
b) LL parsing
c) GLR parsing
d) None of the mentioned
Answer
Answer: a [Reason:] LALR parser generator is software tool that reads a BNF grammar and creates a LALR parser which is capable of parsing files written in programming language identified by BNF grammar.
5. The original YACC as written in __________ language
a) R programming language
b) C programming language
c) B programming language
d) None of the mentioned
Answer
Answer: c [Reason:] Stephen Johnson wrote this parser generator in B programming language which was further modified and written in C, JAVA, Python, etc.
6. Which of the following is false for B programming language?
a) Typeless
b) Influenced by PL/I
c) Designed by Dennis Ritchie
d) None of the mentioned
Answer
Answer: d [Reason:] B was programming language designed by Dennis Ritchie and Ken Thompson for recursive, non numeric, system and language softwares. It was a typeless language, everything is a word.
7. Which of the following is false for BNF?
a) BNF means Backus Naur Form
b) It is a normal form used in Data base normalization
c) It is a notation technique for context free grammar
d) None of the mentioned
Answer
Answer: b [Reason:] The normal form used in Data base normalization is BCNF i.e. Boyce Codd normal form and NOT Backus Naur Form.
8. State true or false:
Statement: BNF is a metasyntax used to express CFG
a) True
b) False
Answer
Answer: a [Reason:] BNF is a metasyntax used to express context free grammar, moreover a formal way to express the language.
9. Which of the following are not used to express CFG?
a) BNF
b) EBNF, ABNF
c) Van Wijngaarden form
d) None of the mentioned
Answer
Answer: d [Reason:] W grammar or van Wijngaarden form is used to define potentially infinite context free grammars in a finite number of rules. It is an example of larger class of affix grammars. This technique was used to define the P/L Algol 68.
10. Which of the following version of Unix came up with YACC first?
a) V3
b) V5
c) CB UNIX
d) Unix-RT
Answer
Answer: a [Reason:] Yacc appeared in version 3 of unix, though full description was published by 1975.
Set 4
1. A symbol X is ________ if there exists : S->* aXb
a) reachable
b) generating
c) context free
d) none of the mentioned
Answer
Answer: a [Reason:] A symbol X is generating if there exists : X->*w for some w that belongs to T*.
Also, a symbol can never be context free.
2. A symbol X is called to be useful if and only if its is:
a) generating
b) reachable
c) both generating and reachable
d) none of the mentioned
Answer
Answer: c [Reason:] For a symbol X to be useful, it has to be both reachable and generating i.e.
S->* aXb -> * w where w belongs to T*.
3. Which of the following is false for a grammar G in Chomsky Normal Form:
a) G has no useless symbols
b) G has no unit productions
c) G has no epsilon productions
d) None of the mentioned
Answer
Answer: d [Reason:] G, a CFG is said to be in Chomsky normal form if all its productions are in one of the following form:
A->BC or A->a
4. Given Checklist:
a) G has no useless symbols
b) G has no unit productions
c) G has no epsilon productions
d) Normal form for production is violated
Is it possible for the grammar G to be in CNF with the following checklisy ?
a) Yes
b) No
Answer
Answer: b [Reason:] The grammar is not in CNF if it violates the normal form of the productions which is strictly restricted.
5. State true or false:
Statement: A CNF parse tree’s string yield (w) can no longer be 2h-1.
a) true
b) false
Answer
Answer: a [Reason:] It is the parse tree theorem which states:
Given: Suppose we have a parse tree for a string w, according to a CNF grammar, G=(V, T, P, S). Let h be the height of the parse tree. Now, Implication: |w|<=2h-1.
6. If |w|>=2h, then its parse tree’s height is at least _____
a) h
b) h+1
c) h-1
d) 2h
Answer
Answer: b [Reason:] It is the basic implication of Parse tree theorem (assuming CNF). If the height of the parse tree is h, then |w| <=2h-1.
7. If w belongs to L(G), for some CFG, then w has a parse tree, which tell us the ________ structure of w.
a) semantic
b) syntactic
c) lexical
d) all of the mentioned
Answer
Answer: b [Reason:] A parse tree or concrete syntactic tree is an ordered, rooted tree that represents the syntactic structure of a string according to some context free grammar.
8. Which of the following are distinct to parse trees?
a) abstract parse trees
b) sentence diagrams
c) both abstract parse trees and sentence diagrams
d) none of the mentioned
Answer
Answer: c [Reason:] Both of the mentioned are different from parse trees. Sentence diagrams are pictorial representations of grammatical structure of a sentence.
9. Choose the correct option:
Statement: Unambiguity is the ideal structure of a language.
a) true
b) partially true
c) false
d) cant be said
Answer
Answer: a [Reason:] Ideally, there should be only one parse tree for each string, i.e. the language should be unambiguous.
10. Is the given statement correct?
Statement: The mere existence of several derivations is not an issue, its is the existence of several parse trees that ruins a grammar.
a) Yes
b) No
Answer
Answer: a [Reason:] It is also true that multiple leftmost or rightmost derivations do cause ambiguity. Unfortunately, it is not possible to remove the ambiguity always.
Set 5
1. Which of the following can be measured by the use of a tacho-generator?
a) Acceleration
b) Speed
c) Speed and acceleration
d) Displacement
Answer
Answer: b [Reason:] Tacho generator is used to measure the velocity or relative velocity of the system.
2. _____________ is not a final control element.
a) Control valve
b) Potentiometer
c) Electro-pneumatic converter
d) Servomotor
Answer
Answer: b [Reason:] Potentiometer among all the options cannot be the final control element as this is responsible to get the output in measurable form.
3. Which of the following is the definition of proportional band of a controller?
a) The range of air output as measured variable varies from maximum to minimum
b) The range of measured variables from set value
c) The range of measured variables through which the air output changes from maximum to minimum
d) All of the mentioned
Answer
Answer: c [Reason:] Proportional band controller is the range of measured variables through which the air output changes from maximum to minimum.
4. In pneumatic control systems the control valve used as final control element converts
a) Pressure signal to electric signal
b) Pressure signal to position change
c) Electric signal to pressure signal
d) Position change to pressure signal
Answer
Answer: b [Reason:] In pneumatic control systems the control valve is used as the final control element to convert pressure signal to position change.
5. Pressure error can be measured by which of the following?
a) Differential bellows and strain gauge
b) Selsyn
c) Strain gauge
d) Strain gauge and potentiometer
Answer
Answer: a [Reason:] Pressure error can be measured by differential bellows and strain gauge.
6. Assertion (A): Feedback compensation is preferred to series compensation.
Reason (R): No amplification is required as the energy flows from higher to lower levels.
a) Both assertion and reason are true and R is correct explanation of A
b) Both A and R true but R is not correct explanation of A
c) A is true but R is false
d) A is False but R is true
Answer
Answer: a [Reason:] Feedback compensation is preferred to series compensation or cascade compensation because:
In a feedback compensator energy transfer is from higher to a lower one thereby obviating the need for the feedback amplification.
7. Assertion (A): A PI controller increases the order of the system by units but decreases the steady state error.
Reason (R): A PI controller introduces a pole at either the origin or at a desired points on the negative real axis.
a) Both assertion and reason are true and R is correct explanation of A
b) Both A and R true but R is not correct explanation of A
c) A is true but R is false
d) A is False but R is true
Answer
Answer: a [Reason:] I is proportional +integral controller. Thus integral controller add a pole either at origin or at the desired point on the negative real axis, so order of the system gets increased but it reduces the steady state error of the offset error.
8. Assertion (A): A derivative controller produces a control action for constant error only.
Reason (R): The PD controller increases the damping and reduces the peak overshoot.
a) Both assertion and reason are true and R is correct explanation of A
b) Both A and R true but R is not correct explanation of A
c) A is true but R is false
d) A is False but R is true
Answer
Answer: d [Reason:] The integral control action produces a control action for error constant not derivative controller. A derivative controller improves the transient state of the control system apart from increasing the bandwidth, overshoot and rise time.
9. A plant is controlled by a proportional controller, if time delay element is introduced in the loop its:
a) Phase margin remains the same
b) Phase margin increases
c) Phase margin decreases
d) Gain margin increases
Answer
Answer: c [Reason:] When a delay element is introduces in a control system, it only affects the phase margin of the system and new value of the phase margin is decreased.
10. Assertion (A): Lead compensation is used to improve the system’s stability
Reason (R): Lead compensation achieves the desired result through the merits of its phase lead contribution.
a) Both assertion and reason are true and R is correct explanation of A
b) Both A and R true but R is not correct explanation of A
c) A is true but R is false
d) A is False but R is true
Answer
Answer: a [Reason:] A lead compensator provides a better gain margin by introducing a positive shift in the phase plot and thus increasing the phase crossover frequency. Thus the system becomes comparatively more stable by using a lead compensator.