Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

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 mentionedI have been asked this question at a job interview.This intriguing question comes from Properties-Non Regular Languages in chapter Regular Expressions and Languages of Automata Theory

Answer»

Correct choice is (d) NONE of the mentioned

To explain: All of the GIVEN languages are regular and finite and thus, can be REPRESENTED using respective deterministic finite automata. We can ALSO use mealy or moore machine to represent remainders for OPTION c.

2.

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 mentionedI got this question in class test.The origin of the question is Lexical Analysis in division Regular Expressions and Languages of Automata Theory

Answer» RIGHT CHOICE is (c) token stream, parse tree

The best I can explain: The lexical analyzer outputs the stream of token which is taken up by SYNTAX analyzer one by one against the production rule and parse tree is generated.
3.

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 AnalyzerThis question was addressed to me in my homework.Question is taken from Lexical Analysis in section Regular Expressions and Languages of Automata Theory

Answer»

The CORRECT answer is (b) Statement 1 is assertion, Statement 2 is the solution

For EXPLANATION: The Longest MATCH rule states that the lexeme scanned should be determined on the basis of longest match among all the token available.

4.

State true or false:Statement:A lexical analyzer reads the source code line by line.(a) Statement:A lexical analyzer reads the source code line by line.(b) True(c) FalseThe question was posed to me during an online interview.I'm obligated to ask this question of Lexical Analysis topic in portion Regular Expressions and Languages of Automata Theory

Answer»

The correct option is (b) True

To explain: A lexical analyzer READS the source CODE letter by letter and when it encounters a space or an operator or any special CHARACTER, it decides that the WORD is completed.

5.

Which of the following do Regexps do not find their use in?(a) search engines(b) word processors(c) sed(d) none of the mentionedThe question was asked in an interview.I need to ask this question from Converting Regular Expressions to Automata in division Regular Expressions and Languages of Automata Theory

Answer»

Right option is (d) none of the mentioned

For explanation: Regexp processors are found in SEVERAL search engines, seach and REPLACE mechanisms, and text PROCESSING utilities.

6.

Regular expression are(a) Type 0 language(b) Type 1 language(c) Type 2 language(d) Type 3 languageThis question was addressed to me during an online interview.My question comes from Regular Language & Expression topic in section Regular Expressions and Languages of Automata Theory

Answer» RIGHT OPTION is (a) TYPE 0 language

Explanation: According to Chomsky HIERARCHY .
7.

Can the given state diagram be reduced?(a) Yes(b) NoI got this question by my school principal while I was bunking the class.I would like to ask this question from Conversion by Eliminating states in chapter Regular Expressions and Languages of Automata Theory

Answer»

Right CHOICE is (a) Yes

For explanation: The STATE q2 can be ELIMINATED with ease and the reduced state DIAGRAM can be represented as:

8.

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 mentionedThis question was posed to me in a national level competition.Question is from Building Regular Expressions in division Regular Expressions and Languages of Automata Theory

Answer»

The correct choice is (b) {w | w is a string of length multiple of 3}

Best explanation: This regular EXPRESSION can be used to ELIMINATE the answers and get the result. The length can be even and as WELL more than 3 when R= (∑∑∑) (∑∑∑) (particular case).

9.

Which among the following can be an annihilator for multiplication operation?(a) 0(b) 1(c) 100(d) 22/7I had been asked this question in my homework.Question is from Finding Patterns in Text,Algebric Laws and Derivatives in division Regular Expressions and Languages of Automata Theory

Answer»

Correct answer is (a) 0

The best EXPLANATION: An annihilator for an operator is a value such that when the operator is applied to the annihilator and some other value, the RESULT is the annihilator.

10.

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+This question was addressed to me in an internship interview.Enquiry is from Regular Language & Expression in section Regular Expressions and Languages of Automata Theory

Answer»

The correct OPTION is (c) (AB)* and a*b*

For EXPLANATION: (ab)*=(a*b*)*.

11.

