# Linear Algebra/Determinants Exist/Solutions
## Solutions

These summarize the notation used in this book for the $2$- and $3$- permutations.
${\begin{array}{c|cc}i&1&2\\\hline \phi _{1}(i)&1&2\\\phi _{2}(i)&2&1\end{array}}\qquad {\begin{array}{c|ccc}i&1&2&3\\\hline \phi _{1}(i)&1&2&3\\\phi _{2}(i)&1&3&2\\\phi _{3}(i)&2&1&3\\\phi _{4}(i)&2&3&1\\\phi _{5}(i)&3&1&2\\\phi _{6}(i)&3&2&1\end{array}}$

### Problem 1

Give the permutation expansion of a general $2\!\times \!2$ matrix and its transpose.

### Answer

This is the permutation expansion of the determinant of a $2\!\times \!2$ matrix
    ${\begin{vmatrix}a&b\\c&d\end{vmatrix}}=ad\cdot {\begin{vmatrix}1&0\\0&1\end{vmatrix}}+bc\cdot {\begin{vmatrix}0&1\\1&0\end{vmatrix}}$
and the permutation expansion of the determinant of its transpose.
    ${\begin{vmatrix}a&c\\b&d\end{vmatrix}}=ad\cdot {\begin{vmatrix}1&0\\0&1\end{vmatrix}}+cb\cdot {\begin{vmatrix}0&1\\1&0\end{vmatrix}}$
As with the $3\!\times \!3$ expansions described in the subsection, the permutation matrices from corresponding terms are transposes (although this is disguised by the fact that each is self-transpose).
    This exercise is recommended for all readers.

### Problem 2

This problem appears also in the prior subsection.
* Find the inverse of each $2$-permutation.
* Find the inverse of each $3$-permutation.

### Answer

Each of these is easy to check.
* permutation   $\phi _{1}$   $\phi _{2}$ inverse   $\phi _{1}$   $\phi _{2}$
* permutation   $\phi _{1}$   $\phi _{2}$   $\phi _{3}$   $\phi _{4}$   $\phi _{5}$   $\phi _{6}$ inverse   $\phi _{1}$   $\phi _{2}$   $\phi _{3}$   $\phi _{5}$   $\phi _{4}$   $\phi _{6}$
    This exercise is recommended for all readers.

### Problem 3

* Find the signum of each $2$-permutation.
* Find the signum of each $3$-permutation.

### Answer

* $\operatorname {sgn}(\phi _{1})=+1$, $\operatorname {sgn}(\phi _{2})=-1$
* $\operatorname {sgn}(\phi _{1})=+1$, $\operatorname {sgn}(\phi _{2})=-1$, $\operatorname {sgn}(\phi _{3})=-1$, $\operatorname {sgn}(\phi _{4})=+1$, $\operatorname {sgn}(\phi _{5})=+1$, $\operatorname {sgn}(\phi _{6})=-1$

### Problem 4

What is the signum of the $n$-permutation $\phi =\langle n,n-1,\dots ,2,1\rangle$? (Strang 1980)

### Answer

The pattern is this.
${\begin{array}{c|ccccccc}i&1&2&3&4&5&6&\ldots \\\hline \operatorname {sgn}(\phi _{i})&+1&-1&-1&+1&+1&-1&\ldots \end{array}}$
So to find the signum of $\phi _{n!}$, we subtract one $n!-1$ and look at the remainder on division by four. If the remainder is $1$ or $2$ then the signum is $-1$, otherwise it is $+1$. For $n>4$, the number $n!$ is divisible by four, so $n!-1$ leaves a remainder of $-1$ on division by four (more properly said, a remainder or $3$), and so the signum is $+1$. The $n=1$ case has a signum of $+1$, the $n=2$ case has a signum of $-1$ and the $n=3$ case has a signum of $-1$.

### Problem 5

Prove these.
* Every permutation has an inverse.
* $\operatorname {sgn}(\phi ^{-1})=\operatorname {sgn}(\phi )$
* Every permutation is the inverse of another.

