Professional Documents
Culture Documents
Finite Automata - DPP 01
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 w1w2 = pq [NAT]
(b) The length of the string w1w2w3 = p + q + r 7. For 10 length strings, Total number of maximum
(c) The length of the string w1w2w3 = pqr substrings possible are _____.
(d) The length of the string w1w3 = 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
( )
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.