hw1sol - CS 181 - Winter 2007 Formal Languages and Automata...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 181 — Winter 2007 Formal Languages and Automata Theory Problem Set #1 Solutions Problem 1.1. a. Show that Σ 1 Σ 2 implies Σ * 1 Σ * 2 . Is the converse true? Solution By definition, the language Σ * consists of all words over the alphabet Σ. Equivalently, every word w Σ * can be written as w = w 1 w 2 ··· w n where each w i Σ. We can use this definition to prove the statement as follows: Assume that Σ 1 Σ 2 . Fix w Σ * 1 . Then, by the definition of Σ * 1 , we can write w = w 1 w 2 w n where each w i Σ 1 . But since Σ 1 Σ 2 , we also have that each w i Σ 1 Σ 2 . Since we can write w = w 1 w 2 w n where each w i Σ 2 , it follows that w Σ * 2 . Notice our choice of w was arbitrary, so we can conclude that Σ 1 Σ 2 . Intuitively, what we have shown is the following: If all symbols in an alphabet Σ 1 appear in a larger alphabet Σ 2 , then any word we can write using symbols in Σ 1 we can also write using those same symbols in Σ 2 . The converse of the statement reads as follows: Σ * 1 Σ * 2 implies Σ 1 Σ 2 . It turns out that this statement is also true! The proof is as follows: Let Σ * 1 Σ * 2 . Assume, by way of contradiction, that Σ 1 6⊆ Σ 2 . In particular, there exists a symbol σ Σ 1 such that σ / Σ 2 . Now, consider the word consisting of just on symbol, σ . Clearly, σ Σ * 1 since σ Σ 1 . However, since σ / Σ 2 , we know σ / Σ * 2 . Thus, there exists some word in Σ * 1 and doesn’t appear in Σ * 2 . This contradicts the fact that Σ * 1 Σ * 2 . We can thus conclude that Σ 1 Σ 2 . b. Let ( Q, Σ ,δ,q 0 ,F ) be an FA. Define ˆ δ : Q × Σ * Q by induction as follows: ˆ δ ( q,± ) = q ˆ δ ( q,w.a ) = δ ( ˆ δ ( q,w ) ,a ) where w Σ * and a Σ. Argue (using induction) that a word w Σ * is accepted iff ˆ δ ( q 0 ,w ) F . Solution Recall that a FA ( Q, Σ 0 ) accepts a word w = w 1 w 2 w n if there exists a sequence of states r 0 ,r 1 ,...,r n Q such that (1) r 0 = q 0 , (2) r i +1 = δ ( r i i +1 ) for i = 0 ,...,n - 1, and (3) r n F .
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

hw1sol - CS 181 - Winter 2007 Formal Languages and Automata...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online