function k = randdisc(v)
k = find(rand < cumsum(v),1);
