xn+1 = Q(a, xn) = a xn(1 - xn)For an initial guess x0 in the range 0 <= x0 <= 1 this defines the sequence x1, x2, ... which remains bounded (0 <= xn <= 1 for all n) as long as 0 <= a <= 4.
We are interested in plotting the long-term behavior of the sequence by plotting xm to xn for each value of a in the range aMin <= a <= aMax using the algorithm
aMin, aMax, xMin, xMax, width, height <-- input
skip, plot <-- input
set up a screen window from lower left (0,0) to (width-1, height-1)
set up a world window from lower left (aMin,xMin) to (aMin,xMax)
skipIter <-- skip
plotIter <-- plot
for a from aMin to aMax in steps of (aMax-aMin)/width do
x <-- 0.1
for n from 1 to skipIter do
x <-- Q(a,x)
end for
for n from 1 to plotIter do
x <-- Q(a,x)
plotPoint(a,x)
end for
end for