Comp Sci Give a CFG for L = { x#y : x,y in {0,1}* |x| ≠ |y| }

  • Thread starter Thread starter shivajikobardan
  • Start date Start date
AI Thread Summary
The discussion focuses on constructing a context-free grammar (CFG) for the language L = { x#y : x,y in {0,1}* | |x| ≠ |y| }. The proposed approach involves creating four languages (L1, L2, L3, L4) based on the conditions of the lengths of x and y. However, the breakdown does not incorporate the '#' terminal, which is essential for the language specification. Additionally, there are concerns about the validity of deriving the constructs 0^m1^n and 1^m0^n from the original language definition. The overall consensus indicates that while decomposition is valid, the current approach needs adjustments to accurately reflect the language requirements.
shivajikobardan
Messages
637
Reaction score
54
Homework Statement
Give a CFG for L = { x#y : x,y in {0,1}* |x| ≠ |y| }
Relevant Equations
None
1636786865541.png


Is my this solution approach correct? I am thinking of making cfg for L1 U L2 U L3 U L4

Where L1=0^m 1^n ----------->m>n

L2=L1 for m<n

L3=1^m 0^n ---->m>n
L4=L3 for m<n

Is my approach correct? If I can do it like that then this will be easy problem for me as well.
 
Physics news on Phys.org
You are free to decompose a language specification into simpler specifications that can be unionized provided that you get the same specification. Your breakdown does not address the '#' terminal. I also don't see where you are getting 0m1n or 1m0n constructs from the original specification.
 
Last edited:
Thread 'Have I solved this structural engineering equation correctly?'
Hi all, I have a structural engineering book from 1979. I am trying to follow it as best as I can. I have come to a formula that calculates the rotations in radians at the rigid joint that requires an iterative procedure. This equation comes in the form of: $$ x_i = \frac {Q_ih_i + Q_{i+1}h_{i+1}}{4K} + \frac {C}{K}x_{i-1} + \frac {C}{K}x_{i+1} $$ Where: ## Q ## is the horizontal storey shear ## h ## is the storey height ## K = (6G_i + C_i + C_{i+1}) ## ## G = \frac {I_g}{h} ## ## C...

Similar threads

Replies
29
Views
4K
Replies
17
Views
1K
Replies
2
Views
2K
Replies
1
Views
2K
Replies
2
Views
2K
Replies
1
Views
1K
Replies
17
Views
3K
Replies
6
Views
2K
Back
Top