1
$\begingroup$

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}}}}
$\endgroup$
  • $\begingroup$ @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. $\endgroup$ – user12759 Mar 4 '14 at 22:42
  • $\begingroup$ @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. $\endgroup$ – user12759 Mar 4 '14 at 22:45
  • $\begingroup$ Please post an example of a three-dimensional binary array of size (x1 × x2 × x3) $\endgroup$ – Dr. belisarius Mar 4 '14 at 22:45
  • $\begingroup$ @belisarius Does my example make sense to you? $\endgroup$ – user12759 Mar 4 '14 at 23:01
  • $\begingroup$ @belisarius The trouble I'm having is finding a fast way to throw out redundant arrays / codes that are rotationally or reflectionally symmetric to other arrays / codes. $\endgroup$ – user12759 Mar 4 '14 at 23:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.