I have a list of sequences of x
's and y
's. I want to switch the last position to the "opposite" symbol - if x
, replace with y
; if y
, replace with x
.
It is in the following format:
{{{x,x,x,x,x,y,y},{x,x,x,x,y,y,x},{x,x,x,y,y,x,x},{x,x,y,y,x,x,x},
{x,y,y,x,x,x,x},{y,x,x,x,x,x,y},{y,y,x,x,x,x,x}},
{{x,x,x,x,y,x,y},{x,x,x,y,x,y,x},{x,x,y,x,y,x,x},{x,y,x,x,x,x,y},
{x,y,x,y,x,x,x},{y,x,x,x,x,y,x},{y,x,y,x,x,x,x}},
{{x,x,x,y,x,x,y},{x,x,y,x,x,x,y},{x,x,y,x,x,y,x},{x,y,x,x,x,y,x},
{x,y,x,x,y,x,x},{y,x,x,x,y,x,x},{y,x,x,y,x,x,x}}}
So for each monomial with length 7, I want to replace the last part with the opposite. Does anyone know an easy way to program it with Mathematica? I will be doing this for lists of different length: 7,11,13,15,17.
A
at the end to the result is clear now. Still not sure about my interpretation :) $\endgroup$