I have a named numb vector of probabilities, like this
Like you can see, the sum of this vector elements it's 1, I have to generate a random number between 0 and 1 and get the element of this vector that don't overcome this random number, for example:
The random number generate: 0.01 I will get the water element because water it's between 0.09 and 0.11. I attach an graphic example
I don't know how to get the element of this probability.