Monday, December 26, 2016

summation - How to represent the sum of matrix elements given all permutations of a set of indices?




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 $w_{1,2,3}+w_{1,3,2}+w_{2,1,3}+w_{2,3,1}+w_{3,1,2}+w_{3,2,1}$, where $w_{i,j,k}$ is any element of a three-dimensional matrix $W$.



I came up with this function $P(S)=\sum_{i_1}^{S}\sum_{i_2}^{S\setminus{\{i_1\}}}\sum_{i_3}^{S\setminus{\{i_1,i_2\}}}\ldots\sum_{i_m}^{S\setminus{\{i_1,i_2,\ldots, i_{M-1}\}}}w_{i_1,i_2,\ldots,i_M}$, where $M$ is the number of elements of set $S$, $w_{i_1,i_2,\ldots,i_M}\in 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 $\mathfrak{S}_n$ is the group of all permutations of the $n$ items, the quantity you're searching is $$\sum_{\sigma \in \mathfrak{S}_n} w_{\sigma(1), ..., \sigma(n) }$$



Example with $n=3$ : with the usual representation if permutations, $\mathfrak{S}_3 = \{\mathrm{id}, (12), (13), (23), (123), (132)\}$, so
$$P(S) = w_{123} + w_{213} + w_{321} + w_{132} + w_{312} + w_{231} $$



(if you're not familiar with $\mathfrak{S}_n$, 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

analysis - Injection, making bijection

I have injection $f \colon A \rightarrow B$ and I want to get bijection. Can I just resting codomain to $f(A)$? I know that every function i...