Automata All MCQ Diagram Question

 

6. If R represents a regular language, which of the following represents the Venn-diagram most correctly?
automata-theory-questions-answers-regular-expression-introduction-q6
a) An Irregular Set
b) R*
c) R complement
d) R reverse
View Answer

Answer: b
Explanation: The given diagram represents the Kleene operation over the Regular Language R in which the final states become the initial and the initial state becomes final.

 

final.

7. The given NFA corresponds to which of the following Regular expressions?
automata-theory-questions-answers-regular-expression-introduction-q7
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) *
View Answer

Answer: a
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.

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}
View Answer

Answer: d
Explanation: The given option represents {0, 01} in different forms using set operations and Regular Expressions. The operator like ^, v, etc. are logical operation and they form invalid regular expressions when used

8. What does the following segment of code output?

$string1 = "Hello World\n";

if ($string1 =~ m/(H..).(l..)/) {

  print "We matched '$1' and '$2'.\n";

}

a) We matched ‘Hel’ and ‘ld’
b) We matched ‘Hel’ and ‘lld’
c) We matched ‘Hel’ and ‘lo ‘
d) None of the mentioned
View Answer

Answer: c
Explanation: () groups a series of pattern element to a single element.
When we use pattern in parenthesis, we can use any of ‘$1’, ‘$2’ later to refer to the previously matched pattern.

9. Given segment of code:

$string1 = "Hello\nWorld\n";

if ($string1 =~ m/d\n\z/) {

  print "$string1 is a string ";

  print "that ends with 'd\\n'.\n";

}

What does the symbol /z does?
a) changes line
b) matches the beginning of a string
c) matches the end of a string
d) none of the mentioned
View Answer

Answer: c
Explanation: It matches the end of a string and not an internal line.The given segment of code outputs:
Hello
World
is a string that ends with ‘d\n’

14.Which among the following is equivalent to the given regular expression?
01*+1
a) (01)*+1
b) 0((1)*+1)
c) (0(1)*)+1
d) ((0*1)1*)*
View Answer

Answer: c
Explanation: Using the rules of precedence on the give expression, c is the appropriate choice with the order of: Bracket>Kleene>Dot>Union

1. Which of the following is same as the given DFA?
automata-theory-questions-answers-dfa-regular-expressions-q1
a) (0+1)*001(0+1)*
b) 1*001(0+1)*
c) (01)*(0+0+1)(01)*
d) None of the mentioned
View Answer

Answer: a
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.

3. The total number of states required to automate the given regular expression
(00)*(11)*
a) 3
b) 4
c) 5
d) 6
View Answer

Answer: c
Explanation: 
automata-theory-questions-answers-dfa-regular-expressions-q3

4. Which of the given regular expressions correspond to the automata shown?
automata-theory-questions-answers-dfa-regular-expressions-q4
a) (110+1)*0
b) (11+110)*1
c) (110+11)*0
d) (1+110)*1
View Answer

Answer: c
Explanation: 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.

4. Can the given state diagram be reduced?
automata-theory-questions-answers-mcqs-q4
a) Yes
b) No
View Answer

Answer: a
Explanation: The state q2 can be eliminated with ease and the reduced state diagram can be represented as:
automata-theory-questions-answers-mcqs-q4a

5. a? is equivalent to
a) a
b) a+Φ
c) a+ϵ
d) wrong expression
View Answer

Answer: c
Explanation: Zero or one time repetition of previous character .

6. ϵL is equivalent to
a) ϵ
b) Φ
c) L
d) Lϵ
View Answer

Answer: c,d
Explanation: None.

7. (a+b)* is equivalent to
a) b*a*
b) (a*b*)*
c) a*b*
d) none of the mentioned
View Answer

Answer: b
Explanation: None.

8. ΦL is equivalent to
a) LΦ
b) Φ
c) L
d) ϵ
View Answer

Answer: a,b
Explanation: None.

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

Answer: c
Explanation: (ab)*=(a*b*)*.

9. Given languages:
i) {a
nbn|n>=0}
ii) <div>
n</div>n
iii) {w
{a,b}| #a(w)=#b(w)}, # represents occurrences
Which of the following is/are non regular?
a) i, iii
b) i
c) iii
d) i, ii, iii
View Answer

Answer: d
Explanation: There is no regular expression that can parse HTML documents. Other options are also non-regular as they cannot be drawn into finite automaton.

8. For the given algorithm, find the probability of finding after k iterations:

find_a(array A, n, k)

begin

   i=0

     repeat

           Randomly select one element out of n elements

           i=i+1

     until i=k or a is found

end

a) (1/2)k
b) (1-(1/3))
k
c) 1-(1/2)k
d) None of the mentioned
View Answer

Answer: c
Explanation: The given is known as Monte Carlo Algorithm. If a is fount, the algorithm succeeds, else the algorith fails. The algorithm doesn not guarantee success but the run time is bounded.

For any transition function δ and for any two input strings x and y, δ(q, xy) = _________
a. δ(q, x).δ(q, y)
b. δ(q, yx)
c. δ(q, x)×δ(q, y)
d. δ(δ(q, x),y)

10. The regular expression described by following automata is,
a. 01*01*
b. (01)*
c. 0*1*
d. 1*0*

3. Which of the following option resembles the given PDA?
automata-theory-questions-answers-from-pda-grammars-q3
a) {0
n1n|n>=0}
b) {0
n12n|n>=0}
c) {0
2n1n|n>=0}
d) None of the mentioned
View Answer

Answer: a

 

 

 

4. Which of the following correctly resembles the given state diagram?
automata-theory-questions-answers-from-pda-grammars-q4
a) {ww
r|w=(a+b)*}
b) ε is called the initial stack symbol
c) Both (a) and (b)
d) None of the mentioned
View Answer

Answer: a
Explanation: Initially we put a special symbol ‘#’ into the empty stack. At state q1, the w is being read. In state q2, each 0 or 1 is popped when it matches the input. If any other input is given, the PDA will go to a dead state. When we reach that special symbol ‘#’, we go to the accepting state q3.

 

 

 

Q15. Which of the following does the given Mealy machine represents?


 

 

 

 

a)   9’s Complement

 

b)   2’s Complement

 

c)   1’s Complement

 

d)   10’s Complement

 

 

Q7. The following mealy machine outputs which of the following?


 

 

 

 

 

a)   9’s Complement

 

b)   2’s Complement

 

c)   1’s Complement

 

d)   10’s Complement

 

Q8. What is the complement of the language accepted by the NFA shown below? Assume ∑ = {a} and ε is the empty string

 


 

 

 

 

a)   Φ

 

b)   ε

 

c)   a

 

d)   {a, ε}

 

1. Given:
S->aSb
S->e
S-> A
A->aA
B->C
C->D
The ratio of number of useless variables to number of useless production is:
a) 1
b) 3/4
c) 2/3
d) 0
View Answer

Answer: a
Explanation: A, B, C, D are the useless symbols in the given grammar as they never tend to lead to a terminal. The productions S-> A, A->aA, B->C, C->D are also termed as useless production as they will never produce a string to the grammar.

 

2. Given:
S->…->xAy->…->w
if ____________, then A is useful, else useless symbol.
a) A is a non terminal
b) A is a terminal
c) w Î L
d) w Ë L
View Answer

Answer: c
Explanation: Whatever operation we perform in intermediate stages, if the string produced belongs to the language, A is termed as useful and if not, not a useful variable.

 

3. Which of the expressions correctly is an requirement of the pumping lemma for the context free languages?
a) uv
nwxny
b) uv
nwnxny
c) uv
2nwx2ny
d) All of the mentioned
View Answer

Answer: b
Explanation: Let L be a CFL. Then there is an integer n so that for any u that belong to language L satisfying |t| >=n, there are strings u, v, w, x, y and z satisfying
t=uvwxy
|vx|>0
|vwx|<=n For any m>=0, uv
nwxny L

 

4.  A language L is recursively ennumerable if L=L(M) for some turing machine M.
automata-theory-questions-answers-freshers-q8
Which among the following cannot be among A, B and C?
a) yes w
L
b) no w
L
c) M does not halt w
L
d) None of the mentioned
View Answer

Answer: d
Explanation:
automata-theory-questions-answers-freshers-q8a

 

1. Which of the following regular expression resembles the given diagram?
automata-theory-questions-answers-turing-machine-halting-q1
a) {a}*{b}*{a,b}
b) {a,b}*{aba}
c) {a,b}*{bab}
d) {a,b}*{a}*{b}*
View Answer

Answer: b
Explanation: 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)
automata-theory-questions-answers-turing-machine-halting-q2a
b)
automata-theory-questions-answers-turing-machine-halting-q2b
c)
automata-theory-questions-answers-turing-machine-halting-q2c
d)
automata-theory-questions-answers-turing-machine-halting-q2d
View Answer

Answer: c
Explanation: 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:
automata-theory-questions-answers-turing-machine-halting-q2e

 

