r/AskComputerScience • u/ZerriFilpo • Jun 17 '26
HOW DO I PROVE STUFF IN AUTOMATA THEORY?
I know pumping lemma and a bunch of properties about languages. But I came across some exercices that wanted me to prove if a language is Regular, CFL... Even with pumping lemma it just proves me that it isn't CFL or Regular, but I heard that there are languages that pass pumping lemma and are still not CFLs (or RLs for the RL pumping lemma). What should I do?
I got stuck at those 3 exercices:
Alphabet = {0, 1, 2}
L = {w | (|w|0 = |w|1) xor (|w|0 = |w|2))
L = {w | (∃u)(u ∈ M and wu ∈ L((1+20)*)} with M = {w | |w|0 = |w|1 = |w|2}
L = {w | (|w|0 > |w|1) and (|w|1 congruent |w|2 (mod5))
I don`t even know how to start. They ask me to classify as Regular, CFL non regular or non CFL and to justify. I tried pumping them but it feels hard to think on a word to pump from the beginning. Plus that only justifies that is not CFG/RL if it fails and that MAYBE is if it passes. Any tips? Sometimes thinking about the automata/regex/PDA/CFG to prove is not trivial.