MHB Finding DFA: Hint to Construct NFA for ((0∪1)*10* ∪ 0)

  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Dfa
Click For Summary
The discussion revolves around constructing a DFA that recognizes the language $((0 \cup 1)^{\ast} 1 0^{\ast}) \cup 0$. Participants explore how to convert an NFA to a DFA, emphasizing the need to create new states based on reachable sets from the initial states. They identify the importance of distinguishing between states that can lead to acceptance and those that cannot, ultimately merging identical states to simplify the DFA. The conversation highlights the iterative process of defining transitions until no new states can be added. The final consensus is that the constructed DFA correctly recognizes the specified language.
  • #31
I like Serena said:
I don't think so.
We can convert it to states with sets of the original states.
For $\epsilon$-transitions, we just need to draw in additional states that might be reached with an $\epsilon$-transition. (Thinking)

I haven't really understood what we have to do... (Worried)

By ignoring the $\epsilon$-transition, we have the following. Right?

$\begin{matrix}
& 0 & 1\\
\{q_0\} & \{q_3\} &\varnothing \\
\{q_3\} & \varnothing & \varnothing
\end{matrix}$

By including the $\epsilon$-transition, we have the following additional transitions:

$q_0 \overset{0,1}{\to} q_1$ and $q_0 \overset{1}{\to} q_3$

So do we have the following transition function?

$\begin{matrix}
& 0 & 1\\
\{q_0\} & \{q_1,q_3\} &\{q_1, q_3\} \\
\{q_3\} & \varnothing & \varnothing
\end{matrix}$Or have I understood it wrong? (Sweating)
 
Physics news on Phys.org
  • #32
evinda said:
I haven't really understood what we have to do... (Worried)

By ignoring the $\epsilon$-transition, we have the following. Right?

$\begin{matrix}
& 0 & 1\\
\{q_0\} & \{q_3\} &\varnothing \\
\{q_3\} & \varnothing & \varnothing
\end{matrix}$

By including the $\epsilon$-transition, we have the following additional transitions:

$q_0 \overset{0,1}{\to} q_1$ and $q_0 \overset{1}{\to} q_3$

So do we have the following transition function?

$\begin{matrix}
& 0 & 1\\
\{q_0\} & \{q_1,q_3\} &\{q_1, q_3\} \\
\{q_3\} & \varnothing & \varnothing
\end{matrix}$Or have I understood it wrong? (Sweating)

Shouldn't that be:
$q_0 \overset{0,1}{\to} q_1$ and $q_0 \overset{1}{\to} q_2$? (Wondering)Not so fast. (Worried)
Let's start with:
$\begin{matrix}
\delta' & 0 & 1\\
\{q_0\} & \{q_1,q_3\} &\{q_1, q_2\}
\end{matrix}$

Now we've found 2 new states, and we should try and find out where we can go from them, including implicit $\epsilon$-transitions if there are any:
$\begin{matrix}
\delta' & 0 & 1\\
\{q_0\} & \{q_1,q_3\} &\{q_1, q_2\} \\
\{q_1,q_3\} & ? & ? \\
\{q_1,q_2\} & ? & ?
\end{matrix}$

(Thinking)
 
  • #33
I like Serena said:
Shouldn't that be:
$q_0 \overset{0,1}{\to} q_1$ and $q_0 \overset{1}{\to} q_2$? (Wondering)

Oh yes, right... (Blush)

I like Serena said:
Not so fast. (Worried)
Let's start with:
$\begin{matrix}
\delta' & 0 & 1\\
\{q_0\} & \{q_1,q_3\} &\{q_1, q_2\}
\end{matrix}$

Now we've found 2 new states, and we should try and find out where we can go from them, including implicit $\epsilon$-transitions if there are any:
$\begin{matrix}
\delta' & 0 & 1\\
\{q_0\} & \{q_1,q_3\} &\{q_1, q_2\} \\
\{q_1,q_3\} & ? & ? \\
\{q_1,q_2\} & ? & ?
\end{matrix}$

(Thinking)

So we have the following transition function, right?$\begin{matrix}
\delta' & 0 & 1\\
\{q_0\} & \{q_1,q_3\} &\{q_1, q_2\} \\
\{q_1,q_3\} & \{ q_1\} & \{ q_1, q_2\} \\
\{q_1,q_2\} & \{q_1,q_2\} & \{ q_1, q_2\} \\
\{q_1\} & \{ q_1\} & \{ q_1, q_2 \}
\end{matrix}$

