0% found this document useful (0 votes)
233 views

TOC

The document discusses properties of regular languages and regular expressions. It includes questions about: 1. Characterizing when a language is regular based on the equivalence classes of its Myhill-Nerode relation. 2. Properties of regular expressions like precedence of operations, representations of languages, and equivalences between expressions. 3. Converting between regular expressions and finite automata using operations like union, concatenation, Kleene star. 4. Questions test the ability to determine regular expressions that correspond to stated languages and languages corresponding to given regular expressions.

Uploaded by

mahesh sah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
233 views

TOC

The document discusses properties of regular languages and regular expressions. It includes questions about: 1. Characterizing when a language is regular based on the equivalence classes of its Myhill-Nerode relation. 2. Properties of regular expressions like precedence of operations, representations of languages, and equivalences between expressions. 3. Converting between regular expressions and finite automata using operations like union, concatenation, Kleene star. 4. Questions test the ability to determine regular expressions that correspond to stated languages and languages corresponding to given regular expressions.

Uploaded by

mahesh sah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

TOC

1. L is a regular Language if and only If the set of __________ classes of IL is finite.


a) Equivalence
b) Reflexive
c) Myhill
d) Nerode
2. A language can be generated from simple primitive language in a simple way if and only if
a) It is recognized by a device of infinite states
b) It takes no auxiliary memory
c) Both are correct
d) Both are wrong

3. Which of the following does not represents the given language?


Language: {0,01}
a) 0+01
b) {0} U {01}
c) {0} U {0}{1}
d) {0} ^ {01}

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

5. Which among the following looks similar to the given expression?


((0+1).(0+1))*
a) {xϵ {0,1} *|x is all binary number with even length}
b) {xϵ {0,1} |x is all binary number with even length}
c) {xϵ {0,1} *|x is all binary number with odd length}
d) {xϵ {0,1} |x is all binary number with odd length}

8. Concatenation Operation refers to which of the following set operations:


a)Union
b)Dot
c)Kleene
d)Two of the options are correct
View Answer

9. Concatenation of R with Ф outputs:


a)R
b)Ф
c)R.Ф
d) None of the mentioned
View Answer

10.RR* can be expressed in which of the forms:


a)R+
b)R-
c)R+UR-
d) R

1.A finite automaton accepts which type of language:


a)Type0
b)Type1
c)Type2
d)Type3
View Answer

2. Which among the following are incorrect regular identities?


a) εR=R
b) ε*=ε
c) Ф*=ε
d) RФ=R
View Answer

3. Simplify the following regular expression:


ε+1*(011)*(1*(011)*)*
a)(1+011)*
b)(1*(011)*)
c)(1+(011)*)*
d)(1011)*
View Answer

4. P, O, R be regular expression over ∑, P is not ε, then


R=Q + RP has a unique solution:

a)Q*P
b)QP*
c)Q*P*
d)(P*O*)*
View Answer

5. Arden’s theorem is true for:


a) More than one initial states
b) Null transitions
c) Non-null transitions
d) None of the mentioned
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

10. Regular Expression denote precisely the ________ of Regular Language.


a)Class
b)PowerSet
c)Superset
d) None of the mentioned

1. Which of the following is correct?


Statement 1: ε represents a single string in the set.
Statement 2: Ф represents the language that consist of no string.
a) Statement 1 and 2 both are correct
b) Statement 1 is false but 2 is correct
c) Statement 1 and 2 both are false
d) There is no difference between both the statements, ε and Ф are different notation for same
reason
View Answer

2. The appropriate precedence order of operations over a Regular Language is


a) Kleene, Union, Concatenate
b) Kleene, Star, Union
c) Kleene, Dot, Union
d) Star, Union, Dot
View Answer

3. Regular Expression R and the language it describes can be represented as:


a) R, R(L)
b) L(R), R(L)
c) R, L(R)
d) All of the mentioned
View Answer
4. Let for ∑= {0,1} R= (∑∑∑) *, the language of R would be
a) {w | w is a string of odd length}
b) {w | w is a string of length multiple of 3}
c) {w | w is a string of length 3}
d) All of the mentioned
View Answer

