Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2019/ii/paper-4/4h/a/ii/solution

This language is recognized by the parity-counting deterministic finite automaton with four states
The initial state is and the only accepting state is . Reading leaves the state unchanged, reading toggles , and reading toggles . The state therefore records exactly the parities of the numbers of 's and 's. Thus

New to topics? Read the docs here!