I would like to represent the sum all matrix elements of all permutations of indices given a set. For example, given the set S={1,2,3} I would like to compactly express w1,2,3+w1,3,2+w2,1,3+w2,3,1+w3,1,2+w3,2,1, where wi,j,k is any element of a three-dimensional matrix W.
I came up with this function P(S)=∑Si1∑S∖{i1}i2∑S∖{i1,i2}i3…∑S∖{i1,i2,…,iM−1}imwi1,i2,…,iM, where M is the number of elements of set S, wi1,i2,…,iM∈W, and W is an M dimensional matrix. The problem is that I found it quite unelegant.
Answer
Mimick the definition of the determinant : if Sn is the group of all permutations of the n items, the quantity you're searching is ∑σ∈Snwσ(1),...,σ(n)
Example with n=3 : with the usual representation if permutations, S3={id,(12),(13),(23),(123),(132)}, so
P(S)=w123+w213+w321+w132+w312+w231
(if you're not familiar with Sn, just take a quick look at the beginning of the wikipedia page https://en.wikipedia.org/wiki/Symmetric_group, sections 1 and 2)
No comments:
Post a Comment