5. If ∑= {0,1}, then Ф* will result to:


a) ε
b) Ф
c) ∑
d) None of the mentioned
View Answer

6. The given NFA represents which of the following NFA


a) (ab U a) *
b) (a*b* U a*)
c) (ab U a*)
d) (ab)* U a*
View Answer

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

8. The finite automata accept the following languages:


a) Context Free Languages
b) Context Sensitive Languages
c) Regular Languages
d) All the mentioned
View Answer

9. (a + b*c) most correctly represents:


a) (a +b) *c
b) (a)+((b)*.c)
c) (a + (b*)).c
d) a+ ((b*).c)
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*)

1. Which of the following is correct?


Statement 1: ε represents a single string in the set.
Statement 2: Ф represents the language that consist of no string.
a) Statement 1 and 2 both are correct
b) Statement 1 is false but 2 is correct
c) Statement 1 and 2 both are false
d) There is no difference between both the statements, ε and Ф are different notation for same
reason
View Answer

2. The appropriate precedence order of operations over a Regular Language is


a) Kleene, Union, Concatenate
b) Kleene, Star, Union
c) Kleene, Dot, Union
d) Star, Union, Dot
View Answer

3. Regular Expression R and the language it describes can be represented as:


a) R, R(L)
b) L(R), R(L)
c) R, L(R)
d) All of the mentioned
View Answer

4. Let for ∑= {0,1} R= (∑∑∑) *, the language of R would be


a) {w | w is a string of odd length}
b) {w | w is a string of length multiple of 3}
c) {w | w is a string of length 3}
d) All of the mentioned
View Answer

5. If ∑= {0,1}, then Ф* will result to:


a) ε
b) Ф
c) ∑
d) None of the mentioned
View Answer

6. The given NFA represents which of the following NFA


a) (ab U a) *
b) (a*b* U a*)
c) (ab U a*)
d) (ab)* U a*
View Answer

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

8. The finite automata accept the following languages:


a) Context Free Languages
b) Context Sensitive Languages
c) Regular Languages
d) All the mentioned
View Answer

9. (a + b*c) most correctly represents:


a) (a +b) *c
b) (a)+((b)*.c)
c) (a + (b*)).c
d) a+ ((b*).c)
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*)

2. Which of the following statements is not true?


a) Every language defined by any of the automata is also defined by a regular expression
b) Every language defined by a regular expression can be represented using a DFA
c) Every language defined by a regular expression can be represented using NFA with e moves
d) Regular expression is just another representation for any automata definition
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

9. Generate a regular expression for the given language:l


L(x): {xÎ{0,1}*| x ends with 1 nd does not contain a substring 01}
a) (0+01)*
b) (0+01)*1
c) (0+01)*(1+01)
d) All of the mentioned
View Answer
10. The minimum number of transitions to pass to reach the final state as per the following regular
expression is:
{a,b}*{baaa}
a) 4
b) 5
c) 6
d) 3

10. Is it possible to obtain more than one regular expression from a given DFA using the state
elimination method?
a) Yes
b) No

1. A regular language over an alphabet a is one that can be obtained from


a) union
b) concatenation
c) kleene
d) All of the mentioned
View Answer

2. Regular expression {0,1} is equivalent to


a) 0 U 1
b) 0 / 1
c) 0 + 1
d) All of the mentioned
View Answer

3. Precedence of regular expression in decreasing order is


a) * , . , +
b) . , * , +
c) . , + , *
d) + , a , *
View Answer

4. Regular expression Φ* is equivalent to


a) ϵ
b) Φ
c) 0
d) 1
View Answer

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

9. Which of the following pair of regular expression are not equivalent?


a) 1(01)* and (10)*1
b) x(xx)* and (xx)*x
c) (ab)* and a*b*
d) x+ and x*x+
View Answer
10. Consider following regular expression
i) (a/b)* ii) (a*/b*)* iii) ((ϵ/a)b*)*
Which of the following statements is correct
a) i,ii are equal and ii,iii are not
b) i,ii are equal and i,iii are not
c) ii,iii are equal and i,ii are not
d) all are equal

