izard: (Default)
[personal profile] izard
AIMA by Russel and Norvig, Third edition, page 894.

CYK-Parse program
P <- array of size [M, N, N]
...
for length = 2 to N do
  for start = 1 to N - length + 1 do
    for len1 = 1 to N-1 do
      len2 <- length - len1
      ...
      reference to P[Z, start + len1, len2]
      ...

when length = 2 (first iteration of outer loop), start = N-1 (last iteration of middle loop), and len1 = N-1 (last iteration of inner loop),
second index of the reference to P which is start + len1 equals
2*N - 2, that is out of the array bounds for N > 1

Shall I request a 2.56$ check or am I missing something trivial?
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

izard: (Default)
izard

November 2025

S M T W T F S
       1
2345678
910 1112131415
1617 1819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Apr. 6th, 2026 02:09 pm
Powered by Dreamwidth Studios