Precedence of regular expression in decreasing order is(a) * , . , +(b) . , * , +(c) . , + , *(d) + , a , *I have been asked this question in an interview.This intriguing question originated from Regular Language & Expression in section Regular Expressions and Languages of Automata Theory

Answer» CORRECT CHOICE is (a) * , . , +

To EXPLAIN: NONE.
12.

The behaviour of NFA can be simulated using DFA.(a) always(b) never(c) sometimes(d) none of the mentionedThe question was asked in my homework.The doubt is from Conversion by Eliminating states in portion Regular Expressions and Languages of Automata Theory

Answer» RIGHT choice is (a) always

Explanation: For EVERY NFA, there exists an EQUIVALENT DFA and vice VERSA.
13.

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+ε)I got this question in a national level competition.My question is based upon Building Regular Expressions topic in chapter Regular Expressions and Languages of Automata Theory

Answer» CORRECT choice is (a) (0+10)*(1+ε)

The best I can explain: All the options except ‘a’ accept those STRINGS which comprises minimum ONE PAIR of 1’s together.
14.

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, DotI got this question in quiz.The query is from Building Regular Expressions in section Regular Expressions and Languages of Automata Theory

Answer»

Correct option is (c) Kleene, Dot, Union

To elaborate: If a regular language expression is GIVEN, the appropriate order of PRECEDENCE if the PARENTHESIS is IGNORED is: STAR or Kleene, Dot or Concatenation, Union or Plus.

15.

The given NFA corresponds to which of the following Regular expressions?(a) (0+1) *(00+11) (0+1) *(b) (0+1) *(00+11) *(0+1) *(c) (0+1) *(00+11) (0+1)(d) (0+1) (00+11) (0+1) *I got this question in exam.I'd like to ask this question from Regular Expression-Introduction topic in portion Regular Expressions and Languages of Automata Theory

Answer»

Correct choice is (a) (0+1) *(00+11) (0+1) *

BEST explanation: The transition states shown are the result of breaking down the given regular expression in fragments. For dot operation, we CHANGE a state, for union (PLUS) operation, we diverge into two TRANSITIONS and for Kleene Operation, we apply a loop.

16.

Myphill Nerodedoes the following:(a) Minimization of DFA(b) Tells us exactly when a language is regular(c) Both (a) and (b)(d) None of the mentionedThis question was posed to me by my college professor while I was bunking the class.This is a very interesting question from Properties-Non Regular Languages topic in chapter Regular Expressions and Languages of Automata Theory

Answer»

Correct option is (C) Both (a) and (b)

To explain: In automata theory, the Myphill Nerode THEOREM provides a necessary and SUFFICIENT CONDITION for a language to be regular. The Myphill Nerode theorem can be used to show a language L is regular by proving that the number of equivalence CLASSES of RL(relation) is finite.

17.

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 mentionedI had been asked this question by my college professor while I was bunking the class.Question is taken from Properties-Non Regular Languages topic in division Regular Expressions and Languages of Automata Theory

Answer»

The correct answer is (B) Let L be a regular language. If ~L has K equivalent classes, then any DFA that recognizes L must have ATMOST k states.

Explanation: Let L be a regular language. If ~L has k equivalent classes, then any DFA that recognizes L must have atleast k states.

18.

If L is DFA-regular, L’ is(a) Non regular(b) DFA-regular(c) Non-finite(d) None of the mentionedI had been asked this question during an interview for a job.Question is from Properties-Non Regular Languages topic in section Regular Expressions and Languages of Automata Theory

Answer»

Correct choice is (b) DFA-regular

To elaborate: This is a simple example of a closure property: a property saying that the SET of DFA-regular LANGUAGES is CLOSED under CERTAIN operations.

19.

Which of the following are not quantifiers?(a) Kleene plus +(b) Kleene star *(c) Question mark ?(d) None of the mentionedThis question was posed to me during an internship interview.My query is from Converting Regular Expressions to Automata in division Regular Expressions and Languages of Automata Theory

