{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

notes26 CYK Algorithm

# notes26 CYK Algorithm - CS 373 Theory of Computation Gul...

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

CS 373: Theory of Computation Gul Agha Mahesh Viswanathan Fall 2010 1

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

View Full Document
1 Decision Problems for CFLs 1.1 Emptiness of CFLs Emptiness Problem Given a CFG G with start symbol S , is L ( G ) empty? Solution: Check if the start symbol S is generating. How long does that take? Determining generating symbols Algorithm Gen = {} for every rule A x where x Σ * Gen = Gen ∪ { A } repeat for every rule A γ if all variables in γ are generating then Gen = Gen ∪ { A } until Gen does not change Both for-loops take O ( n ) time where n = | G | . Each iteration of repeat-until loop discovers a new variable. So number of iterations is O ( n ). And total is O ( n 2 ). 1.2 Membership Problem Membership Problem Given a CFG G = ( V, Σ , R, S ) in Chomsky Normal Form , and a string w Σ * , is w L ( G )? Central question in parsing. 1.2.1 Simple Solution “Simple” Solution Let | w | = n . Since G is in Chomsky Normal Form, w has a parse tree of size 2 n - 1 iff w L ( G )
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern