KeltnerFig.1.eps

f[x_] := x^2 - 1
     begint = 0;
     endint = 2;
     minit = 1000;
     maxit = 9000;
     stepsize = 2000;
     trials = 9;
     z = {}; (*empty list*)
v = {}; (*empty list*)

miny = Min[Table[N[f[x]],{x,begint,endint,0.01}]];
maxy = Max[Table[N[f[x]],{x,begint,endint,0.01}]];

Do[
  Do[Counter = 0;
    Do[r = Random[Real, {miny,maxy}]; 
       s = Random[Real,{begint,endint}];
       If[r <= f[s] && r >= 0, 
          Counter = Counter + 1, 
          Counter = Counter];
       If[r >= f[s] && r < 0,
          Counter = Counter - 1,
          Counter = Counter],
    {i,1,k}];

    AppendTo[v, N[(Counter/k)*((endint-begint)*(maxy-miny))]];
    AppendTo[z,k], {j,1,trials}];
  ,{k, minit, maxit, stepsize}];

data = Transpose[{z, v}];
points = ListPlot[data,
			DisplayFunction -> Identity,
			PlotRange -> All];
value = NIntegrate[f[x], {x,begint,endint}];
actualval = Plot[value, {x,minit - 25, maxit},
				DisplayFunction -> Identity];
Show[points, actualval,
	DisplayFunction -> $DisplayFunction];

KeltnerFig.2.eps

Plot[Sin[1/x], {x, -1, 3}];

KeltnerFig.3.eps

f[x_]=  Sin[1/x];    (*function = ??*) 
begint = -1;  (*begin interval*)
endint = 3;   (*end interval*)
minit = 1000; (*smallest # iterations*)
maxit = 12000; (*largest # iterations*)
stepsize = 2000; (*step size*)
trials = 8;   (*repeats for same # iterations*)
z = {}; (*empty list*)
v = {}; (*empty list*)

miny = Min[Table[N[f[x]],{x,begint,endint,0.01}]];
maxy = Max[Table[N[f[x]],{x,begint,endint,0.01}]];

Do[Do[Counter = 0;
Do[r = Random[Real, {miny,maxy}]; 
s = Random[Real,{begint,endint}];
If[r <= f[s] && r >= 0, Counter=Counter+1, Counter=Counter];
If[r >= f[s] && r < 0, Counter=Counter-1, Counter=Counter],{i,1,k}];

AppendTo[v,N[(Counter/k)*((endint-begint)*(maxy-miny))]];
AppendTo[z,k],{j,1,trials}];
,{k,minit,maxit,stepsize}];

data=Transpose[{z,v}];
ListPlot[data,PlotRange->All];