function [x,G]=gnmap(n,alfa)

x=0:0.01:1;
G=zeros(length(x),n+1);
G(:,1)=x';
j=1;
for i=1:n
   G(:,i+1)=alfa*G(:,i).*(1-G(:,i));
   j=[j 2^i];
end

m=floor(log(n)/log(2))+1;

G=G(:,2:n+1);
plot(x,x,x,G(:,j(1:m)))