### Answer

* Permutations can be viewed as one-one and onto maps $\phi :\{1,\ldots ,n\}\to \{1,\ldots ,n\}$. Any one-one and onto map has an inverse.
* If it always takes an odd number of swaps to get from $P_{\phi }$ to the identity, then it always takes an odd number of swaps to get from the identity to $P_{\phi }$ (any swap is reversible).
* This is the first question again.

### Problem 6

Prove that the matrix of the permutation inverse is the transpose of the matrix of the permutation $P_{\phi ^{-1}}={{P_{\phi }}^{\rm {trans}}}$, for any permutation $\phi$.

### Answer

If $\phi (i)=j$ then $\phi ^{-1}(j)=i$. The result now follows on the observation that $P_{\phi }$ has a $1$ in entry $i,j$ if and only if $\phi (i)=j$, and $P_{\phi ^{-1}}$ has a $1$ in entry $j,i$ if and only if $\phi ^{-1}(j)=i$,
    This exercise is recommended for all readers.

### Problem 7

Show that a permutation matrix with $m$ inversions can be row swapped to the identity in $m$ steps. Contrast this with Corollary 4.6.

### Answer

This does not say that $m$ is the least number of swaps to produce an identity, nor does it say that $m$ is the most. It instead says that there is a way to swap to the identity in exactly $m$ steps.
Let $\iota _{j}$ be the first row that is inverted with respect to a prior row and let $\iota _{k}$ be the first row giving that inversion. We have this interval of rows.
    ${\begin{pmatrix}\vdots \\\iota _{k}\\\iota _{r_{1}}\\\vdots \\\iota _{r_{s}}\\\iota _{j}\\\vdots \end{pmatrix}}\qquad j<k<r_{1}<\dots <r_{s}$
Swap.
    ${\begin{pmatrix}\vdots \\\iota _{j}\\\iota _{r_{1}}\\\vdots \\\iota _{r_{s}}\\\iota _{k}\\\vdots \end{pmatrix}}$
The second matrix has one fewer inversion because there is one fewer inversion in the interval ($s$ vs. $s+1$) and inversions involving rows outside the interval are not affected.
Proceed in this way, at each step reducing the number of inversions by one with each row swap. When no inversions remain the result is the identity.
The contrast with Corollary 4.6 is that the statement of this exercise is a "there exists" statement: there exists a way to swap to the identity in exactly $m$ steps. But the corollary is a "for all" statement: for all ways to swap to the identity, the parity (evenness or oddness) is the same.
    This exercise is recommended for all readers.

### Problem 8

For any permutation $\phi$ let $g(\phi )$ be the integer defined in this way.
    $g(\phi )=\prod _{i<j}[\phi (j)-\phi (i)]$
(This is the product, over all indices $i$ and $j$ with $i<j$, of terms of the given form.)
* Compute the value of $g$ on all $2$-permutations.
* Compute the value of $g$ on all $3$-permutations.
* Prove this.
    $\operatorname {sgn}(\phi )={\frac {g(\phi )}{|g(\phi )|}}$
Many authors give this formula as the definition of the signum function.

### Answer

* First, $g(\phi _{1})$ is the product of the single factor $2-1$ and so $g(\phi _{1})=1$. Second, $g(\phi _{2})$ is the product of the single factor $1-2$ and so $g(\phi _{2})=-1$.
* ${\begin{array}{r|cccccc}{\text{permutation }}\phi &\phi _{1}&\phi _{2}&\phi _{3}&\phi _{4}&\phi _{5}&\phi _{6}\\\hline g(\phi )&2&-2&-2&2&2&-2\end{array}}$
* Note that $\phi (j)-\phi (i)$ is negative if and only if $\iota _{\phi (j)}$ and $\iota _{\phi (i)}$ are in an inversion of their usual order.

## References

* Strang, Gilbert (1980), Linear Algebra and its Applications (2nd ed.), Hartcourt Brace Javanovich