Posts Tagged ‘hevea’

as many b’s as a’s

Tuesday, July 7th, 2009






This is the first half of a proof that is the first question from the may qualifiers. Tougher to write up than I thought it would be.

Let L be the language defined by the following recursive definition:

  1. Λ and b are in L
  2. If x is in L, then axb and bxa are in L
  3. If x and y are in L, then xy is in L
  4. No other strings are in L


Give a simple non-recursive definition of L. Give a formal proof that your answer is correct.


2  Solution

Definition 1  A:
The language of all strings over
{a,b}*, where the number of bs is greater than or equal to the number of a’s, that is, where |b|≥|a|.

To be proved: L = A.

This will be proved in two steps.


  1. LA
  2. AL

Proof.LA

We proceed by structural induction. Note that for a string x, |a|x is the positive integer number of as in x.

Basis Step: Λ and b are in A. This is obvious, both are strings over {a,b}* | |b|≥|a|

Induction Hypothesis x, yA

Statement to be shown in induction step: xy, axb, bxaA, that is, applying any production rule for L to a string in A produces another string in A.

Proof of induction step:

Theorem 1  
If
xA and yA then xyA.

We know that for x, |a|x ≤ |b|x and for y, |a|y ≤ |b|y. By the rules of concatenation, xy has |a|x+|a|y, |b|x+|b|y.
By properties of integers, |a|x+|a|y ≤ |b|x+|b|y, so xyA

Theorem 2  axb, bxaA


x has |a|x ≤ |b|x by definition. axb or bxa both form new strings with the property that |a| = |a|x+1, |b|=|b|x+1. By properties of integers, |a| ≤ |b| → |a|+1 ≤ |b|+1

Therefore xy, axb, bxa are all in A, and LA, as was to be shown.







This document was translated from LATEX by
HEVEA.