<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Samarth Urane on Medium]]></title>
        <description><![CDATA[Stories by Samarth Urane on Medium]]></description>
        <link>https://medium.com/@samarth.urane21?source=rss-dc2a436852b2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SeTHOnx8tCiUElF7</url>
            <title>Stories by Samarth Urane on Medium</title>
            <link>https://medium.com/@samarth.urane21?source=rss-dc2a436852b2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 08:16:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@samarth.urane21/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Pumping Lemma for Context-free Language]]></title>
            <link>https://medium.com/@samarth.urane21/pumping-lemma-for-context-free-language-7e6079405e43?source=rss-dc2a436852b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e6079405e43</guid>
            <category><![CDATA[theory-of-computation]]></category>
            <dc:creator><![CDATA[Samarth Urane]]></dc:creator>
            <pubDate>Sat, 26 Nov 2022 05:08:31 GMT</pubDate>
            <atom:updated>2022-11-26T05:08:31.409Z</atom:updated>
            <content:encoded><![CDATA[<p>Theory of Computation is the one of the main branches of computer science which deals with problem statements that can be resolved using simple or abstract machines called automata. The theory of the computational field can be divided into the following three concepts of his:</p><p>• Automated theory and language.<br> • Computability Theory.<br> • Complexity Theory.</p><p>Pumping lemma can be defined for<br> • regular language<br> • context-free language</p><p><strong>Context-free Language (CFL):</strong></p><p>CFL are generated using Context-free Grammar (CFG). The set of languages accepted by the pushdown automaton is the same as the set of CFL. We can also say that Regular Language is a subset of CFL.</p><p>The CFG G is a four-tupled entity (V, Σ, P, S)</p><p>1. V is the finite set of vocabulary (a finite set consisting of non-terminal and also terminal symbols)</p><p>2. Σ is the alphabet or terminal symbol set.</p><p>3. P is the finite set of construction rules.</p><p>4. S is the initial symbol of grammar.</p><p><strong>Properties of Context free Languages :</strong></p><p>· <strong>Union :</strong> If C1 and C2 are both CFL then their union C1 ∪ C2 will also be CFL.</p><p>· <strong>Concatenation :</strong> If A1 and A2 are both CFL then their concatenation A1.A2 will also be CFL</p><p>· <strong>Intersection with a Regular language :</strong> Let A1 be a CFL and A2 be a regular language then their intersection A1 ∩ A2 will be context free language.</p><p>· <strong>Intersection :</strong> If A1 and A2 are both context free languages then their intersection A1 ∩ A2 need not be context free</p><p>· <strong>Complement :</strong> If A is a CFL then it’s complement A’ may or may not be CFL</p><p>CFL have number of applications in different <a href="https://www.blogger.com/blog/post/edit/3772469983585799095/937503526232842764">programming </a>languages, specifically, maximum arithmetic expressions are developed using CFL. CFG can be used in different Compilers. It can be used as a translator of programming languages.</p><p><strong>Pumping Lemma for Context free language and Applications:</strong></p><p>Pumping Lemma is a concept used to show that the given language is not CFL. But we cannot show the given language is context free using pumping lemma. Pumping lemma uses the contradiction method to show the given language is not CFL. In other words in pumping lemma we first assume a given language is context free and after that we do contradict with our assumption.</p><p>In Context free language it is likely to get two substrings that can be ‘pumped’ any number of times and still be in the same language. If C is CFL, then C has a Pumping Length ‘L’ such that any string ‘A’, where |A|&gt;=L may be partitioned into 5 pieces <strong>A=uvxyz</strong> such that following conditions must be satisfied:</p><p>1. uvixyiz is in A for every i&gt;=0</p><p>2. |vy|&gt;0</p><p>3. |v x y|&lt;=P</p><p><strong>Steps to show a given language is not a context free :</strong></p><p>In pumping lemma we proves that the given language is not the part of context free language by using contrary method to do that we have to follow following steps :</p><p>1. Consider that C is context Free.</p><p>2. It has some Pumping length (say L)</p><p>3. Every strings bigger than L can be pumped |C|&gt;=L</p><p>4. Then detect a string ‘S’ inside C such that |C|&gt;=L</p><p>5. Make a partition of ‘S’ in uvxyz.</p><p>6. Demonstrate that uvkxykz is not part of C for some k.</p><p>7. Now examine every possible ways that S can be partitioned in uvxyz</p><p>8. prove that the three pumping conditions can not be true at the same time for all possible partitions.</p><p>9. hence ‘S’ is not able to be pumped</p><p><strong>Examples :</strong></p><p>1. Prove that L={xnynzn|n&gt;=1} is a CFL</p><p>Answer :</p><p>· Assume that L is a CFL.</p><p>· let the pumping length be m.</p><p>· Then take a string s=xmymzm</p><p>· make a partition of L in uvxyz.</p><p>Let m=4 so, s=x4y4z4</p><p>Case I:</p><p>y and v both contain a single type of symbol.</p><p>xxxx y y yy zzzz</p><p>uvkxykz when k=2</p><p>=uv2xy2z</p><p>=xxxx yy y yyyy zzzz</p><p>=x4y7z4</p><p>(Number of x != number of y)</p><p>Case II:</p><p>v or y contain more than one type of symbols.</p><p>xxx xy yy yz zzz</p><p>=uvkxykz (k=2)</p><p>=uv2xy2z</p><p>=xxx xyxy yy yzyz zzz</p><p>=x4y1x1y4z1y1z4</p><p>(Number of x != number of y)</p><p>Therefore a given language is not a CFL.</p><p>2. Show that C={ww | w ∈{0.1}* is not CFL.</p><p>Answer :</p><p>· Assume that C is a CFL.</p><p>· let the pumping length be P.</p><p>· Then take a string s=0P1P0P1P</p><p>· make a partition of C in uvxyz.</p><p>Case 1: vxy does not straddles a boundary</p><p>Let P=5; So, S=05150515</p><p>000001 1 1 1 10000011111</p><p>uvkxykz when k=2</p><p>= 000001 11111 10000011111</p><p>=05170515</p><p>Case 2: vxy straddles a boundary</p><p>Let P=5; So, S=05150515</p><p>0000011111000 00111 11</p><p>uvkxykz when k=2</p><p>= 0000011111000 000011111 11</p><p>=05150717</p><p>From case 1 and case 2 we can say that a given language is not CFL</p><p>3. Show that A={xny2n|n&gt;=1} is CFL or not</p><p>Answer :</p><p>· Assume that A is a CFL.</p><p>· let the pumping length be n.</p><p>· Then take a string s=xny2n</p><p>· make a partition of A in uvxyz.</p><p>say n=2 then s=x2y4</p><p>Case I:</p><p>y and v contain single type of symbol</p><p>xx y y y y</p><p>=uvkxykz when k=2</p><p>=uv2xy2z</p><p>=xx yy y yy y</p><p>=x2y6</p><p>(2 * Number of x != number of y)</p><p>Case 2:</p><p>v and y contain different symbols</p><p>x x bb b b</p><p>=uvkxykz (k=2)</p><p>=uv2xy2z</p><p>=x xx bb bb b</p><p>=x3y5</p><p>(2 * Number of x != number of y)</p><p>hence a given language is not a CFL.</p><p>4. show that A={a2nbn-1|n&gt;=2} is CFL</p><p>Answer :</p><p>· Assume that A is a CFL.</p><p>· let the pumping length be n.</p><p>· Then take a string s=s=a2nbn-1</p><p>· make a partition of A in uvxyz.</p><p>Case I: y and v contain single type of symbol</p><p>aaaaa a a a bbb (Let n= so, s=a8b3)</p><p>=uvkxykz</p><p>when k=2</p><p>=uv2xy2z</p><p>=aaaaa aa a aa bbb</p><p>=a10b3</p><p>Case II : v and y contain different types of symbol</p><p>aaaaaa a a b bb (Let n= so, s=a8b3)</p><p>=uvkxykz</p><p>when k=2</p><p>=uv2xy2z</p><p>=aaaaaa aa a bb bb</p><p>=a9b4</p><p>The obtained string is not in the format as a2nbn-1 . Therefore this is not a CFL</p><h4>Publishers:</h4><h4>Samarth Urane, Sanaya Vaze, Varad Uttarwar and Ripul Handoo</h4><h4>Guide : Prof. Jyoti Kanjalkar, Vishwakarma Institute of Technology , Pune.</h4><h4><strong>Department of Computer Science and Engineering.</strong></h4><h4><a href="https://www.vit.edu/"><strong>Vishwakarma Institute of Technology</strong></a><strong>, Pune, 411037, Maharashtra, India.</strong></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e6079405e43" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>