The GATE Grind

GATE 2021 CS (CS2) – Question 27

Theory of Computation · Regular Expressions and Finite Automata · 1 mark · Numerical answer

For the DFA shown, how many binary strings of length eight are accepted?

Diagram for GATE 2021 CS (CS2) question 27

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 256 to 256

Explanation

The first two input bits move through the first two layers, in either case reaching the third layer. The third bit reaches the accepting state, whose loop accepts either symbol thereafter. Thus every binary word of length at least three is accepted. There are 2⁸=256 words of length eight.

More Regular Expressions and Finite Automata questions

All Regular Expressions and Finite Automata questions →