(8 points) Exercise 4 Context-free languages and the CYK algorithm (a) Consider the following grammar ({S, T, U}, {a,b,c

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

(8 points) Exercise 4 Context-free languages and the CYK algorithm (a) Consider the following grammar ({S, T, U}, {a,b,c

Post by answerhappygod »

8 Points Exercise 4 Context Free Languages And The Cyk Algorithm A Consider The Following Grammar S T U A B C 1
8 Points Exercise 4 Context Free Languages And The Cyk Algorithm A Consider The Following Grammar S T U A B C 1 (51.21 KiB) Viewed 110 times
(8 points) Exercise 4 Context-free languages and the CYK algorithm (a) Consider the following grammar ({S, T, U}, {a,b,c), P, S) where P is defined as follows: S→ TbU TabT | E U → Ubc | E Transform this grammar into an equivalent grammar in Chomsky normal form. Write down the intermediate steps. (b) Consider the following grammar G = ({S, A, B}, {a, b, c), P, S), where P is defined as follows: S→ SA | a A → BA a B→BB|BS|b|c This grammar is already in Chomsky normal form. Use the CYK algorithm on this grammar to decide whether the word w = abbca is generated by the grammar. For this, write down the complete table of the algorithm, and briefly explain how, using the table, you can find out whether the word is generated by the grammar or not. (c) Let G be a grammar in Chomsky normal form. Explain why the runtime of the CYK-Algorithm for G is cubic in the size of its input. That means for a word w of length n the algorithm terminates after O(n³) steps. (Note: For this, consider the size of the table that has to be filled by the algorithm and the maximal number of steps needed to fill one of its cells.)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply