{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

class5

# class5 - Menu cs3102 Theory of Computation Class 5...

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

cs3102: Theory of Computation Class 5: Non-Regular Languages Spring 2010 University of Virginia David Evans Menu PS1, Problem 8 Non-regular languages PS1 General Comments Proofs are for making convincing arguments , not for obfuscation. e.g., If you assumed pizzas can only be cut through their center, it is obvious each cut makes 2 new pieces, and the number of pieces is 2 n . Adding an inductive proof only adds unnecessary confusion! Pledges are to remind you to be honorable I assume you are all honorable whether you write a pledge or not Writing a rote pledge (not what the PS collaboration policy says) doesn’t work Problem 8 DFA that recognizes: { w | w [ a , b ]* and w does not contain two consecutive a s } no-a one-a b a b two-a a a, b How many strings of length n in this language? no-a one-a b a b two-a a a, b n End in no-a state End in one-a state Total of length n 0 1 0 1 1 1 1 2 2 1+1 = 2 1 3 3 2+1 = 3 2 5 4 3+2 = 5 3 8 n > 2 E 0 ( n -1)+ E 1 ( n -1) E 0 ( n -1) 2E 0 ( n -1) + E 1 ( n -1) Fibonacci Strings! E 1 ( n ) = E 0 ( n -1) E 0 ( n ) = E 0 ( n -1)+ E 0 ( n -2) T(n) = 2E 0 ( n -1) + E 0 ( n -2) = 2 ( E 0 ( n -2) + E 0 ( n -3)) + E 0 ( n -2) = 3 E 0 ( n -2) + 2 E 0 ( n -3) T(n -1) = 2E 0 ( n -2) + E 0 ( n -3) + T(n -2) = 2E 0 ( n -3) + E 0 ( n -4) = 2E 0 ( n -2) + 3 E 0 ( n -3) + E 0 ( n -4) = 2E 0 ( n -2) + 2 E 0 (

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

class5 - Menu cs3102 Theory of Computation Class 5...

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

View Full Document
Ask a homework question - tutors are online