5. d(q,X)=(r,Y,D) where D cannot be:
automata-theory-questions-answers-turing-machine-halting-q5
a) L
b) R
c) S
d) None of the mentioned
View Answer

Answer: c
Explanation: D represents the direction in which automata moves forward as per the queue which surely cannot be a starting variable.

 

9. The following turing machine acts like:
automata-theory-questions-answers-turing-machine-halting-q9
a) Copies a string
b) Delete a symbol
c) Insert a symbol
d) None of the mentioned
View Answer

Answer: b
Explanation: 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:
automata-theory-questions-answers-turing-machine-halting-q10
a) Copies a symbol
b) Reverses a string
c) Accepts a pal
d) None of the mentioned
View Answer

Answer: c
Explanation: 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.

 

3. In one move a turing machine will:
automata-theory-questions-answers-programming-techniques-storage-subroutines-q3
a) Change a state
b) Write a tape symbol in the cell scanned
c) Move the tape head left or right
d) All of the mentioned
View Answer

Answer: d
Explanation: A move of a turing machine is the function of the state of finite control and the tape symbol just scanned

8. A language L is recursively ennumerable if L=L(M) for some turing machine M.
IMG_256
Which among the following cannot be among A, B and C?
a) yes w L
b) no w L
c) M does not halt w L
d) None of the mentioned
View Answer

Answer: d
Explanation:
IMG_257

1. Which of the following regular expression resembles the given diagram?
IMG_256
a) {a}*{b}*{a,b}
b) {a,b}*{aba}
c) {a,b}*{bab}
d) {a,b}*{a}*{b}*
View Answer

Answer: b
Explanation: 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)IMG_257
b)IMG_258
c)IMG_259
d)IMG_260
View Answer

Answer: c
Explanation: 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:
IMG_261

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
View Answer

Answer: a
Explanation: The finite automata can be represented as:
IMG_262

 

5. d(q,X)=(r,Y,D) where D cannot be:
IMG_263
a) L
b) R
c) S
d) None of the mentioned
View Answer

Answer: c
Explanation: D represents the direction in which automata moves forward as per the queue which surely cannot be a starting variable.

9. The following turing machine acts like:
IMG_264
a) Copies a string
b) Delete a symbol
c) Insert a symbol
d) None of the mentioned
View Answer

Answer: b
Explanation: 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:
IMG_265
a) Copies a symbol
b) Reverses a string
c) Accepts a pal
d) None of the mentioned
View Answer

Answer: c
Explanation: 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.

3. In one move a turing machine will:
IMG_256
a) Change a state
b) Write a tape symbol in the cell scanned
c) Move the tape head left or right
d) All of the mentioned
View Answer

Answer: d
Explanation: A move of a turing machine is the function of the state of finite control and the tape symbol just scanned.

4. State true or false:
Statement: We can use the finite control of turing machine to hold a finite amount of data.
a) true
b) false
View Answer

Answer: a
Explanation:
IMG_257
The finite control not only contains state q but also three data, A, B, C. The following technique requires no extension to the Turing Machine model. Shaping states this way allows to describe transitions in more systematic way and often to simplify the strategy of the program.

10. For a basic turing machine, there exists an equivalent :
a) 2-counter machine
b) 3-counter machine
c) 4-counter machine
d) All of the mentioned
View Answer

Answer: d
Explanation: For a basic TM, there exists a 2-counter, 3-counter and 4-counter machines
We can prove them using Deterministic two stack turing machine.
Counter machine:
IMG_256

6. Convert the NFA to DFA

 

c) All of the mentioned
d) None of the mentioned
View Answer

Answer: a
Explanation: Initially Q is empty. Then since the initial state of the DFA is {0} , {0} is added to

3) A deterministic finite automation (DFA)D with alphabet ∑= {a,b} is given below

Which of the following finite state machines is a valid minimal DFA which accepts the same language as D?

Answer (A)
Options (B) and (C) are invalid because they both accept ‘b’ as a string which is not accepted by give DFA. D is invalid because it accepts bb+a which are not accepted by given DFA.

Following questions have been asked in GATE CS 2012 exam.

1) What is the complement of the language accepted by the NFA shown below? Assume ∑ = {a} and ε is the empty string

 

 

 

 

(A) Φ
(B) ε
(C) a
(D) {a, ε}

Answer (B)
The given alphabet ∑ contains only one symbol {a} and the given NFA accepts all strings with any number of occurrences of ‘a’. In other words, the NFA accepts a+. Therefore complement of the language accepted by automata is empty string.

4) Consider the set of strings on {0,1} in which, every substring of 3 symbols has at most two zeros. For examples, 001110 and 011001 are in the language, but 100010 is not. All strings of length less than 3 are also in the language. A partially completed DFA that accepts this language is shown below.

The missing arcs in the DFA are

Answer (D)

State ‘q’ is trap state. All other states are accept states. In state 00, DFA must move to ‘q’ for input symbol 0. All (non-trap) states indicate names indicate the characters seen before reaching that particular state. Option (D) is the only option that follows these rules.

14. Which NFA is correct for  the transition table as given below:

Present State

0

1

→q0

q0, q1

q0, q2

q1

q3

ε

q2

q2, q3

q3

→q3

q3

q3

 

a) Examples of NFA        b) https://quickgrid.files.wordpress.com/2015/10/subset-construction-nfa-from-transition-table.jpg

c) See the source image  d) None of these                                                  Ans a)

 

15. Given a NFA with N states, the maximum number of states in an equivalent minimized DFA is at least

a) N^2

b) 2^N

c) 2N

d) N!                                                                                                                                                            Ans b)

 

 

8. Which DFA is correct for the  given Language: accepting string ending with '01' over input alphabets  ∑={a.b}

a) b) Image result for accepting string ending with '01'  dfa c) https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCHrqHNpX1nnYaDx9UaGvd1I08XtMpW-VEqXERivKJkf_cbjohpFYHpOWhcbQtbyb0brVuwy4JIHL_gt0Hg0VRZrByWDJXPegOyubedkfqTGXvVQezjaxRB0WHwSoimvGB7Dv1n-wl778/s320/aaj.JPG   d) None of these Ans c

 

Q3) δ(q,ya) is equivalent to .

a) δ((q,y),a)

b) δ(δ(q,y),a)

c) δ(q,ya)

d) independent from δ notation

answer: b

 

Q1 What is wrong in the given definition?
Def: ({q0, q1, q2}, {0,1}, δ, q3, {q3})
a) The definition does not satisfy 5 Tuple definition of NFA
b) There are no transition definition
c) Initial and Final states do not belong to the Graph
d) Initial and final states can’t be same

Answer: c

Q8)Transition function maps.

a) Σ * Q -> Σ

b) Q * Q -> Σ

c) Σ * Σ -> Q

d) Q * Σ -> Q

 Answer: d

 

Q6  Choose the correct option for the given statement:
Statement: The DFA shown represents all strings which has 1 at second last position.
automata-theory-questions-answers-extended-transition-function-q2
a) Correct
b) Incorrect, Incomplete DFA
c) Wrong proposition
d) May be correct

Answer: c ( bcz it is nfa)

Choose the correct option for the given statement:
Statement: The DFA shown represents all strings which has 1 at second last position.

 


a) Correct
b) Incorrect, Incomplete DFA
c) Wrong proposition
d) May be correct

 

Answer: c

 

(D) 1, 3 and 4

8. Which of the following problems are decidable?

….1) Does a given program ever produce an output?

….2) If L is a context-free language, then is L’ (complement of L) also context-free?

….3) If L is a regular language, then is L’ also regular?

….4) If L is a recursive language, then, is L’ also recursive?

(A) 1, 2, 3, 4

(B) 1, 2,

(C) 2, 3, 4

(D) 3, 4

Q. If Σ = {a,b} and given productions are

S→XaaX

X→aX| bX|Λ

       Then the above grammar defines the language expressed by___________ regular expression

a.      (a+b)*aa(a+b)*

b.     (a+b)*a(a+b)*a

c.      (a+b)*aa(a+b)*aa

d.     (a+b)*aba+b)*

Ans-A

 

Q1. Consider the languages L1 = ᶲ and L2 = {a}. Which one of the following represents

 L1 L2* U L1

a) {€} b)ᶲ c) a* d) {€,a}

 

Q2. Let S and T be language over ={a,b} represented by the regular expressions (a+b*)*

and (a+b)*, respectively. Which of the following is true?

(a) ScT (S is a subset of T)

(b) TcS (T is a subset of S)

(c) S=T

(d) SnT=Ø

 


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

A.

S --> Sa | b

B.

S  --> aSb | ab

C.

S --> abX,  X --> cY,  Y --> d | aX

 

D.

None of these

Ans-B

 

Q1. Consider the languages L1 = ᶲ and L2 = {a}. Which one of the following represents

 L1 L2* U L1

