How to select k out of n, k being normally distributed but not exceeding n
1 view (last 30 days)
I need to select k numbers out of n without generating doubles and k must not exceed n.
I used to do it by first getting k with normrnd and a very low variation and then finding random numbers and checking for doubles until I have my set of k. Not a very nice approach I know.
Just now I found randperm and it allows me to do this more elegantly, but the prime use of that function, the permutation, is wasted effort in my use. I also switched from normrnd(mu,sigma) to mu+sigma*randn.
Does anyone know a more fficient way of doing this?