473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Please Help on CFLs

Hello, I have the following problem. I have an idea of how to prove
it, but any other help is appreciated.
Let doubleswap(L) be the language obtained from L by replacing each a
by bb and each b by aa in all strings in L. Prove that if L is
context free, then so is doubleswap(L). Note L is a subset or equal
to {a,b,c}*.
Now here is how I would prove it:

We know since L is context-free, there exists a grammer G for L. Now
any grammer G can be converted to a grammer G' in Chomsky Normal Form.
So we only have productions of the form A ->BC and D -> k where
A,B,C,D are an element of the Non-Terminals and k is an element of the
terminals. So it is easy to create a new grammer G1 for doubleswap(L)
by usings the exact same productions as G', but replacing each
production of the form P1-> a by P1-> bb and P2->b by P2->aa. But I
think I need to show more. I think I may still have to show L(G1) =
doubleswap(L), since I just showed how you could construct a grammer
that should give us doubleswap(L). How would I show this? Any Help
appreciated.

Thanks
Jul 17 '05 #1
1 1634
You should prove that if w in L(G1) then it on doubleswap(L) by the grammar
that you define.
Algo CFL are closes by homomorfism (sorry for my english) so h(a)=bb and
h(b)=aa than the h(L) is still CFL

"Jack Smith" <st*******@yahoo.com> wrote in message
news:20**************************@posting.google.c om...
Hello, I have the following problem. I have an idea of how to prove
it, but any other help is appreciated.
Let doubleswap(L) be the language obtained from L by replacing each a
by bb and each b by aa in all strings in L. Prove that if L is
context free, then so is doubleswap(L). Note L is a subset or equal
to {a,b,c}*.
Now here is how I would prove it:

We know since L is context-free, there exists a grammer G for L. Now
any grammer G can be converted to a grammer G' in Chomsky Normal Form.
So we only have productions of the form A ->BC and D -> k where
A,B,C,D are an element of the Non-Terminals and k is an element of the
terminals. So it is easy to create a new grammer G1 for doubleswap(L)
by usings the exact same productions as G', but replacing each
production of the form P1-> a by P1-> bb and P2->b by P2->aa. But I
think I need to show more. I think I may still have to show L(G1) =
doubleswap(L), since I just showed how you could construct a grammer
that should give us doubleswap(L). How would I show this? Any Help
appreciated.

Thanks

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Numberwhun | last post by:
Hello everyone! I am trying to learn java and have run into kind of a snag. Here is the code that I have so far: ------ <begin_code> ---------- import javax.swing.*; import...
1
by: Jack Smith | last post by:
Hello, I need to show the following language is NOT context-free, using the pumping lemma for context-free languages. L = {wwdouble(w) | w is an element of {a,b}*}, where double(w) is derived...
1
by: HolaGoogle | last post by:
Hi all, Please help me with the following..it's realy urgent and i tried everything i could and i can't get it work properly!! Thanks in advance. Here's what i'm trying to accomplish: in my...
0
by: s_erez | last post by:
Hi, This is a realy tricky one. I have an ASP.NET application where some pages are reading data from a DB and presenting reports. In order for the user to wait while the page is reading data from...
4
by: dave | last post by:
Hi guys I display one page in popup window...that fetches some data from sql and perfom some calculation (tht approx 10 secs) and display result.... I am trying to display "Please wait ..."message...
2
by: rked | last post by:
I get nameSPAN1 is undefined when I place cursor in comments box.. <%@ LANGUAGE="VBScript" %> <% DIM ipAddress ipAddress=Request.Servervariables("REMOTE_HOST") %> <html> <head> <meta...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
4
by: pshindle | last post by:
DB2 Team - I just downloaded and unzipped the new Fixpack 9 for DB2 ESE V8 for Windows (FP9_WR21350_ESE.exe). I then burned the unzipped Fixpack files to a CD. I proceded to install this...
1
PEB
by: PEB | last post by:
POSTING GUIDELINES Please follow these guidelines when posting questions Post your question in a relevant forum Do NOT PM questions to individual experts - This is not fair on them and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.