Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

1

Branch : CSE & IT Batch : Hinglish


Theory of Computation
Finite Automata DPP-01

[MCQ] [MSQ]
1. Consider decimal alphabet  = {0, 1, 2, ...9}, then how 5. Which of the following is / are not an alphabet?
many two length strings are possible? (a)  = {a, b, ab}
(a) 4 (b) 20 (b)  = {1, 2, 3, 4 ....}
(c) 100 (d) 2 (c)  = { }
(d)  = {}
[MCQ]
2. Consider a binary alphabet () = {0, 1} [MSQ]
How many 3 length strings are possible, the third 6. If w is a string and wR is reversal of the string then
symbol of the string must be 0? which of the following is incorrect?
(a) 4 (b) 8
(wR ) = w
R
(c) 3 (d) 5 (a)

( ww R ) = w  w R
R
[MSQ] (b)
3. Consider the following strings and their respective
( wxw R ) = w  x  w R
R
lengths: (c)
|w1| = p
( ww R ) =w R  w
R
|w2| = q (d)
|w3| = r
Then, which of the following is/ are correct?
(a) The length of the string w1w2 = pq [NAT]
(b) The length of the string w1w2w3 = p + q + r 7. For 10 length strings, Total number of maximum
(c) The length of the string w1w2w3 = pqr substrings possible are _____.
(d) The length of the string w1w3 = p + r
[NAT]
[MCQ] 8. Consider following statements:
4. Which of the following is correct about Regular S1: Every prefix or suffix is a substring.
Grammar? S2: Total number of prefixes are same as total
(a) Every Regular grammar is Left Linear number of suffixes in a string.
Grammar. S3: Total number of suffixes for n length string is
(b) Every Right Linear grammar may/may not be (n + 1).
Regular Grammar. Number of correct statements are _______.
(c) If grammar is regular then it must be left
linear as well as right linear.
(d) If grammar is regular then it must be left linear
or right linear.
2

Answer Key
1. (c) 6. (b, c, d)
2. (a) 7. (56)
3. (b, d) 8. (3)
4. (d)
5. (a, b, c)
3

Hints and solutions


1. (c)
Alphabet () = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} 4. (d)
• Zero length string = 1 i.e., {} Regular Grammar
• One Length strings = 10
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
• Two Length Strings = 100 Left Linear Grammar Right Linear Grammar

• Grammar is regular if and only if either its LLG


or RLG
1st length 2nd length • Right Linear Grammar: V → TV*|T*
• Left Linear Grammar: V → VT*|T*
[0 - 9] [0 - 9]
10  10 = 100 5. (a, b, c)
• Alphabet is a set of finite non-empty
2. (a)
symbol.
• Alphabet () = {0, 1}
• Symbols in alphabet must be atomic.
• 3rd symbol of the string must be 0 means
(a)  = {a, b, ab}
last symbol fix. i.e., 0
part of the symbol not allowed.

(b)  = {1, 2, 3, ...}
Set of infinite symbols not allowed.
(c)  = { } empty not allowed.
(d)  = {} Allowed because in place of empty
1st 2nd 3rd
string we can put .
length length length
(0, 1) (0, 1)  (0)
6. (b, c, d)
=2  2  1=4
Let w = abc
Strings = {010, 000, 100, 110}
Then wR = cba
Hence, option (a) is correct.
( )
R
(a) w R = (cba)R = abc = w True
3. (b, d)
( )
R
|w1| = p (b) w  w R = (abc.cba)R = abccba
|w2| = q
False
|w3| = r
• |w1w2w3| = p + q + r
( )
R
• |w1w2| = p + q (c) w x w R = abc x R cba
• |w1w3| = p + r False
Hence, option (b, d) are correct.

( )
R
(d) ww R  wR w False
Hence, option (b, c, d) is correct
4

7. (56)
Range [56 to 56]
• for n length string, maximum number of
n(n+1)
substrings are +1
2
• for 10 length string, number of substrings =
10  11
+ 1 = 56
2
8. (3)
String (w) = 100
Prefix = {, 1, 10, 100} = 4
Suffix = {, 0, 00, 100} = 4
(1) True: Every prefix or suffix is a consecutive
subpart of string.
(2) True: Number of prefixes = Number of
suffixes.
(3) True: For n length string (n + 1) are
prefix or suffix.

Any issue with DPP, please report by clicking here:- https://forms.gle/t2SzQVvQcs638c4r5


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