Roger Hui wrote on Oct 23:

Quote:

> x is a list of length >1 of distinct integers;

> y is a list of equal length of distinct integers;

> find a permutation y1 of y such that x=y1 is all 0.

S{<-}Y

S[{gradedown}X{epsilon}Y]{<-}Y[{gradeup}X{iota}Y]

Y1{<-}1{rotate}S

The trick is to arrange Y so elements that occur in X are in the same

locations as in X, and disjoint elements are in the remaining locations.

Then shift by one to ensure a mismatch.

I like the middle line: grade up and down, membership, iota, indexed

assignment and reference. What a loaded seesaw of fundamental

operations!

If you'd rather avoid indexed assignment, you could write it as:

Y1{<-}1{rotate}Y[({gradeup}X{iota}Y)[{gradeup}{gradedown}X{epsilon}Y]]

Jim