2. Which of the following is true?


a) (01)*0 = 0(10)*
b) (0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*
c) (0+1)*01(0+1)*+1*0* = (0+1)*
d) All of the mentioned
View Answer

3. A language is regular if and only if


a) accepted by DFA
b) accepted by PDA
c) accepted by LBA
d) accepted by Turing machine
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

7. Regular expression are


a) Type 0 language
b) Type 1 language
c) Type 2 language
d) Type 3 language

8. Which of the following is true?


a) Every subset of a regular set is regular
b) Every finite subset of non-regular set is regular
c) The union of two non regular set is not regular
d) Infinite union of finite set is regular
View Answer

9. L and ~L are recursive enumerable then L is


a) Regular
b) Context free
c) Context sensitive
d) Recursive
View Answer

10. Regular expressions are closed under


a) Union
b) Intersection
c) Kleen star
d) All of the mentioned

1. Lexemes can be referred to as:


a) elements of lexicography
b) sequence of alphanumeric characters in a token
c) lexical errors
d) none of the mentioned
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

4. State true or false:


Statement: A lexical analyzer reads the source code line by line.
a) True
b) False
View Answer

5.Which among the following statement is correct?


Statement 1: When the analyzer scans ‘int’ and ‘intvalue’, it is not able to decide whether the int
leads to a keyword or an identifier.
Statement 2: Longest Match Rule

a) Statement 1 is assertion, Statement 2 is the reason


b) Statement 1 is assertion, Statement 2 is the solution
c) There is no such Statement 2
d) This is not a function of Lexical Analyzer
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

8. A program that performs lexical analysis is termed as:


a) scanner
b) lexer
c) tokenizer
d) all of the mentioned
View Answer

9. Lexers and parsers are not found in which of the following?


a) compiler front end processing
b) prettyprinters
c) linters
d) none of the mentioned
View Answer

10. Which phase of compiler includes Lexical Analysis?


a) 1
b) 2
c) 3
d) Its primary function, not in any phase
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

14. Which of the following is the task of lexical analysis?


a) To build the uniform symbol table
b) To initialize the variables
c) To organize the variables in a lexical order
d) None of the mentioned
View Answer

15. The scanner outputs:


a) Stream of tokens
b) Image file
c) Intermediate code
d) Machine code
View Answer

16. The phase of compilation which involves type checking is:


a) Parsing
b) Scanning
c) Syntax directed translation
d) Semantic Analyzer

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

2. Which of the following regular expression is equivalent to R(1,0)?


R(1,0)={111*}*
a) (11+111)*
b) (111+1111)*
c) (111+11*)*
d) All of the mentioned

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

3. Which of the following language regular?


a) {aibi|i>=0}
b) {aibi|0<i<5}
c) {aibi|i>=1}
d) None of the mentioned
View Answer

4. Which of the following are non regular?


a) The set of strings in {a,b}* with an even number of b’s
b) The set of strings in {a, b, c}* where there is no c anywhere to the left of a
c) The set of strings in {0, 1}* that encode, in binary, an integer w that is a multiple of 3. Interpret the
empty strings e as the number 0.
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

6. Which of the following options is incorrect?


a) A language L is regular if and only if ~L has finite number of equivalent classes.
b) Let L be a regular language. If ~L has k equivalent classes, then any DFA that recognizes L must
have atmost k states.
c) A language L is NFA-regular if and only if it is DFA-regular.
d) None of the mentioned

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

1. Relate the following statement:


Statement: All sufficiently long words in a regular language can have a middle section of words
repeated a number of times to produce a new word which also lies within the same language.
a) Turing Machine
b) Pumping Lemma
c) Arden’s theorem
d) None of the mentioned
View Answer

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

6. Fill in the blank in terms of p, where p is the maximum string length in L.


Statement: Finite languages trivially satisfy the pumping lemma by having n = ______
a) p*1
b) p+1
c) p-1
d) None of the mentioned
View Answer

7. Answer in accordance to the third and last statement in pumping lemma:


For all _______ xyiz ∈L
a) i>0
b) i<0
c) i<=0
d) i>=0

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

