We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,745 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

creating a context free grammar ?

give a context free grammar for the following language over the alphabet {0,1,#}

L = { x#y | x,y ∈ {0,1}* and x ≠ y }

HINT: Under what conditions are the two strings different whose lengths are different? Under what conditions are two strings different whose length are the same ?

I have been working on this problem since the past 3 hours and I still cant figure it out. I would really appreciate it if you can help me out.

But i have come up with this grammar ( I DONT THINK THIS IS CORRECT THOUGH )


<goal> ::= <any01> | <any10> | <uneq00> | <uneq11>
<any01> ::= 0# | #1 | 0<any01> | <any01>1
<any10> ::= 1# | #0 | 1<any01> | <any01>0
<uneq00> ::= <uneq00L> | <uneq00R>
<uneq00L> ::= 0<eq00> | 0<uneq00L>
<uneq00R> ::= <eq00>0 | <eq00R>0
<eq00> = "#" | 0<eq00>0


Please help me out friends.Thanks!

1
Contributor
0
Replies
1
View
studyturtle
Newbie Poster
1 post since Jan 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.2787 seconds using 2.63MB