# Convergence of a recursive function

I am trying to study the convergence of a function that is defined by recursion. We want to find for which 'j' the difference between $g_i^j$ and $g_i^{j+1}$ is equal or smaller than $10^{-3}$ .

I don’t know how to do that, can we use FixedPoint for a function of two variables ? Or we necessarily have to use the loop While? Thanks

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]];


I defined the function Gap for the difference of the two values as

Gap[i_,j_]:=Gap[i,j]=g[i,j+1]-g[i,j] ;

• I need a little more info. (1) Do you want to find for which j the difference between two successive g's is less than $10^{-3}$ for all i or for some i? (2) There are two inputs to g so how do you define the recursion? it is a recursion in i or a recursion on j or both? (It actually looks like there's backwards and forwards recursion on i somehow.) – march Nov 28 '15 at 23:06
• It says to repeat the scan as many time as necessary so that all gaps between two successive values $g^j_i$ and $g^{j+1}_i$ is equal or smaller than $10^{-3}$ , so it is for all i. And for the recursion we see in the expression of $g$ that is in $i$ and $j$ – user35952 Nov 29 '15 at 1:48