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 (https://en.wikipedia.org/wiki/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 (https://en.wikipedia.org/wiki/Shift_matrix)