Consider the following DFA in which s0 is the start state and s1, s3 are the…

2007

Consider the following DFA in which s0 is the start state and s1, s3 are the final states.


2007_47


What language does this DFA recognize ?

  1. A.

    All strings of x and y

  2. B.

    All strings of x and y which have either even number of x and even number of y or odd number or x and odd number of y

  3. C.

    All strings of x and y which have equal number of x and y

  4. D.

    All strings of x and y with either even number of x and odd number of y or odd number of x and even number of y

Attempted by 61 students.

Show answer & explanation

Correct answer: D

The DFA recognizes strings where the number of x's and y's have opposite parity: either an even number of x's and odd number of y's, or an odd number of x's and even number of y's.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir