Glam Prestige Journal

Bright entertainment trends with youth appeal.

$\begingroup$

How can I shift selected column of a matrix (column wise) by matrix multiplication?

Let's say I have a matrix like this:$$A=\begin{pmatrix}1 & 0 & 0\\\ 1 & 0 & 1 \\\ 1&1&1\end{pmatrix}$$

and I want to shift the first column as well as the third column one step (or multiple steps) vertically.

$$ B = \begin{pmatrix}0 & 0 & 0\\\ 1 & 0 & 0 \\\ 1&1&1\end{pmatrix}$$

How should my Matrix S look like to have:$$AS=B$$

With a shift matrix () the whole matrix is shifted in one "direction". That is not what I am looking for.Rather I want to control how many steps specific columns are shifted. To illustrate this problem: Maybe it is easier to look at it as First-In-First-Out System or balls that are falling downwards. Where a "1" stands for a ball and "0" for no ball. When I remove the bottom "ball" gravity makes that the upper balls fall down. E.g. removing ball B31 makes that Ball B21 comes in position of P31 and B11 in position P21. Also removing B33 makes B21 getting in position P31.

I am looking for a more general rules how to do it as they are shown in ()

$\endgroup$ 4

2 Answers

$\begingroup$

Hints : as $A$ is invertible, just find $A^{-1}$.

Then , $S=A^{-1} B $

Can you continue ?

$\endgroup$ $\begingroup$

We can operate by left multiplication which corresponds to operation on the rows, notably in this case we exchange first and second rows by the permutation matrix

$$S_1 = \begin{pmatrix}0 & 1 & 0\\\ 1 & 0 & 0 \\\ 0&0&1\end{pmatrix}$$

then we erase the first row by

$$S_2 = \begin{pmatrix}0 & 0 & 0\\\ 0 & 1 & 0 \\\ 0&0&1\end{pmatrix}$$

therefore

$$SA=B$$

$$S=S_2S_1=\begin{pmatrix}0 & 0 & 0\\\ 0 & 1 & 0 \\\ 0&0&1\end{pmatrix}\begin{pmatrix}0 & 1 & 0\\\ 1 & 0 & 0 \\\ 0&0&1\end{pmatrix}=\begin{pmatrix}0 & 0 & 0\\\ 1 & 0 & 0 \\\ 0&0&1\end{pmatrix}$$

Operating by right multiplication which corresponds to column operation we exchange first and third column by

$$S_1 = \begin{pmatrix}0 & 0 & 1\\\ 0 & 1 & 0 \\\ 1&0&0\end{pmatrix}$$

then we copy second column in the third one by

$$S_2 = \begin{pmatrix}1 & 0 & 0\\\ 0 & 1 & 1 \\\ 0&0&0\end{pmatrix}$$

therefore

$$AS=B$$

$$S=S_1S_2=\begin{pmatrix}0 & 0 & 1\\\ 0 & 1 & 0 \\\ 1&0&0\end{pmatrix}\begin{pmatrix}1 & 0 & 0\\\ 0 & 1 & 1 \\\ 0&0&0\end{pmatrix}=\begin{pmatrix}0 & 0 & 0\\\ 0 & 1 & 1 \\\ 1&0&0\end{pmatrix}$$

$\endgroup$ 2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy