The following CFG in Chomsky normal form generates strings of balanced parentheses:
V1 -> V2V2 | V4V3 | V4V5 | ε
V2 -> V2V2 | V4V3 | V4V5
V3 -> V2V5
V4 -> (
V5 -> )
Recall that CYK running on a grammar with r variables and an input string w of length n populates an n x n x r array such that P[l, s, i] is true if and only if variable Ri derives ws ... ws+l-1, the input substring of length l starting at index s. For the grammar above and input w = (())(()()), give a true/false answer describing the contents of each of the following cells:
P[1, 4, 5] =
P[1, 5, 3] =
P[5, 2, 1] =
P[9, 2, 3] =
Hint: Note that you do not need to run the whole algorithm to infer the subproblem answers.