# GATE | Gate IT 2008 | Question 30

If the final states and non-final states in the DFA below are interchanged, then which of the following languages over the alphabet {a,b} will be accepted by the new DFA?**(A)** Set of all strings that do not end with ab**(B)** Set of all strings that begin with either an a or a b**(C)** Set of all strings that do not contain the substring ab,**(D)** The set described by the regular expression b*aa*(ba)*b***Answer:** **(A)****Explanation:**

Seemingly, DFA obtained by interchanging final and non-final states will be complement of the given regular language. So, to prove that a family of string is accepted by complement of L, we will in turn prove that it is rejected by L.**(A)**. Set of all strings that do not end with ab – This statement could be proved right by looking at the b labeled incident edges on the final states and a labeled edges preceding them. Complement of the given DFA will have first two states as final states. First state doesn’t have any b labeled edge that has a labeled edge prior to it. Similarly, second final state doesn’t have any such required b labeled edge. Similarly, it could be proven that all the strings accepted by the given DFA end with ab. Now that L ∪ complement(L) = (a + b) ∗ , L should be the set of all the strings ending on ab and complement(L) should be set of all the strings that do not end with ab. [CORRECT]**(B)**. Set of all strings that begin with either an a or ab – This statement is incorrect. To prove that we just have to show that a string beginning with a or ab exists, which is accepted by the given DFA. String abaab is accepted by the given DFA, hence it won’t be accepted by its complement. [INCORRECT]**(C)**. Set of all strings that do not contain the substring ab – To prove this statement wrong, we need to show that a string exists which doesn’t contain the substring ab and is not accepted by current DFA. Hence, it will be accepted by its complement, making this statement wrong. String aba is not accepted by this DFA. [INCORRECT]**(D).** The set described by the regular expression b ∗ aa ∗ (ba) ∗ b ∗ – String abaaaba is not accepted by the given DFA, hence accepted by its com

This solution is contributed by **vineet purswani**.

Quiz of this Question

Attention reader! Don’t stop learning now. Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in **GATE Test Series Course**.

Learn all **GATE CS concepts with Free Live Classes** on our youtube channel.