Hello everyone!
I have a problem - how can I generate all combinations of arrays composed only of ones and zeros (for given length n)?
For example, n=2:
0,0
0,1
1,0
1,1
And for n=3:
0,0,0
1,0,0
0,1,0
1,1,0
0,0,1
1,0,1
0,1,1
1,1,1
(I am trying to do this with Mathematica 8.0)
3 replies to this topic
#1
Posted 19 November 2011 - 04:18 AM
|
|
|
#2
Posted 19 November 2011 - 06:25 AM
Nested loops or recursive functions come to mind.
#3
Posted 19 November 2011 - 08:49 AM
A Binary Counter.
Perfection of means and confusion of ends seem to characterize our age. Albert Einstein :confused:
#4
Posted 19 November 2011 - 11:13 AM
1d array with increment function
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









