I have a program to enter a number of values and their respective probabilities as vectors/arrays. I am trying to figure out how to write a loop saying(for every value entered):
if value[] is the min, prob =
if value[] is greater than the min and less than the max, prob = xxx
else prob =
im not sure if i can do a sort type of function and reassign the values in order, but keep their probabilities with the value?
If I have entered values 10, 1, 2, for example, with prob 0.2,0.3, 0.5 respectively.
1. I want to find the lowest value, and enter an equation based on only that
prob.
2. I want to find the second lowest value and enter an eqn based on (1- the
prob of the LOWEST)
3.I want to find the third lowest value(assuming possibility of more than 3
values could be entered) and enter an eqn based on
(1 - prob of lowest value - prob of 2nd lowest value)
Appreciate any help/advice/ideas of how to write this.
Thanks!