1. Which kind of proof is used to prove the regularity of a language?


a) Proof by contradiction
b) Direct proof
c) Proof by induction
d) None of the mentioned
View Answer

2. The language of balanced parenthesis is


a) regular
b) non regular
c) may be regular
d) none of the mentioned
View Answer

3. State true or false:


Statement: Pumping lemma gives a necessary but not sufficient condition for a language to be
regular.
a) true
b) false
View Answer

4. Which of the following is/are an example of pigeon hole principle?


a) Softball team
b) Sock picking
c) Hair counting
d) All of the mentioned
View Answer

5. Pigeonhole principle can be applied in the following computer science algorithms:


a) hashing algorithm
b) lossless compression algorithm
c) both (a) and (b)
d) none of the mentioned
View Answer

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

7. Which of the following fields may have pigeonhole principle violated?


a) Discrete mathematics
b) Computer Science
c) Quantum Mechanics
d) None of the mentioned
8. Which of the following is not an application of Pumping Lemma?
a) {0i1i|i>=0}
b) {0ix|i>=0, x∈{0, 1}* and |x|<=i}
c) {0n| n is prime}
d) None of the mentioned
View Answer

9. Which of the following can refer a language to be non regular?


a) Pumping Lemma
b) Myphill Nerode
c) Both (a) and (b)
d) None of the mentioned

8. If L is a regular language, then (L’)’ U L will be :


a) L
b) L’
c) f
d) none of the mentioned
View Answer

9. If L is a regular language, then (((L’)r)’)* is:


a) regular
b) non regular
c) may be regular
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

3. If L1′ and L2′ are regular languages, then L1.L2 will be


a) regular
b) non regular
c) may be regular
d) none of the mentioned
View Answer

4. If L1 and L2′ are regular languages, L1 ∩ (L2′ U L1′)’ will be


a) regular
b) non regular
c) may be regular
d) none of the mentioned
View Answer

5. If A and B are regular languages, !(A’ U B’) is:


a) regular
b) non regular
c) may be regular
d) none 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

10. 8. Let h(0)=ab; h(1)=e


Let L={abab,baba}
h-1(L)= the language of two zeroes and any number of one’s.
The given example belongs to which of the following?
a) Homomorphism
b) Inverse Homomorphism
c) Both (a) and (b)
d) None of the mentioned

6. Which of the following obey the closure properties of Regular language?


a) Homomorphism
b) Inverse Homomorphism
c) Reversal
d) All of the mentioned

1. If L is a language, the reversal of the language can be represented as:


a) L’
b) Lc
c) Lr
d) more than one option is correct
View Answer
2. If L is a regular language, ____ is also regular.
a) Lr
b) L’
c) L*
d) All of the mentioned

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

6. 6. Which of the following is a not a part of 5-tuple finite automata?


a) Input alphabet
b) Transition function
c) Initial State
d) Output Alphabet
View Answer
7. If an Infinite language is passed to Machine M, the subsidiary which gives a finite solution to
the infinite input tape is ______________
a) Compiler
b) Interpreter
c) Loader and Linkers
d) None of the mentioned

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

2. 1. Which of the following not an example Bounded Information?


a) fan switch outputs {on, off}
b) electricity meter reading
c) colour of the traffic light at the moment
d) none of the mentioned
View Answer

3. 2. A Language for which no DFA exist is a________


a) Regular Language
b) Non-Regular Language
c) May be Regular
d) Cannot be said
View Answer

4. 3. A DFA cannot be represented in the following format


a) Transition graph
b) Transition Table
c) C code
d) None of the mentioned

5. When are 2 finite states equivalent?


a) Same number of transitions
b) Same number of states
c) Same number of states as well as transitions
d) Both are final states
View Answer

6. 6. What does the following figure most correctly represents?

a) Final state with loop x


b) Transitional state with loop x
c) Initial state as well as final state with loop x
d) Insufficient Data

7. 9. Can a DFA recognize a palindrome number?


a) Yes
b) No
c) Yes, with input alphabet as ∑*
d) Can’t be determined
View Answer

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

