Binary Vector Manipulation
- To: mathgroup at smc.vnet.net
- Subject: [mg84087] Binary Vector Manipulation
- From: Tara.Ann.Lorenz at gmail.com
- Date: Mon, 10 Dec 2007 04:32:36 -0500 (EST)
I am need of assistance programming the following scenario: I have two vectors composed of 0's and 1's. Vector "A" has 5% 1's (and 95% 0's) while Vector "B" has 50% 1's and 50% 0's. First, I would like to change Vector B to have a "1" in every place that Vector A also has a "1" (in other words, I will then have more than 50% 1's in Vector B once this step is completed). Then, I would like to *randomly* return Vector B back to a 50/50 distribution of 1's and 0's. I greatly appreciate any proposed programming methods. Thank you, Tara