generate random number as usual

bump the random number to to the next highest element of the set

e.g. suppose your random number is in r and set is in array set[]

i=0;

while ( i < MAX && r < set[i] )

i++;

r = set[i];

MAX is the cardianlity of the set