Exercise with regular languages

  • Context: MHB 
  • Thread starter Thread starter mathmari
  • Start date Start date
  • Tags Tags
    Exercise Regular
Click For Summary

Discussion Overview

The discussion revolves around the exercise of determining the equivalence classes for the language L={l ε {a,b}*: the word l does not contain the subword bba}, and finding the smallest deterministic automaton that recognizes this language. The scope includes theoretical aspects of regular languages, automata construction, and the application of the Myhill–Nerode theorem.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • Some participants suggest that understanding the Myhill–Nerode theorem may aid in building the automaton for the language.
  • One equivalence class is proposed to consist of words that contain the subword bba, which raises questions about the definition of equivalence classes in relation to the language L.
  • Participants discuss that the equivalence relation is defined on the set of all strings {a, b}*, not just those in L, leading to the conclusion that words not in L can still form equivalence classes.
  • There is a suggestion to build an automaton to naturally associate equivalence classes with its states, particularly noting that certain states should represent the presence of bba.
  • Some participants express uncertainty about how to find the equivalence classes and whether they should consider all words generated by the automaton.
  • Clarifications are provided that equivalence classes consist of words that lead the automaton to the same state, regardless of their acceptance in the language.
  • There is a discussion about whether building an automaton is the only method to find equivalence classes, with references to the relationship between classes and the structure of the automaton.
  • One participant confirms that the equivalence classes can include words containing a, b, bb, and bba.

Areas of Agreement / Disagreement

Participants express differing views on the nature of equivalence classes and the role of the Myhill–Nerode theorem. While some agree on the relationship between the automaton and equivalence classes, others seek further clarification on specific aspects of the definitions and implications.

Contextual Notes

There are limitations regarding the assumptions made about the equivalence classes and the definitions of the automaton states. The discussion does not resolve the mathematical steps necessary to fully understand the construction of the automaton or the equivalence classes.

Who May Find This Useful

Readers interested in formal language theory, automata theory, and the Myhill–Nerode theorem may find this discussion relevant and informative.

mathmari
Gold Member
MHB
Messages
4,984
Reaction score
7
Hello!
I need some help at the following exercise:
The language L={l ε {a,b}*:the word l does not contain the subword bba} is regular.Which are the equivalence classes of the relation \approx_{L} ?
Also,which is the smallest(as for the number of states) deterministic automata
that recognize this language?
 
Technology news on Phys.org
Have you studied the theory around the Myhill–Nerode theorem? It may be easier to try building the automaton.

Hint: One equivalence class consists of words that contain bba.
 
Evgeny.Makarov said:
Hint: One equivalence class consists of words that contain bba.

Could you explain to me how to find the equivalence classes?? :confused:

Why does one equivalence class consists of words that contain bba, since the language is L={l ε {a,b}*:the word l does not contain the subword bba} ?? :confused:
 
Last edited by a moderator:
mathmari said:
Why does one equivalence class consists of words that contain bba, since the language is L={l ε {a,b}*:the word l does not contain the subword bba} ?
The equivalence relation is defined not on $L$, but on $\{a, b\}^*$. Thus, even words that are not in $L$ form equivalence classes. If $w\notin L$, then $[w]\cap L=\emptyset$ where $[w]$ is the equivalence class of $w$. This is because $u\approx_L w$ implies $u\varepsilon\in L\iff w\varepsilon\in L$ and $w\varepsilon=w\notin L$ where $\varepsilon$ is the empty word. In other words, $L$ is the union of some classes, and unless $L=\{a,b\}^*$, the complement of $L$ is the union of the rest of the classes.

mathmari said:
Could you explain to me how to find the equivalence classes?
I recommend building an automaton recognizing the language. Then classes are naturally associated with the states of the automaton (with a single state if the automaton is minimal or with a subset of states otherwise). In particular, if a word contains $bba$, then it is definitely not in the language. If an automaton has read $bba$, then it should be in a "sink" state, from which there is no path to an accepting state.