a) {€} b)ᶲ c) a* d) {€,a}

 

Q2. Let S and T be language over ={a,b} represented by the regular expressions (a+b*)*

and (a+b)*, respectively. Which of the following is true?

(a) ScT (S is a subset of T)

(b) TcS (T is a subset of S)

(c) S=T

(d) SnT=Ø

 

 

 

 

16. Consider a finite automaton, with A-moves, given in Fig. which among the following is the

Equivalent automaton without A-moves.

 

a.    

 

 

 

b.     

c.     

 

d.      None of above

 

Answer a

 

15.  (a+b)* is equivalent to
a) b*a*
b) (a*b*)*
c) a*b*
d) none of the mentioned

Answer b

 

12. 7. Which of the following identity is wrong?

a) R + R = R

b) (R*)* = R*

c) ɛR = Rɛ = R

d) ØR = RØ = RR*

Answer d

 

9. Which of the following pairs of regular expressions are equivalent?

a. 1(01)* and (10)*1

b. x (xx)* and (xx)*x

c. x^+ and x^+ x^(*+)

d. All of the above mentioned

Answer d

 

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

Answer- a

 

5. If L1 is regular, then there exists some regular expression r1 which describes it. Same for L2.     Then:L1 U L2 = L(r1) U L(r2) = r1 + r2

r1 + r2 is a regular expression and therefore describes a regular language.

a.     True

b.     False

Answer : a

 

6.     If L1 = {an | n ≥ 0} and L2 = {bn | n ≥ 0} is regular
then L3 = L1.L2 = {a
m . bn | m ≥ 0 and n ≥ 0} is also regular?

a. False

b True

Answer b

 

4.

9.)Consider the finite automaton in the following figure. What is the set of reachable states for the input string 0011 ?

Image

a. q0, q1,q2

b. q0,q1

c. q0,q1,q2,q3

d. q3

 

5.What the following DFA accepts?
Image
a) x is a string such that it ends with ‘101’
b) x is a string such that it ends with ‘01’
c) x is a string such that it has odd 1’s and even 0’s
d) x is a strings such that it has starting and ending character as 1

 

 

6. Minimize the dfa below given transition table

a) 3 b)4 c)2 d)5

7.How many states are required after construct a minimal DFA

A)3 B)2 C)5 D)4

8)Statement 1: Acceptance of string only when it goes to first state to final state .

statement 2: String is accepted only when it statisfy the language .

a) Statement 1 is correct , Statement 2 is correct .

b) Statement 1 is not correct , Statement 2 is correct .

c)  Statement 1 is correct , Statement is not correct

d) Statement 1 is not correct , statement 2 is not correct

9) At which state  String  'aa'   accepted

a) D b) A c) B d) C

 10)  How many states after Minimize the below dfa

a) 3 b) 2 c) 4 d) 5

 

11) Which state is accepted  String '110101'

a) q2 b) q3 c) q1 d) q4

12) Minimize given dfa

a) {A,B,} {F} ,{C,D,E}

b){A,F},{B},{C,D,E}

C){A} {B,F} {C,D,E}

D){A,B,F){C,D,E}

 

Q: 1 How many states are require to construct a minimal dfa from the given DFA

a)2 b)3 c)4 d)5

2.From the given DFA which string is accepted

Image

a) abbabb b) abbabba c) aabba d) aaba

 

ans a

 

3.Which DFA is accept the string in which every a is followed by b where Σ = {a,b} .

a)Image

b) Image

 

c) Image 
d) None of these

 

Regular expression Φ* is equivalent to
a) ϵ
b) Φ
c) 0
d) 1

Answer:A

 

Q6) Find the regular expression for the given

 

Answer: (ab + b(a+bb))*

Q7) Find the regular expression for the given

 

Answer:  regular expression is only a, because state B is dead state.

Q8) Find the regular expression for the given

 

Answer: aa* + ba*

 

Q4) Find the regular expression for the given

Answer : c*a(d+bc*a)*

Q5) Find the regular expression for the given

Answer: b*(aa*(bb*+)+)

 

10. Consider the following languages

 L1=\left \{ ww|w\in \left \{ a,b \right \}*\right \} L2=\left \{ ww^{R}|w\in \left \{ a,b \right \}*, w^{R} is\ the\ reverse\ of\right\ w \}L3=\left \{ 0^{2i}| i\ is\ an\ integer \} L4=\left \{ 0^{i^{2}}| i\ is\ an\ integer \} 

Which of the languages are regular?

a)     Only L1 and L2

b)     Only L2, L3 and L4

c)     Only L3 and L4

d)     Only L3

 

 

Q1) Consider the languages L1 =  and L2 = {a}. Which one of the following represents L1 L2* U L1*

a){ epsilon } b) a*   c){epsilon,a} d)none

Answer:          A

Q2)

gatecs201313

Consider the DFA given.  Which of the following are FALSE?

1. Complement of L(A) is context-free.

2. L(A) = L((11*0+0)(0 + 1)*0*1*)

3. For the language accepted by A, A is the minimal DFA.

4. A accepts all strings over {0, 1} of length at least 2.

Answer:  3 and 4

Q3) Given the language L = {ab, aa, baa}, which of the following strings are in L*?

1) abaabaaabaa

2) aaaabaaaa

3) baaaaabaaaab

4) baaaaabaa

Answer : 1,2,4

 

8. The regular expression 0*(10*)* denotes the same set as

a) (1*0)*1*

b) 0 + (0 + 10)*

c) (0 + 1)* 10(0 + 1)*

d) none of these

 

4. Consider the languages L1=ɸ and L2 = {a}. Which one of the following represents L1 L2* U L1*

a)     A

b)     B

c)      C

d)     D

5. Given the language L = {ab, aa, baa}, which of the following strings are in L*?

1) abaabaaabaa

2) aaaabaaaa

3) baaaaabaaaab

4) baaaaabaa

a) 1, 2 and 3

b) 2, 3 and 4

c) 1, 2 and 4

d) 1, 3 and 4

 

12. Which among the following states would be notated as the final state/acceptance state?

L= {xϵ∑= {a, b} | length of x is 2}

https://compscibits.com/QuestionImages/62728-1.png

a. q1

b. q2

c. q1, q2

d. q3

Ans:- b

13. Which of the following are the final states in the given DFA according to the Language given ?
L= {xϵ∑= {a, b} |length of x is at most 2}

https://compscibits.com/QuestionImages/62729-1.png

a. q0, q1

b. q0, q2

c.q1, q2

d. q0, q1, q2

Ans:D

14. Which of the following x is accepted by the given DFA (x is a binary string ∑= {0,1})?

https://compscibits.com/QuestionImages/62730-1.png

a.       divisible by 3

b.       divisible by 2

c.       divisible by 2 and 3

d.       divisible by 3 and 2

Ans:- d

15. Choose the correct option for the given statement:

Statement: The DFA shown represents all strings which has 1 at second last position.

https://compscibits.com/QuestionImages/62731-1.png

a.       Correct

b.       Incorrect, Incomplete DFA

c.       Wrong proposition

d.       May be correct

 

  9.  Examine the following DFA: If input is 011100101, which edge is NOT traversed?

DFA

a. A B

b. C

c. C D

d. D A

Ans:- C

 

10. The transitional function of a NFA is

a. Q X Σ→Q

b. Q X Σ→2Q

c. Q X Σ→2n

d.Q X Σ→Qn

Ans:- B

 

  8. The relation between NFA-accepted languages and DFA accepted languages   is

a. >

b.<

c.=

d.<=

Ans:- c

 

 

Transition function maps.
a) Σ * Q -> Σ
b) Q * Q -> Σ
c) Σ * Σ -> Q
d) Q * Σ -> Q

Ans: - d

 

Question 3: There exists a language L. We define a string w such that wL 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

Ans: a

 

Which NDFA correctly represents the following RE

a(bab)*
a(ba)*

non deterministic finite automata

Ans. a

 

 

 

 

Q11

Which of the following is same as the given DFA?

https://compscibits.com/QuestionImages/62746-1.png

 

 

 

a.      (0+1)*001(0+1)*

 

b.     1*001(0+1)*

 

c.      (01)*(0+0+1)(01)*

 

d.     None of the mentioned

 

 

Ans. A

 

Q12

Which of the given regular expressions correspond to the automata shown?

https://compscibits.com/QuestionImages/62747-1.png

 

 

a.            (110+1)*0

b.           (11+110)*1

c.            (110+11)*0

d.           (1+110)*1

 

Ans. C

 

Q7 Consider the two automata

A.    A and B are Equivalent

B.     A and B are not Equivalent

C.     Cannot be defined

D.    None of these

Ans.A

 

 

Q3

Ans. C

Q4

                                                                                                                                                                             

Ans. A

Q5

Ans. B

 

 

 


Comments

Popular posts from this blog

Short Notes Of computer Network

Sort in specific order (GFG)

Notes on c/c++