Answer»

Correct OPTION is (d) None of the mentioned

Easiest explanation: A quantifier after atoken SPECIFIES how often the preceding element is allowed to occur. ?, *, +, {n}, {min, }, {min, MAX} are few quantifiers we use in regexps IMPLEMENTATIONS.

20.

The scanner outputs:(a) Stream of tokens(b) Image file(c) Intermediate code(d) Machine codeI have been asked this question during a job interview.Question is from Lexical Analysis topic in division Regular Expressions and Languages of Automata Theory

Answer» RIGHT answer is (a) Stream of tokens

Easy explanation: A scanner or a lexical ANALYZER takes a SOURCE code as input and OUTPUTS a stream of token after fragmenting the code.
21.

Regular expression Φ* is equivalent to(a) ϵ(b) Φ(c) 0(d) 1I got this question in an international level competition.The doubt is from Regular Language & Expression in portion Regular Expressions and Languages of Automata Theory

Answer»

The CORRECT ANSWER is (a) ϵ

To ELABORATE: NONE.

22.

Which of the following methods is suitable for conversion of DFA to RE?(a) Brzozowski method(b) Arden’s method(c) Walter’s method(d) All of the mentionedThis question was addressed to me during an online interview.The origin of the question is Conversion by Eliminating states in division Regular Expressions and Languages of Automata Theory

Answer»

The CORRECT OPTION is (a) Brzozowski METHOD

The explanation: Brzozowski method takes a unique approach to generating regular EXPRESSIONS. We create a SYSTEM of regular expressions with one regular expression unknown for each state in M, and then we solve the system for Rλ where Rλ is the regular expression associated with starting state qλ.

23.

The minimum number of 1’s to be used in a regular expression of the given language:R(x): The language of all strings containing exactly 2 zeroes.(a) 2(b) 3(c) 0(d) 1The question was posed to me in an online quiz.The query is from Finding Patterns in Text,Algebric Laws and Derivatives topic in section Regular Expressions and Languages of Automata Theory

Answer»

The correct choice is (b) 3

Best explanation: It is not required to automate the question if ASKED theoretically.The number of zeroes FIXED is 2. Therefore, we can REPRESENT the REGULAR expression as 1*01*01*.

24.

L is a regular Language if and only If the set of __________ classes of IL is finite.(a) Equivalence(b) Reflexive(c) Myhill(d) NerodeThe question was posed to me during an interview.My question comes from Regular Expression-Introduction topic in chapter Regular Expressions and Languages of Automata Theory

Answer»

Correct option is (a) EQUIVALENCE

The explanation is: According to MYHILL Nerode theorem, the corollary proves the GIVEN statement correct for equivalence CLASSES.

25.

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 mentionedI had been asked this question in an interview for internship.I'm obligated to ask this question of Lexical Analysis topic in section Regular Expressions and Languages of Automata Theory

Answer»

The correct OPTION is (a) RULE priority

To explain I WOULD say: The LEXICAL analyzer follows the rule priority where its prioritizes KEYWORDS over an input it gets with the same name as that of the keyword and thus generates an error.

26.

Generate the regular expression to match blank lines(a) / */(b) /bl(c) /^?/(d) /^(dollarSign)/The question was asked in an international level competition.Question is taken from Regular Expression in UNIX topic in portion Regular Expressions and Languages of Automata Theory

Answer»

Correct answer is (d) /^$/

The explanation: There are few expressions which provide the utility of MATCHING metacharacters INCLUDING /^$/ for blank lines,/ */ for matching one or more spaces, /^.*$/ for matching an entire LINE whatever it is.

27.

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+ε)^4I had been asked this question in examination.The above asked question is from Regular Expression-Introduction in section Regular Expressions and Languages of Automata Theory

Answer»

The correct ANSWER is (d) (0+1+ε)^4

