NFA Hello! (Wave) - Computation Theory Explanation

  • MHB
  • Thread starter evinda
  • Start date
  • Tags
    Computation
In summary: Yes. After reading 01 the automaton can end up in state $q_2$ and then without reading anything it can go to $q_3$. Thus, after reading 01 it can arrive in $q_3$. Therefore $q_3$ is in line 3.I recommend reading the definition carefully. It may save you many questions.
  • #1
evinda
Gold Member
MHB
3,836
0
Hello! (Wave)

According to the book of Michael Sipser: Introduction to the Theory of Computation we have the following:

View attachment 5733

View attachment 5735

Could you explain to me why after having read the first 0, we can go to state $q_3$ ?

I have drawn the tree and I find also an other result after having read the second 1.

That's what I get:

View attachment 5734

What am I doing wrong?
 

Attachments

  • 127.JPG
    127.JPG
    6.4 KB · Views: 72
  • tr.JPG
    tr.JPG
    16 KB · Views: 69
  • sym.JPG
    sym.JPG
    20 KB · Views: 74
Physics news on Phys.org
  • #2
evinda said:
Could you explain to me why after having read the first 0, we can go to state $q_3$ ?
The automata goes to $q_3$ (amontg other states) after reading 01. This is because after reading 1 it arrives in state $q_2$ and then it does an $\varepsilon$-transition to $q_3$ without reading any symbol.
 
  • #3
Hey evinda! (Smile)

evinda said:
Could you explain to me why after having read the first 0, we can go to state $q_3$ ?

Isn't that after reading $0, 1, \varepsilon$ instead of just $0$? (Wondering)

EDIT: Ah, I only see just now that Evgeny beat me to it.

I have drawn the tree and I find also an other result after having read the second 1.

That's what I get:

What am I doing wrong?

Well... I don't see a state transition from $q_2$ to $q_2$ while reading $1$. :eek:
 
  • #4
I am confused right now. According to the tree of the book, we are at the beginning at state $q_1$, then in order to read $0$ the automata goes to $q_1$ and then in order to read $1$ it could go to states $q_1, q_2, q_3$.

But we can go to state $q_3$ after having read $1$. So shouldn't $q_3$ be at the third line and not at the second one?

Or am I wrong?
 
  • #5
evinda said:
But we can go to state $q_3$ after having read $1$. So shouldn't $q_3$ be at the third line and not at the second one?
It's not clear what you mean by "line". If you mean "a row of states in the picture of a tree in post #1", then $q_3$ is indeed in line 3. Both line 1 and line 2 consist of a single state $q_1$.
 
  • #6
Evgeny.Makarov said:
It's not clear what you mean by "line". If you mean "a row of states in the picture of a tree in post #1", then $q_3$ is indeed in line 3. Both line 1 and line 2 consist of a single state $q_1$.

Yes, by line I meant "a row of states in the picture of a tree in post #1".
And I started counting after the starting state, because we go to this without reading a symbol.
So if we incude the starting state, at the first line we have it.
Then the automata goes again to $q_1$ in order to read $0$. So at the second line, we have $q_1$.
Then we want to read $1$. So there are two possibilities for the automata: to go to state $q_1$ or to $q_2$.
So at the third line we have the states $q_1$ and $q_2$. Or am I wrong?
 
  • #7
evinda said:
Then we want to read $1$. So there are two possibilities for the automata: to go to state $q_1$ or to $q_2$.
So at the third line we have the states $q_1$ and $q_2$.
This has already been addressed.
Evgeny.Makarov said:
The automata goes to $q_3$ (among other states) after reading 01. This is because after reading 1 it arrives in state $q_2$ and then it does an $\varepsilon$-transition to $q_3$ without reading any symbol.

The design of the tree is such that line $k$ ($k=1,2,\dots$) includes all states where the automaton can arrive after reading the first $k-1$ symbols of the word 010110. Note that this does not mean "after $k-1$ transitions along arrows". After reading 01 the automaton can end up in state $q_2$ and then without reading anything it can go to $q_3$. Thus, after reading 01 it can arrive in $q_3$. Therefore $q_3$ is in line 3.
 
  • #8