1. The password to the admins account=”administrator”. The total number of states


required to make a password-pass system using DFA would be __________
a) 14 states
b) 13 states
c) 12 states
d) A password pass system cannot be created using DFA
5. For a machine to surpass all the letters of alphabet excluding vowels, how many
number of states in DFA would be required?
a) 3
b) 2
c) 22
d) 27

7. Given L= {Xϵ∑*= {a, b} |x has equal number of a, s and b’s}.


Which of the following property satisfy the regularity of the given language?
a) Regularity is dependent upon the length of the string
b) Regularity is not dependent upon the length of the string
c) Can’t be said for a particular string of a language
d) It may depend on the length of the string

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

8.Which among the following is not notated as infinite language?


a) Palindrome
b) Reverse
c) Factorial
d) L={ab}*

1. How many languages are over the alphabet R?


a) countably infinite
b) countably finite
c) uncountable finite
d) uncountable infinite
View Answer

2. According to the 5-tuple representation i.e. FA= {Q, ∑, δ, q, F}


Statement 1: q ϵ Q’; Statement 2: FϵQ
a) Statement 1 is true, Statement 2 is false
b) Statement 1 is false, Statement 2 is true
c) Statement 1 is false, Statement 2 may be true
d) Statement 1 may be true, Statement 2 is false

3. δˆ tells us the best:


a) how the DFA S behaves on a word u
b) the state is the dumping state
c) the final state has been reached
d) Kleene operation is performed on the set

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

1. There are ________ tuples in finite state machine.


a) 4
b) 5
c) 6
d) unlimited
View Answer
Answer:b
Explanation: States, input symbols,initial state,accepting state and transition function.
2. Transition function maps.
a) Σ * Q -> Σ
b) Q * Q -> Σ
c) Σ * Σ -> Q
d) Q * Σ -> Q
View Answer
Answer:d
Explanation: Inputs are state and input string output is states.
3. Number of states require to accept string ends with 10.
a) 3
b) 2
c) 1
d) can’t be represented.
View Answer
Answer:a
Explanation: This is minimal finite automata.
4. Extended transition function is .
a) Q * Σ* -> Q
b) Q * Σ -> Q
c) Q* * Σ* -> Σ
d) Q * Σ -> Σ
View Answer
Answer:a
Explanation: This takes single state and string of input to produce a state.
5. δ*(q,ya) is equivalent to .
a) δ((q,y),a)
b) δ(δ*(q,y),a)
c) δ(q,ya)
d) independent from δ notation
View Answer

6. String X is accepted by finite automata if .


a) δ*(q,x) E A
b) δ(q,x) E A
c) δ*(Q0,x) E A
d) δ(Q0,x) E A
View Answer

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

9. Finite automata requires minimum _______ number of stacks.


a) 1
b) 0
c) 2
d) None of the mentioned
View Answer

10. Number of final state require to accept Φ in minimal finite automata.


a) 1
b) 2
c) 3
d) None of the mentioned
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

11. 2. Complement of a DFA can be obtained by


a) making starting state as final state.
b) no trival method.
c) making final states non-final and non-final to final.
d) make final as a starting state.
View Answer

12. 3. Complement of regular sets are _________


a) Regular
b) CFG
c) CSG
d) RE
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

14. 5. If L1 is regular L2 is unknown but L1-L2 is regular ,then L2 must be


a) Empty set
b) CFG
c) Decidable
d) Regular
View Answer

15. 6. Reverse of a DFA can be formed by


a) using PDA
b) making final state as non-final
c) making final as starting state and starting state as final state
d) None of the mentioned
View Answer

16. 7. Reverse of (0+1)* will be


a) Phi
b) Null
c) (0+1)*
d) (0+1)
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

18. 9. Homomorphism of a regular set is _______


a) Universal set
b) Null set
c) Regular set
d) Non regular set
View Answer

19. 10. (a ^ 5b ^ 5)* is example of ________


