compute() now takes an argument depth.

Also ensured that value[i][j] >= 0.5 for all i, j.
Finished version using O(n) memory.

n = 10^5: ans = 0.79294