in Theory of Computation edited by
4,629 views
27 votes
27 votes
  1. Construct as minimal finite state machine that accepts the language, over $\{0,1\}$, of all strings that contain neither the substring $00$ nor the substring $11$.
  2. Consider the grammar
    • $S \to aSAb $
    • $S \to \epsilon $
    • $A \to bA $
    • $ A \to \epsilon $

    where $S$, $A$ are non-terminal symbols with $S$ being the start symbol; $a, b$ are terminal symbols and $\epsilon$ is the empty string. This grammar generates strings of the form $a^ib^j$ for some $i, j \geq 0$, where $i$ and $j$ satisfy some condition. What is the condition on the values of $i$ and $j$?

in Theory of Computation edited by
4.6k views

2 Answers

40 votes
40 votes
Best answer
  1. Language $L = (0+1)^*- (0+1)^*(00+11) (0+1)^*$
    $\textsf{DFA}$ contains $4$ states of which $3$ are final and $1$ is dead state.
  2. $i \leq j$
    as $S \rightarrow aSAb$ 
    There will be always one $a$ in left and minimum one $b$ in right and $A  \rightarrow bA \mid \epsilon$ can generate any number of $b\text{’}$s including null string. If $A$ is $\epsilon$ then $i=j$ and if $A$ is generating any $b,$ then $j>i$ so  condition is $i\leq j.$
edited by

4 Comments

No. It's not related to this question. Actually, I came across somewhere and thought of writing that. 😁
0
0
Can anyone give the solution using the intersection of 2 DFA method? I am not getting a minimal solution.
0
0

First Negate The Given Statement : 

~(Strings that contain neither the substring $00$ nor the substring $11$) 

$\implies $ Strings that contain the substring $00$ or the substring $11$

So the regular expression is : $L’ = (0+1)^*(00+11) (0+1)^*$

Then drawing it’s DFA is very easy :-

After this if you complement the machine (change all the final and non final states without touching the arrows), you will get the required min-DFA.

DFA made from : FSM Simulator (ivanzuzak.info)

2
2
2 votes
2 votes
j>=i is the condition.solve using some examples there will never be a condition when # of a's would be greater than # of b's

Related questions