Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

How can I automatically generate all possible three-dimensional binary arrays of size $(x_1 \times x_2 \times x_3$) where each array is distinct from all others with respect to rotation and reflection operations around any axis? Is there a straightforward way to do this in Mathematica v9.0?

For three-dimensional arrays, rather than using nested lists, perhaps it would be better to use the form: {{data1, {x1,y1,z1}},{data2, {x2,y2,z2}},{data3, {x3,y3,z3}},...}. So an example of the set of all three-dimensional array of dimensions $(x_1 \times x_2 \times x_3)$, where $x_1 = x_2 = x_3 = 2$ would be:

coordinateArray = Tuples[{0, 1}, 3];
bitArray = Tuples[{0, 1}, 8];

arrayList = Array[{} &, Length[bitArray]];

For[i = 1, i <= Length[bitArray], i++,
  arrayList[[i]] = Partition[Riffle[bitArray[[i]], coordinateArray], 2];
];

The set of all such three-dimensional arrays of dimensions $(x_1 \times x_2 \times x_3)$, where $x_1 = x_2 = x_3 = 2$ is given by arrayList of length (here) $2^8 = 256$:

arrayList
{{{0, {0, 0, 0}}, {0, {0, 0, 1}}, {0, {0, 1, 0}}, {0, {0, 1, 1}}, {0, {1, 0, 0}}, 
  {0, {1, 0, 1}}, {0, {1, 1, 0}}, {0, {1, 1, 1}}}, 
 {{0, {0, 0, 0}}, {0, {0, 0, 1}}, {0, {0, 1, 0}}, {0, {0, 1, 1}}, {0, {1, 0, 0}}, 
  {0, {1, 0, 1}}, {0, {1, 1, 0}}, {1, {1, 1, 1}}}, 
 ..., 
 {{1, {0, 0, 0}}, {1, {0, 0, 1}}, {1, {0, 1, 0}}, {1, {0, 1, 1}}, {1, {1, 0, 0}}, 
  {1, {1, 0, 1}}, {1, {1, 1, 0}}, {1, {1, 1, 1}}}}
share|improve this question
    
What have you tried. –  rasher Mar 4 at 22:37
    
@rasher Well, starting in one-dimension, nothing more intelligent than using Tuples to generate a set of all possible arrays, then going through and pruning for reflection. I need the set of all possible such arrays, so its a bit difficult to find a generating function for a code family that does the trick. –  user12759 Mar 4 at 22:42
    
@rasher I was hoping for some tools to help with quickly pruning (down to $1$) codes / arrays that can be reflected or rotated on one-another. –  user12759 Mar 4 at 22:45
    
Please post an example of a three-dimensional binary array of size (x1 × x2 × x3) –  belisarius Mar 4 at 22:45
    
@belisarius Does my example make sense to you? –  user12759 Mar 4 at 23:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.