a) Type 0 language
b) Type 1 language
c) Type 2 language
d) Type 3 language
View Answer
20. 11. Which of the following is type 3 language ?
a) Strings of 0’s whose length is perfect square
b) Palindromes string
c) Strings of 0’s having length prime number
d) String of odd number of 0’s
View Answer

21. 12. a ^ nb ^ n where (n+m) is even .


a) Type 0
b) Type 1
c) Type 2
d) Type 3

22. 13. Complement of a ^ nb ^ m where n >= 4 and m <= 3 is example of


a) Type 0
b) Type 1
c) Type 2
d) Type 3
View Answer

23. 14. a ^ nb ^ m where n >= 1, m >= 1, nm >= 3 is example of


a) Type 0
b) Type 1
c) Type 2
d) Type 3
View Answer

24. 15. Complement of (a + b)* will be


a) phi
b) null
c) a
d) b

25. 1. The entity which generate Language is termed as:


a) Automata
b) Tokens
c) Grammar
d) Data
View Answer
26. Answer: c
Explanation: The entity which accepts a language is termed as Automata while the one
which generates it is called Grammar. Tokens are the smallest individual unit of a
program.
27. 2. Production Rule: aAb->agb belongs to which of the following category?
a) Regular Language
b) Context free Language
c) Context Sensitive Language
d) Recursively Ennumerable Language
View Answer
28. Answer: c
Explanation: Context Sensitive Language or Type 1 or Linearly Bounded Non
deterministic Language has the production rule where the production is context
dependent i.e. aAb->agb.
29. 3. Which of the following statement is false?
a) Context free language is the subset of context sensitive language
b) Regular language is the subset of context sensitive language
c) Recursively ennumerable language is the super set of regular language
d) Context sensitive language is a subset of context free language
View Answer
30. Answer: d
Explanation: Every regular language can be produced by context free grammar and
context free language can be produced by context sensitive grammar and so on.

31. 4. The Grammar can be defined as: G=(V, ∑, p, S)


In the given definition, what does S represents?
a) Accepting State
b) Starting Variable
c) Sensitive Grammar
d) None of these
View Answer
32. 5. Which among the following cannot be accepted by a regular grammar?
a) L is a set of numbers divisible by 2
b) L is a set of binary complement
c) L is a set of string with odd number of 0
d) L is a set of 0n1n
View Answer
33. 6. Which of the expression is appropriate?
For production p: a->b where a∈V and b∈_______
a) V
b) S
c) (V+∑)*
d) V+ ∑
View Answer
34. 7. For S->0S1|e for ∑={0,1}*, which of the following is wrong for the language produced?
a) Non regular language
b) 0n1n | n>=0
c) 0n1n | n>=1
d) None of the mentioned

35. Which of the following statement is correct?


a) All Regular grammar are context free but not vice versa
b) All context free grammar are regular grammar but not vice versa
c) Regular grammar and context free grammar are the same entity
d) None of the mentioned
View Answer

36. 10. Are ambiguous grammar context free?


a) Yes
b) No

The language accepted by Push down Automaton:


a) Recursive Language
b) Context free language
c) Linearly Bounded language
d) All of the mentioned
Which of the following the given language belongs to?
L={ambmcm| m>=1}
a) Context free language
b) Regular language
c) Both (a) and (b)
d) None of the mentioned
View Answer
Answer: d
Explanation: The given language is neither accepted by a finite automata or a push down automata.
Thus, it is neither a context free language nor a regular language

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

9. __________ is the acyclic graphical representation of a grammar.


a) Binary tree
b) Oct tree
c) Parse tree
d) None of the mentioned
View Answer

10. Grammar is checked by which component of compiler


a) Scanner
b) Parser
c) Semantic Analyzer
d) None of the mentioned

1. The most suitable data structure used to represent the derivations in compiler:
a) Queue
b) Linked List
c) Tree
d) Hash Tables

6. If |w|>=2h, then its parse tree’s height is at least _____


a) h
b) h+1
c) h-1
d) 2h
View Answer

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 symbol X is ________ if there exists : S->* aXb


a) reachable
b) generating
c) context free
d) none of the mentioned
View Answer
Answer: a
Explanation: 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

9. Which of the following parsers do not relate to Bottom up parsing?