To elaborate: The extended notation would be (0+1)^4 but however, we MAY allow some or all the FACTORS to be ε. Thus ε NEEDS to be included in the given regular expression.

28.

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 mentionedI have been asked this question during an interview.I'm obligated to ask this question of Finding Patterns in Text,Algebric Laws and Derivatives in chapter Regular Expressions and Languages of Automata Theory

Answer»

Correct OPTION is (d) All of the mentioned

Explanation: There are two approaches to infer that certain string are in the language of a certain variable. The most CONVENTIONAL way is to use the rules from body to head, recursive inference. The second APPROACH is expanding the starting variable using one of its productions whose head is tart symbol and derive a string consisting ENTIRELY of terminals(head to body or derivations).

29.

Lexers and parsers are not found in which of the following?(a) compiler front end processing(b) prettyprinters(c) linters(d) none of the mentionedThe question was asked in quiz.Question is from Lexical Analysis topic in section Regular Expressions and Languages of Automata Theory

Answer»

The correct choice is (d) none of the mentioned

For explanation: Lexers and parsers are most COMMONLY used in compilers, but it has more application ELSEWHERE like in prettyprinters or LINTERS(application of STYLISTIC formatting conventions to textfiles, source code, etc.).

30.

Which of the following characters are ignored while lexical analysis?(a) .(b) =(c) #(d) WhiteSpaceI have been asked this question in an interview.Origin of the question is Lexical Analysis in portion Regular Expressions and Languages of Automata Theory

Answer»

The correct choice is (d) WhiteSpace

The BEST EXPLANATION: The lexical analyzer IGNORES all the whitespaces and fragments the program into tokens.

31.

Dot operator in regular expression resembles which of the following?(a) Expressions are juxtaposed(b) Expressions are multiplied(c) Cross operation(d) None of the mentionedI got this question in an online interview.Origin of the question is Building Regular Expressions topic in division Regular Expressions and Languages of Automata Theory

Answer»

Right answer is (a) Expressions are juxtaposed

Easy explanation: DOT operation or concatenation operation MEANS that the TWO expressions are juxtaposed i.e. there are no intervening operators in between. In fact, UNIX regular expressions use the dot for an ENTIRELY different purpose: representing any ASCII character.

32.

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 mentionedThis question was addressed to me in class test.This intriguing question comes from Operators of Regular Expression topic in chapter Regular Expressions and Languages of Automata Theory

Answer»

Right choice is (a) Create the NFA using Null moves

To explain: Two steps are to be FOLLOWED while converting a regular expression into a transition DIAGRAM:

a) CONSTRUCT the NFA using null moves.

b) Remove the null transitions and convert it into its equivalent DFA.

33.

(0+ε) (1+ε) represents(a) {0, 1, 01, ε}(b) {0, 1, ε}(c) {0, 1, 01 ,11, 00, 10, ε}(d) {0, 1}The question was asked in an interview.My question comes from Operators of Regular Expression in portion Regular Expressions and Languages of Automata Theory

Answer»

Correct choice is (a) {0, 1, 01, ε}

Easy EXPLANATION: The REGULAR expression is fragmented and the SET of the strings eligible is FORMED. ‘+’ represents UNION while ‘.’ Represents concatenation.

34.

Which of the following are related to tree automaton?(a) Myphill Nerode Theorem(b) State machine(c) Courcelle’s Theorem(d) All of the mentionedThe question was posed to me in a national level competition.This is a very interesting question from Properties-Non Regular Languages topic in section Regular Expressions and Languages of Automata Theory

Answer»

The CORRECT choice is (d) All of the mentioned

The EXPLANATION is: The myphill nerode theorem can be generalized to trees and an application of TREE automata prove an algorithmic meta theorem about GRAPHS.

35.

If ∑= {0,1}, then Ф* will result to:(a) ε(b) Ф(c) ∑(d) None of the mentionedI had been asked this question in an interview for job.My question comes from Building Regular Expressions in section Regular Expressions and Languages of Automata Theory

Answer»

