TOC
TOC
4. According to the given language, which among the following expressions does it corresponds to?
Language L={xϵ{0,1}|x is of length 4 or less}
a)(0+1+0+1+0+1+0+1)4
b)(0+1)4
c)(01)4
d)(0+1+ε)4
View Answer
a)Q*P
b)QP*
c)Q*P*
d)(P*O*)*
View Answer
6. The difference between number of states with regular expression (a + b) and (a + b) * is:
a)1
b)2
c)3
d)0
View Answer
7. In order to represent a regular expression, the first step to create the transition diagram is:
a) Create the NFA using Null moves
b) Null moves are not acceptable, thus should not be used
c) Predict the number of states to be used in order to construct the Regular expression
d) None of the mentioned
View Answer
8.(0+ε)(1+ε)represents
a){0,1,01,ε}
b){0,1,ε}
c){0,1,01,11,00,10,ε}
d){0,1}
View Answer
9. The minimum number of states required to automate the following Regular Expression:
(1)*(01+10)(1)*
a)4
b)3
c)2
d) 5
7. Which of the following represents a language which has no pair of consecutive 1’s if ∑= {0,1}?
a) (0+10)*(1+ε)
b) (0+10)*(1+ε)*
c) (0+101)*(0+ε)
d) (1+010)*(1+ε)
View Answer
10. Which of the following regular expressions represents the set of strings which do not contain a
substring ‘rt’ if ∑= {r, t}
a) (rt)*
b) (tr)*
c) (r*t*)
d) (t*r*)
7. Which of the following represents a language which has no pair of consecutive 1’s if ∑= {0,1}?
a) (0+10)*(1+ε)
b) (0+10)*(1+ε)*
c) (0+101)*(0+ε)
d) (1+010)*(1+ε)
View Answer
3. The total number of states required to automate the given regular expression
(00)*(11)*
a) 3
b) 4
c) 5
d) 6
7. The minimum number of states required in a DFA (along with a dumping state) to check whether
the 3rd bit is 1 or not for |n|>=3
a) 3
b) 4
c) 5
d) 1
10. Is it possible to obtain more than one regular expression from a given DFA using the state
elimination method?
a) Yes
b) No
5. a? is equivalent to
a) a
b) a+Φ
c) a+ϵ
d) wrong expression
View Answer
6. ϵL is equivalent to
a) ϵ
b) Φ
c) L
d) Lϵ
View Answer
7. (a+b)* is equivalent to
a) b*a*
b) (a*b*)*
c) a*b*
d) none of the mentioned
8. ΦL is equivalent to
a) LΦ
b) Φ
c) L
d) ϵ
View Answer
4. Regular grammar is
a) context free grammar
b) non context free grammar
c) english grammar
d) none of the mentioned
View Answer
5. Let the class of language accepted by finite state machine be L1 and the class of languages
represented by regular expressions be L2 then
a) L1<L2
b) L1>=L2
c) L1 U L2 = .*
d) L1=L2
View Answer
6. Which of the following is not a regular expression?
a) [(a+b)*-(aa+bb)]*
b) [(0+1)-(0b+a1)*(a+b)]*
c) (01+11+10)*
d) (1+2+0)*(1+2)*
View Answer
2. If the lexical analyser finds a lexeme with the same name as that of a reserved word,it _________
a) overwrites the word
b) overwrites the functionality
c) generates an error
d) something else
View Answer
3. The methodology to show an error when the analyzer faces a keyword over an user’s input is
based on:
a) rule priority
b) longest match rule
c) keyword-out rule
d) none of mentioned
View Answer
6. The output of the lexical and syntax analyzer can stated as:
a) parse stream, parse tree
b) token tree, parse tree
c) token stream, parse tree
d) all of the mentioned
View Answer
7. Which among the following is not a tool to construct lexical analyzer from a regular expression?
a) lex
b) flex
c) jflex
d) none of the mentioned
View Answer
11. Which of the following characters are ignored while lexical analysis?
a) .
b) =
c) #
d) WhiteSpace
12. ____________ is used for grouping up of characters into token.
a) Lexical Analyzer
b) oolex
c) jflex
d) All of the mentioned
View Answer
13. The action of parsing the source code into proper syntactic classes is known as:
a) Parsing
b) Interpretation analysis
c) Lexicography
d) Lexical Analysis
View Answer
8. Choose the incorrect process to check whether the string belongs to the language of certain
variable or not?
a) recursive inference
b) derivations
c) head to body method
d) All of the mentioned
View Answer
9. Statement: Left most derivations are lengthy as compared to Right most derivations.
Choose the correct option:
a) correct statement
b) incorrect statement
c) may or may not be correct
d) depends on the language of the grammar
View Answer
10. A->aAa|bAb|a|b|e
Which among the following is the correct option for the given production?
a) Left most derivation
b) Right most derivation
c) Recursive Inference
d) None of the mentioned
1. The minimum length of a string {0,1}* not in the language corresponding to the given regular
expression:
(0*+1*)(0*+1*)(0*+1*)
a) 3
b) 4
c) 5
d) 6
View Answer
4. The given regular language corresponds to which of the given regular language
e+1+(1+0)*0+(0+1)*11
a) The language of all strings that end with 11 or 00
b) The language of all strings that end with 0 or 1
c) The language of all strings which does not end with 01
d) None of the mentioned
View Answer
5. Statement: If we take the union of two identical expression, we can replace them by one copy of
the expression.
Which of the following is a correct option for the given statement?
a) Absorption Law
b) Idempotent Law
c) Closure Law
d) Commutative Law
10. A->aAa|bAb|a|b|e
Which among the following is the correct option for the given production?
a) Left most derivation
b) Right most derivation
c) Recursive Inference
d) None of the mentioned
1. All the regular languages can have one or more of the following descriptions:
i) DFA ii) NFA iii) e-NFA iv) Regular Expressions
Which of the following are correct?
a) i, ii, iv
b) i, ii, iii
c) i, iv
d) i, ii, iii, iv
View Answer
2. Which of the technique can be used to prove that a language is non regular?
a) Ardens theorem
b) Pumping Lemma
c) Ogden’s Lemma
d) None of the mentioned
View Answer
5. If L is DFA-regular, L’ is
a) Non regular
b) DFA-regular
c) Non-finite
d) None of the mentioned
View Answer
10. Finite state machine are not able to recognize Palindromes because:
a) Finite automata cannot deterministically find the midpoint
b) Finite automata cannot remember arbitarily large amount of data
c) Even if the mid-point is known, it cannot find whether the second half matches the first
d) All of the mentioned
2. While applying Pumping lemma over a language, we consider a string w that belong to L and
fragment it into _________ parts.
a) 2
b) 5
c) 3
d) 6
View Answer
3. If we select a string w such that w∈L, and w=xyz. Which of the following portions cannot be an
empty string?
a) x
b) y
c) z
d) all of the mentioned
View Answer
4. Let w= xyz and y refers to the middle portion and |y|>0.What do we call the process of repeating y
0 or more times before checking that they still belong to the language L or not?
a) Generating
b) Pumping
c) Producing
d) None of the mentioned
View Answer
5. There exists a language L. We define a string w such that w∈L and w=xyz and |w| >=n for some
constant integer n.What can be the maximum length of the substring xy i.e. |xy|<=?
a) n
b) |y|
c) |x|
d) none of the mentioned
View Answer
9. Let w be a string and fragmented by three variable x, y, and z as per pumping lemma. What does
these variables represent?
a) string count
b) string
c) both (a) and (b)
d) none of the mentioned
View Answer
10. Which of the following one can relate to the given statement:
Statement: If n items are put into m containers, with n>m, then atleast one container must contain
more than one item.
a) Pumping lemma
b) Pigeon Hole principle
c) Count principle
d) None of the mentioned
6. If n objects are distributed over m places, and n < m, then some of the places receive:
a) at least 2 objects
b) at most 2 objects
c) no object
d) none of the mentioned
View Answer
10. Which among the following is the closure property of a regular language?
a) Emptiness
b) Universality
c) Membership
d) None of the mentioned
1. If L1, L2 are regular and op(L1, L2) is also regular, then L1 and L2 are said to be ____________
under an operation op.
a) open
b) closed
c) decidable
d) none of the mentioned
View Answer
2. Suppose a regular language L is closed under the operation halving, then the result would be:
a) 1/4 L will be regular
b) 1/2 L will be regular
c) 1/8 L will be regular
d) Al of the mentioned
View Answer
6. Which among the following are the boolean operations that under which regular languages are
closed?
a) Union
b) Intersection
c) Complement
d) All of the mentioned
View Answer
7. Suppose a language L1 has 2 states and L2 has 2 states. After using the cross product
construction method, we have a machine M that accepts L1 ∩ L2. The total number of states in M:
a) 6
b) 4
c) 2
d) 8
9. While proving Inverse Homomorphism, which of the following steps are needed?
a) Start with a DFA Ain L
b) Construct a DFA B for h-1(L)
c) The set of states, initial and final states should be same.
d) All of the mentioned
View Answer
3. 3. A regular language over an alphabet ∑ is one that cannot be obtained from the basic
languages using the operation
a) Union
b) Concatenation
c) Kleene*
d) All of the mentioned
4. Statement 1: A Finite automata can be represented graphically; Statement 2: The nodes can
be its states; Statement 3: The edges or arcs can be used for transitions
Hint: Nodes and Edges are for trees and forests too.
Which of the following make the correct combination?
a) Statement 1 is false but Statement 2 and 3 are correct
b) Statement 1 and 2 are correct while 3 is wrong
c) None of the mentioned statements are correct
d) All of the mentioned
5. 5. The minimum number of states required to recognize an octal number divisible by 3 are/is
a) 1
b) 3
c) 5
d) 7
View Answer
1. Assume the R is a relation on a set A, aRb is partially ordered such that a and b are
_____________
a) reflexive
b) transitive
c) symmetric
d) reflexive and transitive
8. 10. Which of the following is not an example of finite state machine system?
a) Control Mechanism of an elevator
b) Combinational Locks
c) Traffic Lights
d) Digital Watches
7.The complement of a language will only be defined when and only when the __________ over the
language is defined.
a) String
b) Word
c) Alphabet
d) Grammar
View Answer
5. For a DFA accepting binary numbers whose decimal equivalent is divisible by 4, what are all the
possible remainders?
a) 0
b) 0,2
c) 0,2,4
d) 0,1,2,3
7. Given:
L1= {xϵ ∑*|x contains even no’s of 0’s}
L2= {xϵ ∑*|x contains odd no’s of 1’s}
No of final states in Language L1 U L2?
a) 1
b) 2
c) 3
d) 4
10. The sum of minimum and maximum number of final states for a DFA n states is equal to:
a) n+1
b) n
c) n-1
d) n+2
8. The maximum number of transitions which can be performed over a state in a DFA?
∑= {a, b, c}
a) 1
b) 2
c) 3
d) 4
13. The basic limitation of finite automata is that
a) It can’t remember arbitrary large amount of information.
b) It sometimes recognize grammar that are not regular.
c) It sometimes fails to recognize regular grammar.
d) All of the mentioned
View Answer
14. Number of states require to simulate a computer with memory capable of storing ‘3’ words each
of length ‘8’.
a) 3 * 28
b) 2(3*8)
c) 2(3+8)
d) None of the mentioned
View Answer
15. FSM with output capability can be used to add two given integer in binary representation. This is
a) True
b) False
c) May be true
d) None of the mentioned
7. Languages of a automata is
a) If it is accepted by automata
b) If it halts
c) If automata touch final state in its life time
d) All language are language of automata
View Answer
8. Language of finite automata is.
a) Type 0
b) Type 1
c) Type 2
d) Type 3
View Answer
11. Regular expression for all strings starts with ab and ends with bba is.
a) aba*b*bba
b) ab(ab)*bba
c) ab(a+b)*bba
d) All of the mentioned
View Answer
12. How many DFA’s exits with two states over input alphabet {0,1} ?
a) 16
b) 26
c) 32
d) 64
9. Which of the following option is correct?
a) NFA is slower to process and its representation uses more memory than DFA
b) DFA is faster to process and its representation uses less memory than NFA
c) NFA is slower to process and its representation uses less memory than DFA
d) DFA is slower to process and its representation uses less memory than NFA
10. 1. Regular sets are closed under union,concatenation and kleene closure.
a) True
b) False
c) Depends on regular set
d) Can’t say
View Answer
13. 4. If L1 and L2 are regular sets then intersection of these two will be
a) Regular
b) Non Regular
c) Recursive
d) Non Recursive
View Answer
17. 8. A ___________ is a substitution such that h(a) contains a string for each a.
a) Closure
b) Interchange
c) Homomorphism
d) Inverse Homomorphism
View Answer
If L1 and L2 are context free languages, which of the following is context free?
a) L1*
b) L2UL1
c) L1.L2
d) All of the mentioned
. A grammar with more than one parse tree is called:
a) Unambiguous
b) Ambiguous
c) Regular
d) None of the mentioned
View Answer
1. The most suitable data structure used to represent the derivations in compiler:
a) Queue
b) Linked List
c) Tree
d) Hash Tables
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
1. A CFG is ambiguous if
a) It has more than one rightmost derivations
b) It has more than one leftmost derivations
c) No parse tree can be generated for the CFG
d) None of the mentioned
View Answer
6. Using the pumping constant n, If there is a string in the language of length between _____ and
____ then the language is infite else not.
a) n, 2n-1
b) 2n, n
c) n+1, 3n+6
d) 0, n+1
View Answer