1,610 views
3 3 votes
Consider the set of strings on in which, every substring of 4 symbols has at most two ones. For example, 0011001010 and 011001 are in the language, but 110110 is not. All strings of length less than 4 are also in the language. Number of states in the minimal FA??

1 Answer

0 0 votes

L={w∈{0,1}∗∣every length-4 substring of w contains at most two 1's}

we will create 16 states to represent the four most recently-seen characters. 

s1 = 0000, s2 = 0001, s2 = 0010, s3 = 0011
s4 = 0100, s5 = 0101, s6 = 0110,  s7 = 0111
s8 = 1000, s9 = 1001, s10 = 1010, s11 = 1011
s12 = 1100, s12 = 1101, s14 = 1110, s15 = 1111 

then we need to create binary tree,

reject states = { s7, s11, s13, s14, s15 } so these will be dead state

we are left with 11 accepting states and 1 dead state.

δ(si,0)=sj where j≡2i (mod 16) and 

δ(si,1)=sj where j≡2i+1(mod 16)

It's complex but what can you expect from dfa with 12 states :p

• edited by
Position:
Show:

Related questions

2 2 votes
2 2 answers
277
277 views
GO Classes asked Jul 10
277 views
Let $\Sigma = \{a\}$. Consider the language $L = \{a^{nk} \mid k 0,\ n$ is a positive integer constant$\}$. What is the minimum number of states in a DFA that recognises...
2 2 votes
2 2 answers
299
299 views
codertoday asked Dec 10, 2025
299 views
 could someone please draw the DFA? Is the answer 16 or 18?
0 0 votes
2 2 answers
561
561 views