# Complement of context free language

If a language X regular, then is the complement of X also a regular language? If yes, then thank you, else can you please explain why

• I truly hope this was covered in class. – Yuval Filmus Aug 5 '17 at 22:11
• The body of your question doesn't match the title or the tags. Please edit to fix. – D.W. Aug 6 '17 at 4:53
• cs.stackexchange.com/q/13282/755 – D.W. Aug 6 '17 at 4:55
• @YuvalFilmus how is your comment constructive? If you are not answering the question, what is the point of leaving a comment there? what are you trying to achieve? – nikolaevra Aug 7 '17 at 13:54
• This is truly bog-standard fare in a first course in automata theory. You should have seen this in class. If not, it is covered (under "closure properties of regular languages") all over the place. – vonbrand Mar 27 at 17:13

Yes, the complement of a regular language is regular. If $L$ is regular then there is a DFA accepting that language. In particular, its states can be classified as ACCEPTING states and non-ACCEPTING states. Just turn non-ACCEPTING states into ACCEPTING, and ACCEPTING states into non-ACCEPTING states and you will have a DFA accepting $\overline{L}$.