Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>No</strong>, your assumption is not correct! </p> <p>The language <code>L = { x = y + z | where x, y, z are binary integers and x is the sum of y and z}</code> is <em>not</em> Context Free Languages(CFL). </p> <p>I try to explain.</p> <p>First of all, consider following examples strings <code>s</code> in language <code>L</code>. </p> <pre><code>110 = 100 + 10 1110 = 1100 + 10 : 111000 = 110000 + 1000 </code></pre> <p>In my explanation LHS is <code>X</code> in question and RHS is <code>Y + Z</code>. </p> <p><a href="http://en.wikipedia.org/wiki/Pumping_lemma_for_context-free_languages" rel="nofollow"><strong>What is pumping Lemma for CFL?</strong></a><br> If a language L is context-free, then there exists some integer p ≥ 1 such that any string s in L with |s| ≥ p. (where p is a "pumping length" can be written as </p> <pre><code>s = uvxyz with substrings u, v, x, y and z, such that 1. |vxy| ≤ p, 2. |vy| ≥ 1, and 3. uv nxy nz is in L for every natural number n. </code></pre> <p>This definition | ≥ 1, and 3. uv nxy nz is in L for every natural number n. </p> <p><strong>Notice:</strong> Middle part of <code>s</code> , <code>vxy</code> not greater then pumping length <code>p</code>. (condition 1) </p> <p><strong>[SOLUTION]</strong>: </p> <p>Let us choose a string <code>s</code> in <code>L</code> that satisfy condition <code>|s| ≥ p</code> </p> <p>our <code>s</code> is 1<sup>m</sup>0<sup>q</sup> = 1<sup>m-1</sup>0<sup>q</sup> + 1<sup></sup>0<sup>q</sup> , where <code>q &gt; p , m-1 &gt; p</code> </p> <p>Now total length of <code>s</code> is <code>2m + 2q -1</code> that is greater then <code>p</code> and of-course for some combination of natural numbers this inequality is possible (I am not including length of <code>+</code> and <code>=</code> to keep explanation simple ) </p> <p>Now our <code>s</code> is in language and sufficiently large according to pumping lemma for CFG. </p> <p>Now break it: </p> <p>u <strong>vxy</strong> z = 1<sup>m</sup>0<sup>q</sup> = 1<sup>m-1</sup>0<sup>q</sup> + 1<sup></sup>0<sup>q</sup> </p> <p>Try to find <code>v</code> and <code>y</code> to pump and generate new string in language L, But keep in mind <code>v</code> and <code>y</code> should not be too much far than <code>p</code> (according to condition 1). </p> <p>You don't have any choice for <code>v</code> and <code>y</code> such that you can generate new strings in language! </p> <p><strong>(Step-1):</strong> Because if you chose to increase <code>1</code> then you can't pump both side RHS and LHS of <code>=</code> because last <code>1</code> on LHS is at <code>q</code> (>p) to first <code>1</code> of RHS. hence not possible to generate new strings in language. </p> <p><strong>(Step-2):</strong> Suppose you like to pump <code>0</code> again its not possible to increase <code>0</code> on LHS and RHS together because last <code>0</code> on LHS in m-1 (>p) distend to first <code>0</code> on RHS. </p> <p><strong>(Step-3):</strong> You can't pump a combination of <code>111...000...</code> both side. , try this you will get string out of language L. </p> <p>Try other options too within the rules of Pumping Lemma. you would not find correct choice for <code>v</code> and <code>y</code>. </p> <p><strong>[ANSWER]</strong> </p> <p>So he have a string <code>s</code> in L that is sufficiently large and using that we can't generate new strings in language. its contradict to Pumping Lemma for CFL hence given <code>L</code> is not a CFL. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload