F = @(x) 4*x*(1-x);
n = 2000;
x0 = rand(1);
%%%%%%%%%%%%%%%%%%%%%
% Main code (does not need to be modified)
%%%%%%%%%%%%%%%%%%%%%
orbit = zeros(1,n+1);
orbit(1) = x0;
for i = 1:n
    orbit(i+1) = F(orbit(i));
end
x0;
orbit
figure(1)
plot(1:(n+1), orbit)
figure(2)
hist(orbit, 100);