Generate a random value in respect with a given distribution.
[n]=RandDist(i,v)
vector of values.
vector of their occurence probability.
random value.
RandDist generates a random value n in respect with a given distribution v connected to a range of values i.