Thursday, May 14, 2026

Left and proper shifts are pseudoinverses


What’s the inverse of shifting a sequence to the precise? Shifting it to the left, clearly.

However wait a minute. Suppose you will have a sequence of eight bits

abcdefgh

and also you shift it to the precise. You get

0abcdefg.

In the event you shift this sequence to the left you get

abcdefg0

You’ll be able to’t get well the final component h as a result of the right-shift destroyed details about h.

A left-shift doesn’t totally get well a right-shift, and but certainly left shift and proper shift are in some sense inverses.

Yesterday I wrote a submit about representing bit manipulations, together with shifts, as matrix operators. The matrix comparable to shifting proper by okay bits has 1s on the okayth diagonal above the primary diagonal and 0s in every single place else. For instance, right here is the matrix for shifting an 8-bit quantity proper two bits. A black sq. represents a 1 and a white sq. represents a 0.

This matrix isn’t invertible. Once you’d wish to take the inverse of a non-invertible matrix, your kneejerk response needs to be to compute the pseudoinverse. (Technically the Moore-Penrose pseudoinverse. There are different pseudoinverses, however Moore-Penrose is the most typical.)

As you would possibly hope/anticipate, the pseudoinverse of a right-shift matrix is a left-shift matrix. On this case the pseudoinverse is just the transpose, although after all that isn’t all the time the case.

In the event you’d wish to show that the pseudoinverse of a matrix that shifts proper by okay locations is a matrix that shifts left by okay locations, you don’t should compute the pseudo inverse per se: you may confirm your guess. This submit offers 4 necessities for a pseudoinverse. You’ll be able to show that left shift is the inverse of proper shift by displaying that it satisfies the 4 equations.

Related Articles

Latest Articles