GATE 2008
185 questions
MCQ 1851-mark 52 · 2-mark 133
Questions 116–120 of 185
Which one of the following is TRUE?
Answer: (A)
M1: the first state stays on 0 and goes to the middle state on 1. From the middle state, 0 goes back to the first state and 1 goes to the final state, which loops on 0 and 1. So M1 accepts exactly the strings that contain 11 as a substring: .
M2: the first state loops on 0 and 1, and it can move on a 1 to the middle state and then on another 1 to the final state, which loops on 0 and 1. So M2 also accepts exactly the strings that contain 11: .
Both languages are the set of strings containing 11, so . So (A) is true.
Check the others:
(B) is false if means a proper subset, because the two sets are equal.
(C) , since a language and its complement share no string. So (C) is also true, as a direct consequence of (A).
(D) , so is false.
So, as set in the paper, both (A) and (C) are true. The basic result is , and (C) only follows from it, so (A) is the accepted key.
Answer: (A)
Answer: (A)
The given DFA reaches its final state only after reading , so it accepts exactly the strings that end with , that is .
Swapping final and non-final states gives the complement: the new DFA accepts all strings that do not end with .
The complement DFA (L') is:
A. Strings that do not end with . This is exactly L'.
B. Strings that begin with either or . The string begins with but is rejected, because it reaches the non-final state . Also is accepted by L' but begins with neither.
C. Strings that do not contain the substring . The string contains , yet it is accepted, because it ends in the final state .
D. The language of . Every such string has at least one , but is accepted by L'.
Answer: (A)
Answer: (A)
Each state of the DFA is a subset of the set of states of the equivalent NFA. So the equivalent DFA of an NFA can have at most states. Here is the number of states in the NFA. A set with items has at most subsets.
So, the answer here is (A).
1. + 0(01*1 + 00) * 01*
2. + 0(10 *1 + 00) * 0
3. + 0(10 *1 + 10) *1
4. + 0(10 *1 + 10) *10 *
Answer: (C)
P: s and n are final. From m, going back to m takes either 0 then 0 (via s), or 0, then 1's, then 1 (via n). The machine can end at s (after 0) or at n (after 0 and some 1's), so it ends with . This gives , which is 1.
Q: only s is final. Loops at m are 00 (via s) and (via n). The machine ends at s after a 0, so , which is 2.
R: only s is final. Loops at m are 10 (via s) and (via n). The machine ends at s after a 1, so , which is 3.
S: s and n are final, so it can end at s (after a 1) or at n (after 1 and some 0's), which is . Loops are the same as R, so , which is 4.
So P-1, Q-2, R-3, S-4. Check with 01010: Q reads it as s, m, n, n, m, s and ends in its final state, and it matches expression 2 as 0, 101, 0. P has no move on 1 from m, so it rejects the string, and expression 1 also cannot match it.
Answer: (C)
Which of the following represents the product automaton ZxY?
Answer: (A)
A state of the product ZxY is a pair (Z-state, Y-state). The start state is . A pair is final only when both machines are final, so only is final. Each entry is found by moving both machines on the same symbol. Name the pairs as in option A: .
For example, from on : Z goes and Y goes , giving .
From the start state P, the table sends to S and to the final state R. In B, C and D the move from P goes to Q, S and Q, which are all non-final, so they are wrong. Option A has the right start row and its rows for Q and R match the table. Its row for S reads Q, P where the table gives P, Q. This is a misprint in the paper's option A, but A is still the only option that fits.
Answer: (A)