We have a list containing IntegerDigits
elements as
list0={{0,0,1,0,0,0},
{0,0,1,0,1,0},
{0,0,1,1,0,0},
{0,0,1,1,1,0},
{0,1,1,0,0,0},
{0,1,1,0,1,0},
{0,1,1,1,1,0},
{1,0,1,0,0,0},
...};
Two any arbitrary positions of each element can be definitely determined by 0
or 1
. For instants, in the above list, we have 0
in the first position and 1
in the fourth position. They are fixed and are not changeable. We have to create a list whose elements are -1
or +1
. If the Total
between two mentioned positions isEven
(if evenQ=True
) it must be +1
, otherwise it must be -1
. Or we can say (-1)^(Total[elements between first and fourth positions])
I mean:
list1={{1}, (*0+0=0*)
{-1}, (*0+1=1*)
{-1}, (*1+0=1*)
{+1}, (*1+1=2*)
{+1},
{-1},
{+1},
{+1},
....}
How can I do this aim?
(*0+0=0*)
for the first one? It has1
in the 3rd position, and0
in the 6th position. $\endgroup$IntegerDigits
puts the coefficient of the smallest power of the base at the end of the output list $\endgroup$(-1)^Total[list0[[All, {4, 5}]], {2}]
? $\endgroup$0
s between1
and0
. $\endgroup$