88 88 votes What is the complement of the language accepted by the NFA shown below? Assume $\Sigma = \{a\}$ and $\epsilon$ is the empty string. $\phi$ $\{\epsilon\}$ $a^*$ $\{a , \epsilon\}$ Theory of Computation gatecse-2012 finite-automata easy theory-of-computation + – gatecse 32.7k views answer comment Share Follow Print See all 23 Comments 23 23 Comments reply Tuhin Dutta commented Nov 22, 2017 reply Follow flag What will be the NFA for the complement of the lang? All state transition arrows will be reversed and non-final states will be final and vice-versa. Is it correct? 0 0 replyShare akash.dinkar12 commented Jan 29, 2018 reply Follow flag arrows will not be reversed..... 4 4 replyShare Lakshman Bhaiya commented Jan 14, 2019 i edited by Lakshman Bhaiya Sep 7, 2019 reply Follow flag Assume $\sum=\{a\}$ and $\epsilon$ is the empty string. $L=\left\{a^{+}\right\}$ $(1)$ What is the complement of the language accepted by the $NFA?$ $\overline{L}=\left\{\epsilon\right\}$ $(2)$ What is the language which accepts complement of $NFA?$ $L_{1}=\left\{\epsilon,(a+\epsilon)^{+}\right\}$ Please correct me if i'm wrong$?$ 2 2 replyShare chandratushar19 commented Jan 17, 2019 reply Follow flag No, it is not correct as it is epsilon-nfa. In nfa, we do not get a complement by complementing the state diagram. You have to complement the language. So, language accepted here is L={a+}. So, it's complement would be L'={€} 23 23 replyShare Lakshman Bhaiya commented Jan 17, 2019 reply Follow flag which one is not correct?? 0 0 replyShare srestha commented Sep 7, 2019 reply Follow flag @Lakshman Patel RJIT why the answer is not $a^{*}??$ If we draw complement diagram , isnot it coming $a^{*}??$ I mean according to this diagram ,what it means? 3 3 replyShare Lakshman Bhaiya commented Sep 7, 2019 i edited by Lakshman Bhaiya Sep 7, 2019 reply Follow flag @srestha ma'am It is $\epsilon$-NFA And when we just toggled the state, we can't get the complement of $\epsilon$-NFA. In my above comment $2^{nd}$ statement is not correct. It is not a complement of above $\epsilon$-NFA. Because it also accepts $L=\{a^{+}\}.$ --------------------------------------------------------------------------------- $L=\{a,aa,aaa,...\}=\{a^{+}\}$ We can draw the DFA for this. $L=\{a^{+}\}$ Now, we can complement the DFA $L=\{\epsilon\}$ Reference: https://stackoverflow.com/questions/14802732/finding-the-complement-of-a-dfa https://www.cs.odu.edu/~toida/nerzic/390teched/regular/fa/complement.html https://web.stanford.edu/class/archive/cs/cs103/cs103.1142/lectures/13/Small13.pdf 10 10 replyShare srestha commented Sep 7, 2019 reply Follow flag @Lakshman Patel RJIT yes, that I know, but what this diagram accepts?? is it $a^{*}$ or $\epsilon ??$ 0 0 replyShare Lakshman Bhaiya commented Sep 7, 2019 i edited by Lakshman Bhaiya Sep 7, 2019 reply Follow flag @srestha Ma'am it will give $L=\{\epsilon,(a+\epsilon)^{+}\}=\{\epsilon,a^{+}\} = \{a^{\ast}\}$ and below automata is also giving the same output 1 1 replyShare srestha commented Sep 7, 2019 reply Follow flag So, ur answer is not matching, hence not correct. right?? We can conclude that , we cannot do complement of NFA. Complement only possible for DFA. right?? 1 1 replyShare Lakshman Bhaiya commented Sep 7, 2019 reply Follow flag Yes 0 0 replyShare mrinmoyh commented Sep 16, 2019 reply Follow flag Lakshman Patel RJIT please check this - 1. Complement of language of a given NFA $\neq$ Language accepted by Complement of that given NFA. 2. Complement of language of a given DFA $=$ Language accepted by Complement of that given DFA. 2 2 replyShare Lakshman Bhaiya commented Sep 16, 2019 reply Follow flag I think you are right. 0 0 replyShare srestha commented Sep 16, 2019 reply Follow flag @MRINMOY_HALDER Complement of language of a given NFA ≠ Language accepted by Complement of that given NFA. 2. Complement of language of a given DFA = Language accepted by Complement of that given DFA. Can u explain these lines ? Where u got these line? 3 3 replyShare King_in_the_north commented Nov 12, 2019 reply Follow flag "Complement of language of a given NFA ≠≠ Language accepted by Complement of that given NFA. " I think it is may or may not be equal. Please verify. 2 2 replyShare anon1 commented Jul 12, 2021 reply Follow flag Correct. In the case of NFA, by complementing automata we will not get the complement of language. In some cases, it may give complement of the language but it’s not always true. That’s why there no concept of a complement of NFA. 1 1 replyShare anon1 commented Jul 12, 2021 reply Follow flag L= { a, a.$\epsilon$.$\epsilon$.a, a.$\epsilon$.$\epsilon$.a.$\epsilon$.$\epsilon$.a, ……}={a,aa,aaa,….} a.$\epsilon$=$\epsilon$.a=a. here $\epsilon$ is empty string(“”). The complement of a NFA doesn't give us the complement of the language it is accepting. Better you find out the language it is accepting and then complement the language. I think this is the most important part which is being ignored. 7 7 replyShare moh_haris commented May 2, 2024 i edited by moh_haris May 2, 2024 reply Follow flag What is the meaning of E(sigma)={a} and e(epsilon) is the empty string. e is epsilon I understand but what is the meaning of E={a} is empty??? 0 0 replyShare Deepak Poonia commented Sep 7, 2024 reply Follow flag Detailed Video Solution & Complete Analysis of NFA Complement: https://youtu.be/jpciKGP4gT4 2 2 replyShare ankit2024 commented Oct 24, 2025 reply Follow flag IF WE MAKE FINAL STATE AS NONFINAL AND NONFINAL AS FINAL THEN ALSO ONLY EPISLON IS ACCEPTED 0 0 replyShare ASUR commented Oct 24, 2025 reply Follow flag @ankit2024 if you do that then a* will be answer and in nfa we can't make final to non final and non final to final for complemnt it can be only happen in dfa 1 1 replyShare ankit2024 commented Oct 24, 2025 reply Follow flag Ok got it 0 0 replyShare Chandan8006 commented Nov 5, 2025 reply Follow flag Wrong method for NFA 0 0 replyShare Please log in or register to add a comment.
Best answer 113 113 votes The language being accepted is $a^+$. So, complement of the language is $\{\epsilon\}$. Arjun answered Aug 21, 2014 • selected Aug 22, 2014 by gatecse Arjun comment Share Follow See all 18 Comments 18 18 Comments reply Show 15 previous comments Subbu. commented Sep 10, 2021 i edited by JAINchiNMay Nov 16, 2022 reply Follow flag Don't Stuck at any where.... As a Gate aspirant you should read question carefully.. They are asking compliment of language , not asking about compliment of NFA Machine.. NFA accepts {a+} Complement of the Language ={epsilon} Complement of NFA MACHINE ={a*} 43 43 replyShare nobodysomebody commented Aug 11, 2025 reply Follow flag U r correct 💯 0 0 replyShare umanandh77 commented Sep 9 reply Follow flag but the thing we exchange non finals with final for only complete dfa . 0 0 replyShare Please log in or register to add a comment.
49 49 votes NFA accepts the language L=a+ and ∑={a} the complement of L=∑*- a+=a*-a+={∊} so answer is B vnc answered Nov 27, 2015 vnc comment Share Follow See all 2 Comments 2 2 Comments reply tusharp commented Nov 17, 2018 reply Follow flag Complement does not work with NFA always. I don't think this approach is correct even though it works for this example. 0 0 replyShare Gurdeep Saini commented Jul 9, 2019 reply Follow flag @tusharp he did not make the complement of NFA, he made the complement of language which always works 6 6 replyShare Please log in or register to add a comment.
16 16 votes Ans. varunraj answered Mar 16, 2018 varunraj comment Share Follow 0 reply Please log in or register to add a comment.
4 4 votes the language is a+ ..... compliment is {$\varepsilon$} Tarani Behera answered Nov 28, 2015 • edited Jan 14, 2018 by Puja Mishra Tarani Behera comment Share Follow See 1 comment 1 1 comment reply ankit2024 commented Oct 24, 2025 reply Follow flag IF WE MAKE FINAL STATE AS NONFINAL AND NONFINAL AS FINAL THEN ALSO ONLY EPISLON IS ACCEPTED 0 0 replyShare Please log in or register to add a comment.
4 4 votes one more way is to convert this epsilon nfa to nfa and then take complement of the language but the only careful point is that the question has asked about the langauge formed by complement of the language accpeted by such nfa. in nfa complementation doesnt work the same way that dfa does. so "complement of language accepted by nfa" and "complement of the machine" are two different things in case of nfa adarsh_1997 answered Jul 2, 2019 adarsh_1997 comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes option c is right abhishekmehta4u answered Mar 28, 2019 • edited Mar 28, 2019 by abhishekmehta4u 1 flag: ✌ Edit necessary (STOIC) abhishekmehta4u comment Share Follow 0 reply Please log in or register to add a comment.