a) LL parser
b) Recursive descent parser
c) Earley parsers
d) All of the mentioned
View Answer
10. Which of the following is true for a predictive parser?
a) Recursive Descent parser
b) no backtracking
c) Recursive Descent parser and no backtracking
d) None of the mentioned

1. To derive a string using the production rules of a given grammar, we use:


a) Scanning
b) Parsing
c) Derivation
d) All of the mentioned
View Answer
Answer: b
Explanation: Parsing is required to check the acceptability of a string. Further, comes the syntactical
phase which is taken care by other phases of compiler.
2. Which of the following parser reaches the root symbol of the tree at last?
a) Top down parser
b) Bottom up parser
c) TOP down and Bottom up parser
d) None of the mentioned
View Answer
Answer: b
Explanation: Bottom up parser starts from the bottom with the string and comes up to the start
symbolusing a parse tree or a derivation tree.
3. Left corner parsing methof uses which of the following?
a) Top down parser
b) Bottom up parser
c) TOP down and Bottom up parser
d) None of the mentioned
View Answer
Answer: c
Explanation: It is a hybrid method which works bottom up along the left edges of each subtree, and
top down on the rest of the parse tree.
4. Which of the following parser performs top down parsing?
a) LALR parser
b) LL parser
c) Recursive Accent parser
d) None of the mentioned
View Answer
Answer: b
Explanation: Bottom up parsing is done by shift reduce parsers like LALR parsers, Operator
precedence parsers, simple precedence parsers, etc.
5. Which of the following is true for shift reduce parsers?
a) Scans and parses the input in one forward pass over the text, without any backup.
b) A shift command advances in the input stream by one symbol
c) LALR parser
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

2. Which of the following are always unambiguous?


a) Deterministic Context free grammars
b) Non-Deterministic Regular grammars
c) Context sensitive grammar
d) None of the mentioned
View Answer

3. A CFG is not closed under


a) Dot operation
b) Union Operation
c) Concatenation
d) Iteration
View Answer

4. Which of the following is an real-world programming language ambiguity?


a) dangling else problem
b) halting problem
c) maze problem
d) none of the mentioned
View Answer

5. Which of the following is a parser for an ambiguous grammar?


a) GLR parser
b) Chart parser
c) All of the mentioned
d) None of the mentioned
View Answer

6. A language that admits only ambiguous grammar:


a) Inherent Ambiguous language
b) Inherent Unambiguous language
c) Context free language
d) Context Sensitive language
View Answer

7. Which of the following is an example of inherent ambiguous language?


a) {an|n>1}
b) {anbncmdm| n,m > 0}
c) {0n1n|n>0}
d) None of the mentioned

3. Every grammar in Chomsky Normal Form is:


a) regular
b) context sensitive
c) context free
d) all of the mentioned
View Answer
Answer: c
1. The context free languages are closed under:
a) Intersection
b) Complement
c) Kleene
d) None of the mentioned
View Answer
Answer: c
1. The context free languages are closed under:
a) Intersection
b) Complement
c) Kleene
d) None of the mentioned
View Answer
Answer: c
Explanation: Context free languages are closed under the following operation: union, kleene and
concatenation. For regular languages, we can add intersection and complement to the list.
2. Given Grammar G1:
S->aSb
S->e
Grammar G2:
R->cRd
R->e
If L(G)=L(G1) U L(G2), the number of productions the new starting variable would have:
a) 2
b) 3
c) 4
d) 1
View Answer

3. Context free languages are not closed under:


a) Intersection
b) Intersection with Regular Language
c) Complement
d) All of the mentioned
View Answer

4. Which of the following is incorrect?


There exists algorithms to decide if:
a) String w is in CFL L
b) CFL L is empty
c) CFL L is infinite
d) All of the mentioned
View Answer
5. If the start symbol is one of those symbols which produce no terminal through any sequence, the
CFL is said to be
a) nullable
b) empty
c) eliminated
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

7. Which of the following is/are CFL not closed under?


a) Reverse
b) Homomorphism
c) Inverse Homomorphism
d) All of the mentioned

You might also like