generating previous number with some probability.