1 1 vote what is the CFG for the language L=w where number of a’s in w+number of b’s in w=number of c’s in w how to approach this? Theory of Computation context-free-language theory-of-computation context-free-grammar + – aditi19 2.3k views answer comment Share Follow Print See all 15 Comments 15 15 Comments reply Shaik Masthan commented Mar 7, 2019 reply Follow flag i don't know why you posted only questions, why not you show your work on that question ? If you continue this, you will get answer from any user but it hurts your own thinking capacity !! 1 1 replyShare srestha commented Mar 7, 2019 i edited by srestha Mar 8, 2019 reply Follow flag $S\rightarrow aSc|S_{1}$ $S_{1}\rightarrow bS_{1}c|\epsilon$ 0 0 replyShare Shaik Masthan commented Mar 7, 2019 reply Follow flag is it right ? @srestha from your grammar, " acc " i can derive, but it doesn't belongs to the language. 1 1 replyShare aditi19 commented Mar 8, 2019 reply Follow flag @Shaik Masthan i'm getting confused on one thing... here a's should be followed by b's and then c's? or they can appear in any order? 0 0 replyShare Manas Mishra commented Mar 8, 2019 reply Follow flag S → aSc / bSc / S1 S1 → cS1a / cS1b / ϵ 0 0 replyShare abhishekmehta4u commented Mar 8, 2019 reply Follow flag String accb is not accepted. 0 0 replyShare srestha commented Mar 8, 2019 reply Follow flag @abhishekmehta4u what will language accepted by this grammar? 0 0 replyShare abhishekmehta4u commented Mar 8, 2019 reply Follow flag It accept subset of language no of a +no of b = no of c . I think 0 0 replyShare srestha commented Mar 8, 2019 reply Follow flag It should be $a^{n}.b^{n}.c^{2n}$ isnot it? 0 0 replyShare abhishekmehta4u commented Mar 8, 2019 reply Follow flag No mam CFG also gives string like ca ,cb. But language cant genrate this. 0 0 replyShare srestha commented Mar 8, 2019 reply Follow flag Means some CFG cannot generate CFL? From where r u getting this conclusion? 0 0 replyShare Shaik Masthan commented Mar 8, 2019 reply Follow flag here a's should be followed by b's and then c's? or they can appear in any order? in any order they can appear ! 1 1 replyShare srestha commented Mar 8, 2019 reply Follow flag that means every cfl has cfg, but every cfg may not have cfl 0 0 replyShare srestha commented Mar 8, 2019 reply Follow flag @Shaik Masthan chk this question https://gateoverflow.in/204109/gate2018-35 here chk this line "this grammar is CFG, so it can generate CFL" So, can we not say, every CFG can generate CFL? 0 0 replyShare Shaik Masthan commented Mar 9, 2019 reply Follow flag that means every cfl has cfg, but every cfg may not have cfl WHO SAYS ? 0 0 replyShare Please log in or register to add a comment.
Best answer 3 3 votes i am getting this . abhishekmehta4u answered Mar 8, 2019 • selected Mar 8, 2019 by aditi19 abhishekmehta4u comment Share Follow See 1 comment 1 1 comment reply Shaik Masthan commented Mar 8, 2019 reply Follow flag i think this is correct. 0 0 replyShare Please log in or register to add a comment.