# lec0417 - Recursive Definitions for Languages Not only can...

This preview shows pages 1–3. Sign up to view the full content.

Recursive Definitions for Languages Not only can we use regular expressions to define a language, but we can also define languages recursively. Here is an example of such a definition: 1) λ L 2) if w L, then awb L 3) A string w L only if it can be obtained from the basis(1) by finite number of applications of the recursive step. From this definition, it’s fairly easy to see that L = {a n b n | n N}. However, just because we can “see it” doesn’t constitute a proof. We will use induction to prove this result for L, and then look at a few other similar examples. First, we will show that all strings of the form a n b n L. We will use induction on n. Base case n=0 : a 0 b 0 = λ∈ L. Inductive Hypothesis : Assume for an arbitrary n=k that a k b k L. Inductive Step : Under this assumption, we must prove for n=k+1 that a k+1 b k+1 L. a k+1 b k+1 = a(a k b k )b. (Let w = a k b k .) = awb. By our inductive hypothesis, w L. Furthermore, step 2 tells us that if w L, then awb w L as well. Thus, we have deduced that a k+1 b k+1 n L, as desired.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
It remains to be shown that all strings in L fit this form. Assume to the contrary that there exists a string in L NOT of the form a n b n . We know that all strings in L (except for the empty string) start with a and end with b. (Why?) Let w be the smallest string in L that is NOT of the form a
This is the end of the preview. Sign up to access the rest of the document.

## This document was uploaded on 07/14/2011.

### Page1 / 5

lec0417 - Recursive Definitions for Languages Not only can...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online