function bifmap(a0,a1,num)
%% Sai Wing Man (June 2005) sai.w.man{at}ic.ac.uk
%% Let a0=0,a1=4 and num=5000
%% 'num' is number of points
%% Bifurcation diagram of logistic map,
%% shortens to bifmap
%{
Copyright (C) 2006  Sai Wing Man
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
%}

close
if nargin<1
    a0=1; a1=4; num=500;
end
a=a0:(a1-a0)/num:a1;
x=rand(1,num+1);
for i=1:2000
    x=a.*x.*(1-x);
end
hold on
for i=1:100
    x=a.*x.*(1-x);
    plot(a,x,'.k','MarkerSize',0.5)
end