Evgeny.Makarov said:
The design of the tree is such that line $k$ ($k=1,2,\dots$) includes all states where the automaton can arrive after reading the first $k-1$ symbols of the word 010110. Note that this does not mean "after $k-1$ transitions along arrows". After reading 01 the automaton can end up in state $q_2$ and then without reading anything it can go to $q_3$. Thus, after reading 01 it can arrive in $q_3$. Therefore $q_3$ is in line 3.

Ok, I got it now.

If we want to read the symbol $1$, can we first do an $\epsilon$-transition and then read it?

Or is it only allowed to read first $1$ and then do an $\epsilon$-transition?
 
  • #9
evinda said:
If we want to read the symbol $1$, can we first do an $\epsilon$-transition and then read it?

Or is it only allowed to read first $1$ and then do an $\epsilon$-transition?
From which state? If you mean from $q_1$, is there an outgoing $\varepsilon$ arrow from that state?

I recommend reading the definition carefully. It may save you many questions.
 
  • #10
Evgeny.Makarov said:
From which state? If you mean from $q_1$, is there an outgoing $\varepsilon$ arrow from that state?

I was wondering if after having read 0101 and we are at state $2$, we can do an $\epsilon$-transition and then read $1$.
 
  • #11
evinda said:
I was wondering if after having read 0101 and we are at state $2$, we can do an $\epsilon$-transition and then read $1$.

Yep. We can. It corresponds with the transition to $q_3$ followed by the transition to $q_4$ in diagram $1.27$. (Nod)
 
  • #12
I like Serena said:
Yep. We can. It corresponds with the transition to $q_3$ followed by the transition to $q_4$ in diagram $1.27$. (Nod)

Ah I see... Thank you very much! (Smile)

- - - Updated - - -

Evgeny.Makarov said:
The design of the tree is such that line $k$ ($k=1,2,\dots$) includes all states where the automaton can arrive after reading the first $k-1$ symbols of the word 010110. Note that this does not mean "after $k-1$ transitions along arrows". After reading 01 the automaton can end up in state $q_2$ and then without reading anything it can go to $q_3$. Thus, after reading 01 it can arrive in $q_3$. Therefore $q_3$ is in line 3.

Thanks a lot! (Smirk)
 

FAQ: NFA Hello! (Wave) - Computation Theory Explanation

What is an NFA?

An NFA, or nondeterministic finite automaton, is a mathematical model used to describe and analyze the behavior of a computer program or algorithm. It is a finite state machine that operates on a sequence of input symbols and can be in multiple states at the same time.

How does an NFA differ from a DFA?

An NFA differs from a DFA, or deterministic finite automaton, in that it can have multiple possible transitions for a given input symbol and current state. This means that the NFA may not have a unique next state for a given input, while a DFA must have a unique next state for every input symbol and current state.

What is the purpose of using an NFA?

NFAs are useful for modeling the behavior of computer programs and algorithms, particularly in the field of computation theory. They can help analyze the complexity and efficiency of algorithms, and can also be used in the design and optimization of software systems.

How is the "Hello!" program represented in an NFA?

The "Hello!" program can be represented as a series of states and transitions in an NFA. Each state represents a specific point in the program's execution, while the transitions represent the possible actions that can be taken based on the current input symbol and state. The NFA can then be used to analyze the behavior and efficiency of the program.

What are some real-world applications of NFAs?

NFAs have many real-world applications, including in natural language processing, pattern recognition, and software testing. They are also used in the design and analysis of programming languages and compilers. Additionally, NFAs are commonly used in the field of artificial intelligence, particularly in the development of expert systems and natural language understanding algorithms.

Similar threads

Replies
43
Views
7K
Replies
2
Views
2K
Replies
20
Views
4K
Replies
11
Views
3K
Replies
1
Views
1K
Replies
17
Views
5K
Replies
2
Views
1K
Replies
22
Views
1K
Replies
2
Views
995
Back
Top