I am new to using Mathematica and I can not find a solution to what I am wanting to do.
I want to take a list such as:
x = {1,2,3,4,5,6,7,8}
and a second list (permutation):
perm = {4,1,6,2,7,3,8,5}
and get a result to where the permutation is applied to x. So the return would be 2,4,6,1,8,3,5,7.
My goal is a function like permutationEncrypt[x_, permutation_] := return x with the permutation applied to it
I know I can sort a list, but how would I accomplish what I am wanting to do?
Comments
Post a Comment