The correct choice is (a) ε

The best I can explain: The star operation BRINGS together any NUMBER of strings from the language to get a string in the result. If the language is empty, the star operation can put together 0 strings, resulting only the empty string.

36.

Which of the following is same as the given DFA?(a) (0+1)*001(0+1)*(b) 1*001(0+1)*(c) (01)*(0+0+1)(01)*(d) None of the mentionedI had been asked this question in final exam.The doubt is from DFA to Regular Expressions topic in division Regular Expressions and Languages of Automata Theory

Answer»

Right answer is (a) (0+1)*001(0+1)*

The best explanation: There needs to be 001 TOGETHER in the string as an ESSENTIAL substring. Thus, the other components can be ANYTHING, 0 or 1 or E.

37.

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*)I got this question in examination.Enquiry is from Building Regular Expressions in section Regular Expressions and Languages of Automata Theory

Answer»

Right CHOICE is (d) (t*r*)

To explain: As Kleene OPERATION is not on the whole of the substring, it will not REPEAT and MAINTAIN the ORDER of t, r.

38.

Arden’s theorem is true for:(a) More than one initial states(b) Null transitions(c) Non-null transitions(d) None of the mentionedI have been asked this question in semester exam.My query is from Operators of Regular Expression topic in division Regular Expressions and Languages of Automata Theory

Answer»

Right option is (c) Non-null transitions

Easy explanation: Arden’s THEOREM strictly assumes the following;

a) No null transitions in the TRANSITION diagrams

b) True for only SINGLE initial state

39.

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*)*I got this question during an interview for a job.Asked question is from Operators of Regular Expression in chapter Regular Expressions and Languages of Automata Theory

Answer» CORRECT answer is (b) QP*

To elaborate: The given statement is the Arden’s Theorem and it tends to have a UNIQUE solution as QP*.

Let P and Q be regular expressions,

R=Q+RP

R=Q+(Q+RP) P

R=Q+((Q+RP) +RP) +P=Q+QP+RPP+RPP=Q+QP+(Q+RP) PP+(Q+RP) PP=Q+QP+QPP+RPPP+QPP+RPPP,

If we do this recursively, we GET:

R= QP*
40.

Which phase of compiler includes Lexical Analysis?(a) 1(b) 2(c) 3(d) Its primary function, not in any phaseThe question was asked during an online exam.I would like to ask this question from Lexical Analysis topic in division Regular Expressions and Languages of Automata Theory

Answer» RIGHT answer is (a) 1

The best EXPLANATION: The first phase of compilation process is called lexical analysis. It fragments the SOURCE code into TOKEN which is the smallest programming unit of a program.
41.

Which of the following cannot be used to decide whether and how a given regexp matches a string:(a) NFA to DFA(b) Lazy DFA algorithm(c) Backtracking(d) None of the mentionedI had been asked this question during an interview.Question is taken from Converting Regular Expressions to Automata topic in division Regular Expressions and Languages of Automata Theory

Answer»

The CORRECT option is (d) None of the mentioned

Easiest explanation: There are at least three algorithms which decides for us, whether and how a regexp matches a string which included the TRANSFORMATION of Non deterministic automaton to deterministic finite automaton, The lazy DFA algorithm where ONE simulates the NFA DIRECTLY, building each DFA on DEMAND and then discarding it at the next step and the process of backtracking whose running time is exponential.

42.

State true or false:Statement: The state removal approach identifies patterns within the graph and removes state, building up regular expressions along each transition.(a) Statement: The state removal approach identifies patterns within the graph and removes state, building up regular expressions along each transition.(b) true(c) falseThis question was addressed to me in an internship interview.My question is taken from Conversion by Eliminating states topic in chapter Regular Expressions and Languages of Automata Theory

Answer»

The correct option is (a) Statement: The STATE removal approach identifies patterns within the graph and removes state, building up REGULAR expressions along each transition.

For EXPLANATION: This METHOD has the advantage over the transitive CLOSURE technique as it can easily be visualized.

