Displaying 1 result from an estimated 1 matches for "osmirnov".
Did you mean:
smirnov
2008 Apr 28
1
choosing a random element from a vector
I have a vector consisting of zeroes and ones, e.g. 101001.
I would like to pick a random element from this vector equal to one. In the
example above, that means that only elements 1, 3, or 6 can be chosen.
Is there a simple and fast way to do that? (my vector of zeroes and ones is
very large)
Thank you.
---------------------------------------------------------
Oleg Smirnov
Assistant Professor