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

Theory Of Computation _ Weekly Test 02 - Test Paper

The document is a weekly test for the Theory of Computation subject, focusing on Finite Automata, with a total of 15 marks. It includes multiple-choice questions (MCQs) and numerical answer type (NAT) questions, covering topics such as languages, states in finite automata, and regular expressions. An answer key and hints for solutions are provided at the end of the document.

Uploaded by

Believer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Theory Of Computation _ Weekly Test 02 - Test Paper

The document is a weekly test for the Theory of Computation subject, focusing on Finite Automata, with a total of 15 marks. It includes multiple-choice questions (MCQs) and numerical answer type (NAT) questions, covering topics such as languages, states in finite automata, and regular expressions. An answer key and hints for solutions are provided at the end of the document.

Uploaded by

Believer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

1

Branch : CSE & IT Batch: Hinglish


WEEKLY TEST – 02
Subject : Theory of Computation
Topic : Finite Automata Maximum Marks 15

Q.1 to 5 Carry ONE Mark Each


[MCQ]
1. For language L = {w | w {a, b}*}, |w| = 4}. How many How many states in equivalent minimized DFA that
states are required in NFA for above language? accepts the language?____.
(a) 4 (b) 5
(c) 6 (d) None of these [NAT]
4. Let
[NAT] L1 = a* b*
2. For language L = {X a w | X, w {a, b}*, |X| = 1}. L2 = b*a*
Minimum number of states required in finite automata L3 = (a + b) *
(NFA) is _____. L4 = a* b* a*
L = (L1 ∩ L2) – (L3 ∩ L4)
[NAT] Number of strings in above language L will be _____.
3. Consider the following DFA that accepts regular
language L over  = {a, b}.
[MCQ]
5. Consider a regular expression (R):
R = (a + b)* (a + b)2 (a + b)*.
How many equivalences classes are existing for
above regular expression R?
(a) 2 (b) 3
(c) 4 (d) None

Q.6 to 10 Carry TWO Mark Each

[MCQ] [MSQ]
6. Consider the language L given by the regular 7. Which of the following option is/are correct?
expression (a + b)* ab(a + b)* over the alphabet {a, b}. (a) For L = {w|w  {a, b}*, |w| = 5} Minimum
What is the correct regular expression of L ? number of states in DFA is 7.
(a) (a + b)* (ab + ba + bb + aa) +  (b) For L = {w|w  {a, b}* |w|  5} minimum number
(b) (a* b*)* (ba + bb + aa) (a*b*)* + a + b of stater in NFA is 6.
(c) (a + b)* ba (a + b)* + a + b (c) L = {w|w  {a, b}*}, 6th symbol from begin is ‘a’}
(d) (a + b)* (ba + bb + aa) (a + b)* +  + a + b minimum number of states in DFA is 64.
(d) L = {w|w  {a, b}*, 10th symbol from ends is ‘a’}
minimum number of states in DFA is 1024.
2

[MCQ]
[MCQ] 10. The following diagram represents a finite state
8. Consider the following statements: machine which takes as input a binary number from the
S1: If a finite automata M with n states accepts a string least significant bit
of length w, w ≥ n then surely L(M) is infinite.
S2: If a finite automata m with n states accepts a string
of length w, w < n then, surly L(M) is finite.
S3: The pumping length for any regular language is
unique.
Which of the following is correct: Which one of the following is TRUE?
(a) S1 and S2 are correct. (a) It computes 1’s complement of the input number
(b) S1 and S3 are correct. (b) It computes 2’s complement of the input number
(c) S2 and S3 are correct. (c) It increments the input number
(d) None of this. (d) It decrements the input number

[MSQ]
9. For language L = {Every odd bit is a}
On alphabet  = {a, b}. Which of the following is/are
correct regular expression?
(a) (aa + ab)* ( + a)
(b) (aa + ab + ba + b)*a
(c) (aa + ba)*( + a + b)
(d) (a(a + b))* + (a(a + b))* a
3

Answer Key
1. (b) 6. (d)
2. (3) 7. (a, b, d)
3. (2) 8. (d)
4. (0) 9. (a, d)
5. (b) 10. (b)
4

Hints and solutions

1. (b) L = {(a + b)* (ba + bb + aa) (a + b)* + }

7. (a, b, d)
Number of states = 5 (a) n + 2 = 5 + 2 = 7 states DFA
(b) n + 1 = 5 + 1 = 6 states NFA
2. (3) (c) n + 2 = 6 + 2 = 8 states DFA
(d) 2n = 210 = 1024 states DFA
Hence, (a, b, d) are correct.
Number of states = 3
The above NFA represents the language where 2nd 8. (d)
symbol is ‘a’. S1 True:

3. (2)

n=3
(w) ≥ 3
For 3 length there must be a loop an any
Number of states = 2
state. S2 False:
|w| < n
4. (0)
L1 ∩ L2 = a* + b* 2<3
L3 ∩ L4 = a* b* a* S2 will be true If and only if all the strings
L = (a* + b*) – a*b*a* S3 False: where | w | <n .
= Minimum pumping length is unique.
Number of strings = 0
9. (a, d)
5. (b)
R = (a + b)* (a + b)2 (a + b)*
Number of equivalence classes in my hill Nerode =
Number of states in minimal DFA
DFA for R:

FA:

Number of states = 3 Regular expression = (a(a + b))* a + (a (a + b))* a


Number of equivalence classes = 3 = (a(a + b))* ( + a) : (aa + ab)*( + a)
Hence, (a, d) are correct.
6. (d) 10. (b)
L = (a + b)* ab (a + b)*
L = {containing ‘ab’ as a substring}
It computes 2’s complement of the input number

For more questions, kindly visit the library section: Link for web: https://smart.link/sdfez8ejd80if

PW Mobile APP: https://smart.link/7wwosivoicgd4

You might also like