# Elements of a List according position in axis

  ({{a, b}, {c, d}})


a, b, c and d are Lists of 300 length. Their first 4 elements must specify their position in the column (1 column, 2 column, etc) and the following 4 elements the position in the line (1 line, 2 line, etc) but this must be made in binary code and not a 2x2 Table but a 10x10. Also, they must only contain -1, 0 or 1.

I was thinking about creating the vector with a smaller length and use AppendTo to put the position based on the table index and converting it to binary but couldn't find a final solution.

• That had something wrong in it. Sorry. Is it better to understand now? Or still confusing? Jun 18, 2014 at 23:29
• Let me try and paraphrase this, tell me if I'm correct: You want a 10X10 matrix. Each entry is a 300 length vector, first 4 elements represent the second dimension position in binary, second 4 elements the first dimension, and the rest of the list is randomly (based on post before edits) selected elements from {-1,0,1}. Is that it?
– ciao
Jun 18, 2014 at 23:43

This does what you're after, I believe (see my comment question) - if not, I'll delete this answer:

result=Partition[Join @@@ Transpose[{Join @@@ Reverse /@ Tuples[IntegerDigits[Range@10, 2, 4], {2}],
RandomChoice[{-1, 0, 1}, {100, 292}]}], 10]

• Your comment says exactly what I'm after for. Sorry for my bad English on explanation. It this code do that than is exactly what I want Jun 18, 2014 at 23:49
• @AndréF.: try it, tell me if it's what you intended...
– ciao
Jun 18, 2014 at 23:49
• I can't check all results but from what I could see that's exactly it. Thank you @rasher Jun 18, 2014 at 23:53
• @AndréF.: Cool. Glad to help.
– ciao
Jun 18, 2014 at 23:53
• @AndréF.: Do you mean as an actual array? Just use result[[i,j]] or result[[i]][[j]] (note double brackets - that is correct array part specification syntax)
– ciao
Jun 19, 2014 at 0:02