I'm taking a wild guess here at exactly what you want..
Create an Array with the values that are the 'pool' of numbers to choose randomly from. Each time you choose 2 (or whatever) random numbers from this list (by index) remove them from the Array (using delete), so they cannot be repeated in further choices.
I'm using this technique when choosing where to spawn enemies, when there is a fixed number of 'zones' in which to spawn, and I don't want any spawning on the same zone.
If what you really want is just 0 and 1 as in your example, then there are simpler ways.