What logic is used to build context free grammar for L= a^m b^n; m>n

  • Context: MHB 
  • Thread starter Thread starter shivajikobardan
  • Start date Start date
  • Tags Tags
    Build Logic
Click For Summary

Discussion Overview

The discussion centers on the construction of a context-free grammar (CFG) for the language L = a^m b^n where m > n. Participants explore the derivation process and seek to understand the logic behind the CFG formulation, emphasizing the development of problem-solving skills rather than rote memorization.

Discussion Character

  • Exploratory, Technical explanation, Conceptual clarification, Homework-related

Main Points Raised

  • One participant expresses confusion about how to decode a solution for the CFG and seeks guidance on developing problem-solving skills related to this topic.
  • Another participant questions whether the problem involves deriving a specific string and asks for clarification on the definition of a derivation in the context of grammars.
  • A participant clarifies their understanding of derivation but emphasizes a desire to learn the underlying logic of the CFG rather than just memorizing it, suggesting that there may be patterns in the questions that could be explored.
  • A later reply outlines a specific derivation process using rules of the grammar, detailing how to generate strings of the form a^n S and subsequently transitioning to a^m b^n, while noting the conditions for n and m.

Areas of Agreement / Disagreement

Participants do not appear to reach a consensus, as there are varying levels of understanding and differing focuses on the derivation process versus the underlying logic of the CFG.

Contextual Notes

Some limitations include the need for clearer definitions of terms like "derivation" and the exploration of patterns in CFG construction that remain unresolved.

Who May Find This Useful

Individuals interested in formal language theory, context-free grammars, and those looking to enhance their problem-solving skills in computational theory may find this discussion relevant.

shivajikobardan
Messages
637
Reaction score
54
1636741535608.png
I have the solution but I am unable to decode the solution, how did we come up here? can you tell me that?
 
Technology news on Phys.org
Is the problem "Derive $aaab$? Then you are given an explicit derivation. Do you know the definition of a derivation in the context of grammars? What exactly is not clear?
 
No. I understand derivation. My problem is that I am not understanding how we came up to this solution of CFG. I want that problem solving skill to learn rather than trying to memorize this. So I am asking this. There must be some patterns of questions there right? Can you guide me a bit in this question?
 
Applying rule $S\to aS$ $n$ times where $n\ge0$ allows building strings of the form $a^nS$ from $S$. Then the only different thing to do is to apply $S\to aT$ to produce $a^{n+1}T$. After that, applying $T\to aTb$ $m$ times where $m\ge0$ produces $a^{n+1}a^mTb^m$. Finally, $T\to\varepsilon$ finishes the derivation and produces $a^{n+m+1}b^m$. These are the only strings (for some $n,m\ge0$) that one can generate using this grammar.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 29 ·
Replies
29
Views
5K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K