theory of computation tutorial iiiwkhon/lectures/tutorial3.pdf · logic & recursion theory...

22
Theory of Computation Tutorial III Speaker: Yu-Han Lyu October 31, 2006

Upload: others

Post on 17-Mar-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Theory of ComputationTutorial III

Speaker: Yu-Han LyuOctober 31, 2006

Page 2: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Minimum Pumping Length

•0001*–4, because 000 can’t be pumped

•0001–??

Page 3: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Stochastic Context Free Grammar

•Each production is augmented with aprobability

•Like Hidden Markov Model–Learning

•Application–Natural language processing–RNA

Page 4: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Context Sensitive Grammar

•Context Free Grammar–Left-hand side must be non-terminal

•aA → aB–lhs length is smaller than or equal to rhs

•Example: {anbncn|n≥1}–S → aSBc|abc–cB → Bc–bB → bb

Page 5: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Linear Bounded Automata

•Like Turing machine, but the tape length isnot infinite

•Tape length is linear to the input length•LBA and DLBA are not equivalent

–DLBA : deterministic subset of LBA

•LBA = CSG•Chapter 5

Page 6: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Unrestricted Grammar

•aA → aB–No length limitation

•Unrestricted Grammar = Recognizable

Page 7: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Chomsky Hierarchy

Unrestricted

ContextSensitive

ContextFree

LinearGrammar

DeciderRecursive

TM=DTMTuringMachine

RecursiveEnumerableType-0

LBA≠DLBALBAContextSensitiveType-1

PDA≠DPDAPDAContextFreeType-2

NFA=DFANFARegularType-3AutomatonLanguageType

Page 8: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Closure properties

YYYYYRecursive

YYNYYRecursiveEnumerable

YYYYYContextSensitive

YYNNYContextFree

YYYYYRegularstarconcatenationcomplement∩∪Closed?

Page 9: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Decidability

NNNRecursiveEnumerable

NNYContextSensitive

NYYContextFree

YYYRegularEqualEmptyAcceptDecidable?

Page 10: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Question

•Let M1 be an NTM. Suppose that M1 is adecider for language L. If we exchange theaccept state and reject state and getanother NTM M2, is it a decider for L’scomplement?–No–If M2 accepts x, it means that there exists one

path to M1’s reject state–But L’s complement means that there is no

path to accept state

Page 11: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Chomsky

•Institute Professor Emeritusof linguistics at theMassachusetts Institute ofTechnology

Page 12: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Complexity

•Computational Complexity–Time, Space, ….

•Information Entropy–Complexity in data

•Descriptive Complexity–Complexity to specify the data–Kolmogorov Complexity (6.4)–Algorithmic Information Theory–An Introduction to Kolmogorov Complexity and Its

Applications, by Ming Li and Paul Vitanyi

Page 13: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Logic & Recursion theory

•1931 –GodelIncompleteness

•1933 –Godeldeveloped the ideasof computability andrecursive functions

•Lambda calculus byChurch and Kleene

•1936 –TuringMachine by Turing,Formulation 1 by Post

RecursiveEnumerable

PartialRecursive

RecursiveTotalRecursive

PrimitiveRecursive

Semantic/Automata

Syntactic/Logic

Page 14: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Reference 1

•Computational Complexity•Christos H. Papadimitriou•1994~

Page 15: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Reference 2

•Complexity Theory: A Modern Approach–Sanjeev Arora and Boaz Barak–http://www.cs.princeton.edu/theory/complexity–First part covers the Papadimitriou’s book

•Computational Complexity: A ConceptualPerspective–Oded Goldreich–http://www.wisdom.weizmann.ac.il/~oded/cc-

book.html•Not published

Page 16: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Reference 3

•Complexity Zoo–http://qwiki.caltech.edu/wiki/Complexity_Zoo

•Wikipedia–http://en.wikipedia.org/wiki/Main_Page

Page 17: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Problem 1

•Every tree with height k has at most 2k-1internal nodes.

•2b derivation steps → height > b•At least one variable occurs twice•Pumping lemma..

Page 18: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Problem 2

•If we read a ‘a’–Eliminate 2b–Push 2a

•If we read a ‘b’–Eliminate 3a–Push 3b

•After read input–If stack isn’t empty then accept

q1

q3 q4

q6 q5

a,b/εa,$/a

b,a/εb,$/b

ε,a/εε,ε/b

ε,a/εε,ε/b

ε,a/εε,b/ε

ε,a/εε,b/ε

q2

ε,b/εε,ε/a

Page 19: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Problem 3

•C = {xy | x, y ∈ {0,1}* and |x|=|y|, x≠y}•First half and second half are different in

some position•S→AB|BA•A→XAX|0•B→XBX|1•X→0|1

Page 20: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Problem 4

•A = {wtwR | w,t ∈{0,1}* and |w| = |t|}•S=02p0p1p02p

•If v and y are all 0 or all 1–Impossible

•If v is 0 and y is 1–Impossible

•If v is 1 and y is 0–Impossible

Page 21: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Problem 5

•An internal node is marked if it has at leasttwo children, and both of them contain amarked leaf as a descent

•Prove by induction that if every path of Tcontains at most i marked node, then Thas at most bi marked leaves

•K=b|V|+1

Page 22: Theory of Computation Tutorial IIIwkhon/lectures/tutorial3.pdf · Logic & Recursion theory •1931 –Godel Incompleteness •1933 –Godel developed the ideas of computability and

Problem 6

•z=apbpcp+p!=uvxyz•s1=uv2xy2z, #b(s)≦2p<p+p!≦#c(s)

–#a(s)=#b(s)–v=at and x=bt for some t

•Let n=p!/t + 1–s1’=uvnxynz=ap+p!bp+p!cp+p!