Dynamic programming

[4/75%]
Show
LaTeX

Fill out the table described in the polynomial time algorithm for context-free language recognition from Theorem 7.16 for string w=w= baba and CFG GG :

S→RTR→TR∣aT→TR∣b \begin{aligned} & S \rightarrow R T \\ & R \rightarrow T R \mid \mathrm{a} \\ & T \rightarrow T R \mid \mathrm{b} \end{aligned}
?

Show that P is closed under the star operation. (Hint: Use dynamic programming. On input y=y1⋯yny=y_{1} \cdots y_{n} for yi∈Σy_{i} \in \Sigma, build a table indicating for each i≤ji \leq j whether the substring yi⋯yj∈A∗y_{i} \cdots y_{j} \in A^{*} for any A∈PA \in \mathrm{P}.)

?

Let UNARY-SSUM be the subset sum problem in which all numbers are represented in unary. Why does the NP-completeness proof for SUBSET-SUM fail to show UNARY-SSUM is NP-complete? Show that UNARY-SSUM ∈P\in \mathrm{P}.

?

Modify the algorithm for context-free language recognition in the proof of Theorem 7.16 to give a polynomial time algorithm that produces a parse tree for a string, given the string and a CFG, if that grammar generates the string.

?

References

[Sip13] Sipser M. Introduction to the Theory of Computation. 3rd ed., Cengage Learning, 2013.