function for generating [0,1] vector