43.

What does “X?” do regular expression operator?(a) Matches zero or more capital X’s.(b) Matches no or one occurence of the capital letter X.(c) Matches one or more capital X’s.(d) All of the mentionedI had been asked this question in an interview for job.This intriguing question originated from Regular Expression in UNIX in division Regular Expressions and Languages of Automata Theory

Answer»

Right choice is (b) MATCHES no or one OCCURENCE of the capital LETTER X.

For explanation I would say: There are manyother common regular expression operators like $, ^, ETC. Which have their own respective purposes.

44.

Which of the following is not a step in elimination of states procedure?(a) Unifying all the final states into one using e-transitions(b) Unify single transitions to multi transitions that contains union of input(c) Remove states until there is only starting and accepting states(d) Get the resulting regular expression by direct calculationThe question was asked in examination.Origin of the question is Conversion by Eliminating states in chapter Regular Expressions and Languages of Automata Theory

Answer»

The correct answer is (B) Unify single TRANSITIONS to multi transitions that contains union of input

For explanation I would SAY: While eliminating the states, we unify multiple transitions to ONE transition that contains union of input and not the vice VERSA.

45.

Which among the following are incorrect regular identities?(a) εR=R(b) ε*=ε(c) Ф*=ε(d) RФ=RThe question was posed to me in an interview for internship.My question comes from Operators of Regular Expression in chapter Regular Expressions and Languages of Automata Theory

Answer»

The correct ANSWER is (d) RФ=R

For explanation I WOULD say: There are few identities over Regular EXPRESSIONS which INCLUDE: RФ=ФR=Ф≠R

46.

The action of parsing the source code into proper syntactic classes is known as:(a) Parsing(b) Interpretation analysis(c) Lexicography(d) Lexical AnalysisThe question was posed to me during an online interview.My question comes from Lexical Analysis in section Regular Expressions and Languages of Automata Theory

Answer»

Right option is (d) Lexical Analysis

The best I can explain: Lexical analysis or SCANNING is the PROCESS of parsing the SOURCE code into proper SYNTACTIC CLASSES. It gets things ready for the parser with lexemes to built the parse tree.

47.

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 elseI had been asked this question by my college professor while I was bunking the class.Enquiry is from Lexical Analysis topic in division Regular Expressions and Languages of Automata Theory

Answer»

The correct CHOICE is (c) generates an error

To explain I would say: RESERVED words are known as keywords and they are specific and reserved with its functionality to a language. THUS, GETTING an input with the same name by the analyzer will GENERATE an error.

48.

If we have more than one accepting states or an accepting state with an outdegree, which of the following actions will be taken?(a) addition of new state(b) removal of a state(c) make the newly added state as final(d) more than one option is correctThis question was posed to me during an interview.Question is from Conversion by Eliminating states topic in section Regular Expressions and Languages of Automata Theory

Answer»

Correct choice is (d) more than one option is correct

Best explanation: If there is more than one ACCEPTING STATE or if the single accepting state as an out degree , ADD a new accepting state, make all other states non accepting, and hold an e-transitions from each FORMER accepting state to the new accepting state.

49.

Which of the given regular expressions correspond to the automata shown?(a) (110+1)*0(b) (11+110)*1(c) (110+11)*0(d) (1+110)*1The question was posed to me in unit test.This interesting question is from DFA to Regular Expressions topic in portion Regular Expressions and Languages of Automata Theory

Answer»

Right answer is (c) (110+11)*0

To explain I would say: There is no STATE change for union operation, but has two different paths while for concatenation or dot operation, we have a state change for EVERY element of the STRING.

50.

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)*This question was posed to me during an internship interview.This intriguing question comes from Regular Language & Expression topic in section Regular Expressions and Languages of Automata Theory

Answer»

Right OPTION is (B) [(0+1)-(0b+a1)*(a+b)]*

EXPLANATION: EXCEPT b all are regular expression*.