简体   繁体   中英

Finding a complement of a regular language

Could you help me please to find a complement of a language, which ends with abab - (a|b)*abab (over an alphabet {a,b})

I guess, the complement must contain all string, that don't end with abab. One can try to do it with Rij-Algorithm after building a DFA for complement of (a|b)*abab , but pleaseee, help me to understand how it works without Automaton and Rij (because that Automaton has 5 states).

Ok, the words are not allowed to end with abab . There are 2 4 ways for four letters of a 's and b 's at the end. Okay, abab must be erased so there are 15 combinations. Does it mean, that the complement-language is (a|b)* .(union of all those combinations of a 's and b 's without abab )? But does (a|b) still stay the same at the beginning?

Help me please to understand this.

Maybe I quiet don't understand you, but isn't it much simplier. I'e (a|b)*(a|bb|aab|bbab) or event (a|b)*(a|(b|(a|bb)a)b) ?

PS Don't forget that there is words shorter than abab and all of them should be included too. Ie (a|b){0,3} (where {0,3} denotes amount of repeats [0; 3])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM