function y=logistic(x,p,q) % random logistic map. For this to work correctly, need 1>p>-=.5 and 0