Step 3 Write the order of evaluation for memo table
Analysis: we need q(n-1, k-1) and q(n-1, k) before we can compute q(n, k)
Initialization
for all j > i, q(i, j) = 0
for all i = 0, q(i, 0) = 0 // need first row but don’t need first column
// topological order
for (i from 1 to n)
for (j from 0 to k)
q(i, j) = q(i-1, j-1) * Pn + q(i-1, j)*(1 -Pn)