class5

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

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

View Full Document Right Arrow Icon
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)
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.

This note was uploaded on 04/05/2010 for the course CS 150 taught by Professor Humphreys,g during the Spring '08 term at UVA.

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 Right Arrow Icon
Ask a homework question - tutors are online