And these are all the states that are reachable from the starting state. So we get the following dfa

View attachment 5889

which is the same as we found before, right? (Smile)
 

Attachments

  • ddf.png
    ddf.png
    5.5 KB · Views: 117
  • #34
evinda said:
Oh yes, right... (Blush)
So we have the following transition function, right?$\begin{matrix}
\delta' & 0 & 1\\
\{q_0\} & \{q_1,q_3\} &\{q_1, q_2\} \\
\{q_1,q_3\} & \{ q_1\} & \{ q_1, q_2\} \\
\{q_1,q_2\} & \{q_1,q_2\} & \{ q_1, q_2\} \\
\{q_1\} & \{ q_1\} & \{ q_1, q_2 \}
\end{matrix}$

And these are all the states that are reachable from the starting state. So we get the following dfa
which is the same as we found before, right? (Smile)

Yep! (Nod)

One observation, according to your notes:

http://mathhelpboards.com/attachments/discrete-mathematics-set-theory-logic-15/5765d1469112227-construction-dfa-pr22-jpg

the start state should be $\{q_0, q_1\}$ instead of $\{q_0\}$, although that doesn't really change the DFA. (Nerd)
 
  • #35
I like Serena said:
the start state should be $\{q_0, q_1\}$ instead of $\{q_0\}$, although that doesn't really change the DFA. (Nerd)

Why is it like that? (Thinking)
 
  • #36
evinda said:
Why is it like that? (Thinking)

It's an arbitrary choice of the procedure.
It includes all empty transitions after each state.
Instead we just started with the start state after which we included all empty transitions before and after each state. (Nerd)

tl;dr it does not matter. (Wink)
 
  • #37
I like Serena said:
It's an arbitrary choice of the procedure.
It includes all empty transitions after each state.
Instead we just started with the start state after which we included all empty transitions before and after each state. (Nerd)

tl;dr it does not matter. (Wink)

So it includes all the states we can reach after any $\epsilon$-transition? Or only the states we can reach after the $\epsilon$-transitions that are immediately reached from the starting state? (Thinking)
 
  • #38
evinda said:
So it includes all the states we can reach after any $\epsilon$-transition? Or only the states we can reach after the $\epsilon$-transitions that are immediately reached from the starting state? (Thinking)

The $E$ function includes all states we can reach after any $\epsilon$-transition.
For consistency, no exception is made for the starting state. (Emo)
 
  • #39
I like Serena said:
The $E$ function includes all states we can reach after any $\epsilon$-transition.

Which function do you mean with the "$E$ function" ? (Thinking)
 
  • #40
evinda said:
Which function do you mean with the "$E$ function" ? (Thinking)

The one that your notes refer to as:

Formally, for $R \subseteq Q$ let
\[E(R)=\{q \mid q\text{ can be reached from R by traveling along $0$ or more $\varepsilon$ arrows} \}.\]
(Thinking)
 
  • #41
I like Serena said:
The one that your notes refer to as:

Formally, for $R \subseteq Q$ let
\[E(R)=\{q \mid q\text{ can be reached from R by traveling along $0$ or more $\varepsilon$ arrows} \}.\]
(Thinking)


Yes, I see.. I had understood it wrong and I thought that you meant that the starting state should contain all the states that could be reached after any $\epsilon$-transition... but the new starting state contains the starting state of the nfa and any states that can be reached after having read $\epsilon$ exactly after the starting state. Right?
 
  • #42
evinda said:
Yes, I see.. I had understood it wrong and I thought that you meant that the starting state should contain all the states that could be reached after any $\epsilon$-transition... but the new starting state contains the starting state of the nfa and any states that can be reached after having read $\epsilon$ exactly after the starting state. Right?

Yep! (Nod)

Still, that is any state that could be reached after any $\epsilon$-transition... without actually reading an input symbol. (Nerd)
 
  • #43
I like Serena said:
Yep! (Nod)

Still, that is any state that could be reached after any $\epsilon$-transition... without actually reading an input symbol. (Nerd)

I see... Thank you! (Smile)
 
  • #44
How can we justify in a few words that the dfa indeed recognizes the language $((0 \cup 1)^{\star}10^{\star}) \cup 0$? (Thinking)
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
2
Views
2K
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 45 ·
2
Replies
45
Views
4K