Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
self doubt: TOC
Hirak
asked
in
Theory of Computation
May 22, 2019
563
views
0
votes
0
votes
is union of regular language and context free language always regular?
theory-of-computation
regular-language
context-free-language
Hirak
asked
in
Theory of Computation
May 22, 2019
by
Hirak
563
views
answer
comment
Follow
share this
share
3 Comments
by
ankitgupta.1729
commented
May 22, 2019
reply
Follow
share this
take a regular language over input alphabet set {a, b} as L1= $\{ab\} $
take a CFL over input alphabet {a, b} as L2 = $\{a^nb^n | n >0\}$ where n is a positive integer.
Now, union of both will be $\{a^nb^n | n >0\}$which is CFL but not regular.
4
4
by
Hirak
commented
May 22, 2019
reply
Follow
share this
Thanks brother.. :)
1
1
by
Sanandan
commented
Oct 3, 2020
reply
Follow
share this
No, Union of regular language and CFL is not regular.
0
0
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
1
vote
1
vote
Suppose there are two CFL's L1 and L2. $\because$ they are CFL's they have equivalent CFG's. They have a start symbol as well, say S1 and S2. Now create a new production S->S1|S2. As you can see now you have a grammar for the language $L1\cup L2$ of two languages. Therefore you have a CFL for it as well. You also know that every regular language is also context free. Therefore union of regular and context free languages is closed under union.
Arkaprava
answered
May 22, 2019
by
Arkaprava
comment
Follow
share this
0 Comments
Please
log in
or
register
to add a comment.
← Previous
Next →
← Previous in category
Next in category →
Related questions
3
votes
3
votes
2
answers
1
Jiten008
asked
in
Theory of Computation
Oct 24, 2023
356
views
TOC - Self Doubt
Can anyone explain $\overline{ww}$ is $CFL$ or $CSL$ And if $CFL$ can you write the equivalent $CFG$ for this ?
Jiten008
asked
in
Theory of Computation
Oct 24, 2023
by
Jiten008
356
views
pushdown-automata
theory-of-computation
self-doubt
regular-language
context-free-language
context-sensitive
turing-machine
closure-property
context-free-grammar
1
vote
1
vote
2
answers
2
Parshu gate
asked
in
Theory of Computation
Nov 29, 2017
854
views
Self doubt in TOC
Suppose in question we are given the language is Turing Recognizable , can I consider it a CFL or Regular?
Parshu gate
asked
in
Theory of Computation
Nov 29, 2017
by
Parshu gate
854
views
theory-of-computation
regular-language
decidability
context-free-language
turing-machine
0
votes
0
votes
0
answers
3
Parshu gate
asked
in
Theory of Computation
Dec 3, 2017
209
views
Toc doubt
Parshu gate
asked
in
Theory of Computation
Dec 3, 2017
by
Parshu gate
209
views
theory-of-computation
regular-language
context-free-language
0
votes
0
votes
1
answer
4
sumit chakraborty
asked
in
Theory of Computation
Nov 29, 2017
551
views
TOC closure property doubt
If a language L1 is given as anbn and L2 is given as {a,b}* , then the language L1 - L2 will be : regular or CFL and why ? My doubt is that since L2 is a regular language and L1 is CFL and L2 will contain all strings in L1, so ... ). Complement of regular is regular and intersection of CFL with regular is closed and the language will be CFL. Which one is right and why ?
sumit chakraborty
asked
in
Theory of Computation
Nov 29, 2017
by
sumit chakraborty
551
views
theory-of-computation
closure-property
context-free-language
regular-language
Subscribe to GATE CSE 2024 Test Series
Subscribe to GO Classes for GATE CSE 2024
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
Post GATE 2024 Guidance [Counseling tips and resources]
GATE CSE 2024 Result Responses
[Project Contest] Pytorch backend support for MLCommons Cpp Inference implementation
Participating in MLCommons Inference v4.0 submission (deadline is February 23 12pm IST)
IIITH PGEE 2024 Test Series by GO Classes
Subjects
All categories
General Aptitude
(3.5k)
Engineering Mathematics
(10.4k)
Digital Logic
(3.6k)
Programming and DS
(6.2k)
Algorithms
(4.8k)
Theory of Computation
(6.9k)
Compiler Design
(2.5k)
Operating System
(5.2k)
Databases
(4.8k)
CO and Architecture
(4.0k)
Computer Networks
(4.9k)
Artificial Intelligence
(79)
Machine Learning
(48)
Data Mining and Warehousing
(25)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(684)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
244k
comments
80.0k
users
Recent Blog Comments
category ?
Hi @Arjun sir, I have obtained a score of 591 in ...
download here
Can you please tell about IIT-H mtech CSE self...
Please add your admission queries here:...
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy