Re: Combination of binary variables
- From: Ben Pfaff <blp@xxxxxxxxxxxxxxx>
- Date: Thu, 29 Mar 2007 14:30:40 -0700
"Nightfall" <chesbobba@xxxxxxxxx> writes:
this is my problem: let's take an array of n binary variables. I need
an algorithm to write every possible combination of those variables.
If, say, n = 3, the algorithm should output:
000
001
010
100
011
110
101
111
Do you need the combinations in that particular order? If not,
you can just start from 0 and increment by 1 until you've reached
the maximum value.
--
Ben Pfaff
http://benpfaff.org
.
- References:
- Combination of binary variables
- From: Nightfall
- Combination of binary variables
- Prev by Date: Combination of binary variables
- Next by Date: Re: Combination of binary variables
- Previous by thread: Combination of binary variables
- Next by thread: Re: Combination of binary variables
- Index(es):