Q23.Marks: +2.0UGC NET Paper 2: Computer Science and Application 26th June 2025 Shift 1
Consider the following DFA that generates set of strings over ∑={a, b, c)
Now identify that which of the followings is the best description of the language for the above DFA
1.L=(a* + b* + c*)*
2.L = (a + b + c)*(abc)*(a + b + c)*
3.L= {Set of strings, all starting with 'a, b, c' but ending with 'c'}
4. L= {Set of strings, all having even count (including 0) of substring 'abc'}✓ Correct
Solution
The correct answer is Option 4) L = { strings over {a,b,c} that contain an even number (including 0) of the substring “abc” }
Key Ideas
The DFA has six states that naturally split into two groups of three:
Even-parity copy: tracks how much of “abc” has been matched so far when the count of completed “abc” substrings is even (0, 2, 4, …).
Odd-parity copy: the same three “progress” states when the count is odd (1, 3, 5, …).
Within each copy, the machine remembers the progress toward “abc”:
state for “seen nothing yet” → on ‘a’ go to “seen a”;
state for “seen a” → on ‘b’ go to “seen ab”;
state for “seen ab” → on ‘c’ you complete “abc”.
Toggling parity: each time the machine reads a full “abc”, it moves to the same progress state in the other copy (even ⇄ odd). Thus the parity of the number of “abc” seen so far flips after every completion.
Accepting condition: all states in the even copy are accepting (including the start state). Therefore the DFA accepts exactly those strings with an even number of occurrences of the substring “abc” (0 is allowed).
How the transitions behave (intuition)
On symbols that continue the partial match (a→b→c), the machine advances along the “progress” states.
On symbols that break the match, it falls back to the longest proper prefix of “abc” that is also a suffix of what was just seen (KMP-style fallback). This ensures overlapping occurrences are handled (e.g., “…ababc…” contains two “abc”: the automaton will count both correctly).
When a full “abc” is read, the transition from the “seen ab” state on ‘c’ jumps to the corresponding state in the other parity copy, flipping even↔odd.
Quick traces
ε (empty string): 0 occurrences of “abc” → even → accepted.
abc: 1 occurrence → odd → rejected.
abcabc: 2 occurrences → even → accepted.
abca: still only 1 full “abc” → odd → rejected.
ababc: contains “abc” once (ending positions overlap is handled correctly) → odd → rejected; ababcabc has two → even → accepted.
Why the other options are incorrect
Option 1) (a* + b* + c*)* equals (a|b|c)* (i.e., all strings over {a,b,c}). Our DFA does not accept all strings (e.g., it rejects any string with an odd number of “abc”).
Option 2) (a + b + c)*(abc)*(a + b + c)* describes all strings that contain at least one “abc” (one or more). It accepts strings with 1, 3, 5, … occurrences too, but the DFA rejects those (odd count), so this is not correct.
Option 3) “strings starting with a/b/c and ending with c” is simply “strings ending with c”; the DFA accepts many strings not ending with c (e.g., the empty string, or abcabc), hence this description is wrong.
Takeaway
The structure (two 3-state copies and parity toggling upon completing “abc”) is the hallmark of a DFA recognizing strings in which the number of a specific substring is even. Therefore the best description is the language with an even count of the substring “abc”.