title: PushDown Automaton (PDA) for L={a^(n)b^(n)c^(n)|n>=1}
body: <p>I am on a fool's errand trying to construct a Pushdown automaton for the non-context-free language L={a^(n)b^(n)c^(n)|n&gt;=1} and thought of two approaches.</p>
  <blockquote>
  <p><strong>First approach:-</strong></p>
  <p>I thought that for every 'a' in string I will push 3 'a' into the stack and for every 'b' in the string, I will pop 2 'a' from the stack now for every 'c' in the string I will still have 1 'a' in the stack.</p>
  </blockquote>
  <p><strong>Problem with the First approach:-</strong> the language generated becomes something like this L={a^(p)b^(m)c^(n)| p&gt;=1 and <em><strong>could not determine how m and n can be defined</strong></em>}</p>
  <blockquote>
  <p><strong>Second approach:-</strong></p>
  <p>We know that L={ a^(n)b^(m)c^(m)d^(n) | n&gt;=0 } is a context-free language and L={ wxw | w∈(a,b)* } is also context-free language.</p>
  <p>So, I thought L={ a^(n)b^(m)b^(m)c^(n) | n&gt;=1 and m=floor((n+1)/2) }</p>
  </blockquote>
  <p><strong>Problem with the Second approach:-</strong> don't know if we can calculate floor(n+1/2) in the PDA without disturbing the elements of the stack.</p>
  <p>Please help in determining how m and n can be defined in the first approach and how can I find floor((n+1)/2) in the PDA.</p>
  <p><em>JFLAP files available for both if needed.</em></p>