Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 4 years ago

Cyrille gravatar image

How to permute strings from two lists (or vectors)

Suppose I have to vector of variables

NB=vector(var('x', n=3, latex_name='x'))
B=vector(var('y', n=4, latex_name='ϵ'))

I would like to construct a function say BNB(vec1, vec2, pr, pc) such that when applied to B and for legitiamte values --- i.e. : here, NB should be less than 3 and B should be less than 4 ---, permute the correspondant x and $\epsilon from a vector to an other. That is :

BNB(B, NB, 1,2) gives

B=[ϵ0,x2,ϵ3,ϵ4] and NB=[x0,x1,ϵ1,x3]

By advance thanks for the help.