Here's the code
Clear[f, g]
f[x_] := x^2;
g[i_Integer, 1] := g[i, 1] = f[i];
g[50, _] = g[0, _] = 0;(*initial and final condition*)
g[i_Integer, j_Integer] :=
g[i, j] = Max[0.5*(g[i - 1, j] + g[i + 1, j - 1]), f[i]];
ListPlot[Table[{i, g[i, #]}, {i, 0, 50}] & /@ {1, 10}]
Now what I want to do is to make a plot of the evolution of $g_i^k$ in terms of k. I want to animate it for $k=0,.....100$. How Can I do that ?
And I want to display the fixed curve $f(x)=x²$ in the animation, how to do that ? Thanks