
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 of Political Science
Stony Brook University
	[[alternative HTML version deleted]]