For another example, if an automaton reads $a$ in the initial state, it can stay in that state because reading $a$ does not lead to reading $bba$. In terms of $\approx_L$, $\varepsilon w=w\in L\iff aw\in L$. That is, $a\in[\varepsilon]$. On the other hand, if an automaton reads $b$ in the initial state, it should remember this fact by switching to a different state. Reading $ba$ in that new state is not the same as reading $ba$ in the initial state. Thus, $b\notin[\varepsilon]$ because $bba\in L\nLeftrightarrow ba\in L$.
 
Evgeny.Makarov said:
I recommend building an automaton recognizing the language. Then classes are naturally associated with the states of the automaton (with a single state if the automaton is minimal or with a subset of states otherwise). In particular, if a word contains $bba$, then it is definitely not in the language. If an automaton has read $bba$, then it should be in a "sink" state, from which there is no path to an accepting state.

For another example, if an automaton reads $a$ in the initial state, it can stay in that state because reading $a$ does not lead to reading $bba$. In terms of $\approx_L$, $\varepsilon w=w\in L\iff aw\in L$. That is, $a\in[\varepsilon]$. On the other hand, if an automaton reads $b$ in the initial state, it should remember this fact by switching to a different state. Reading $ba$ in that new state is not the same as reading $ba$ in the initial state. Thus, $b\notin[\varepsilon]$ because $bba\in L\nLeftrightarrow ba\in L$.

Is the automaton the following:

q_{0}\overset{a}{\rightarrow}q_{0}
q_{0}\overset{b}{\rightarrow}q_{1}
q_{1}\overset{a}{\rightarrow}q_{0}
q_{1}\overset{b}{\rightarrow}q_{2}
q_{2}\overset{a}{\rightarrow}q_{3}
q_{2}\overset{b}{\rightarrow}q_{0}
q_{3}\overset{a,b}{\rightarrow}q_{3}
Final states: q_{0},q_{1},q_{2}. ??
 
In state $q_2$, symbol $b$ should lead again to $q_2$. Your current version accepts $bbba$, which is incorrect. Other than that, I agree.
 
So, to find the equivalence classes do I have to find all the words that are created by the automaton?
 
I am not sure what you mean by "created". If two words drive the automaton from the initial state to the same state, then they are equivalent. This is because whatever continuation you choose, the automaton will behave the same, i.e., the automaton will end up in the same state on each of the two words plus the continuation. And since the automaton accepts the language in question, it can't happen that one word plus continuation is in the language while the other word plus continuation is not in the language. And this is the definition of $\approx_L$.
 
So are the equivalence classes those that consist of the word that contain:
1) a
2) b
3) bb
4) bba
?
 
  • #10
mathmari said:
So are the equivalence classes those that consist of the word that contain:
1) a
2) b
3) bb
4) bba
?
Yes.
 
  • #11
Is building an automaton recognizing the language the only way to find the equivalence classes?
 
  • #12
In some sense, yes because equivalence classes are isomorphic to the minimal automaton in the following sense. For each class $[w]$ there is a state $q_w$ and for each symbol $a$ there is a transition from $q_w$ to $q_{wa}$. This is the content of the Myhill-Nerode theorem. In particular, the number of classes is finite iff the automaton accepting the language is finite and hence the language is regular. Every language has the corresponding equivalence relation and, if I am not mistaken, is accepted by a possibly infinite automaton, but regularity means finiteness.
 
  • #13
So, having found the equivalence classes first, that means that the automaton has so many states as the number the equivalence classes?
 
  • #14
Why don't you study the theorem? "The Myhill–Nerode theorem states that $L$ is regular if and only if $R_L$ has a finite number of equivalence classes, and moreover that the number of states in the smallest deterministic finite automaton (DFA) recognizing $L$ is equal to the number of equivalence classes in $R_L$."
 
  • #15
Ok! Thank you! Your answers were helpful! (Yes)
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
1
Views
2K
Replies
11
Views
3K
  • · Replies 9 ·
Replies
9
Views
8K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K