The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+27 votes
2.3k views

Consider the set of strings on $\{0,1\}$ in which, every substring of $3$ symbols has at most two zeros. For example, $001110$ and $011001$ are in the language, but $100010$ is not. All strings of length less than $3$ are also in the language. A partially completed DFA that accepts this language is shown below.

The missing arcs in the DFA are:

A.
  00 01 10 11 q
$00$ $1$ $0$      
$01$       $1$  
$10$ $0$        
$11$     $0$    
B.
  00 01 10 11 q
$00$   $0$     $1$
$01$   $1$      
$10$       $0$  
$11$   $0$      
C.
  00 01 10 11 q
$00$   $1$     $0$
$01$   $1$      
$10$     $0$    
$11$   $0$      
D.
  00 01 10 11 q
$00$   $1$     $0$
$01$       $1$  
$10$ $0$        
$11$     $0$    
asked in Theory of Computation by Veteran (363k points)
edited by | 2.3k views

3 Answers

+24 votes
Best answer

(D) is the answer. From $00$ state, a '$0$' should take the DFA to the dead state-$q$. From $11$, a '$0$' should go to $10$ representing the $10$ at the end of string so far. Similarly, from $00$ a $1$ should go to $01$, from $01$ a '$1$' should go to $11$ and from $10$ a '$0$' should go to '$00$'.

answered by Veteran (363k points)
edited by
+4
From 11, a '0' should go to 10
+18 votes
'000' cannot be accepted. So, '00' when gets another 0 must go to a dead state, q.

So, options A and B are eliminated.

By analyzing options C and D, we can understand that when states like 00, 01, 11 or 10 get an input 1 or 0, the next state is the last two digits of the newly formed string.

11 +0 -> 110 (So, 11 on 0 goes to 10).

01+1 -> 011 (So, 01 on 1 goes to 11).

So option D is correct.
answered by (299 points)
0
Awsome Explaination.. thanks alot.......
+11 votes
Option A & B false: state 00 -> i/p 0 -> 01 ( state 01 is a final state) and our goal is to not allow 3 consequtive 0's

Option C is false:- state 10-> i/p 0 -> 10 (self loop is there on state 10 on i/p symbol 0 which allows more than 2 consequtive 0's)

Hence D is Ans.
answered by Boss (23k points)
Answer:

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

42,598 questions
48,599 answers
155,644 comments
63,711 users