Calculate absolute value using matrix

2.1k Views Asked by At

Let's say I have a vector a. I would like to construct a matrix or vector b such that if I multiply a and b, I get the absolute value of a.

In other words I would like to calculate the absolute value of a vector by multiplying it with a matrix or a vector.

Is such a matrix/vector possible to construct, assuming that I do not know anything about a?

I would like to do this without using a.

2

There are 2 best solutions below

0
On BEST ANSWER

To answer your question of if there is a single $b$ which works for any vector $a$ where $b$ does not depend on $a$, first note that projections are self-adjoint operators, that is $\Pi = \Pi^*$.

Define $\Pi_a$ to be the projection onto the subspace generated by the vector $a$.

$|a| = \langle a, b\rangle = \langle \Pi_a a, b\rangle = \langle a, \Pi_a b\rangle$

also, $\langle a, b\rangle = |a||b|\cos \theta\leq |a|$

These together implies that $\Pi_a b = b$, which is to say that $b\in \text{span}\{a\}$

Take some vector $c$ such that $c\perp a$ and $|c|\neq 0$

Then $\langle c, b \rangle = \langle c, \Pi_a b\rangle = \langle \Pi_a c, b\rangle = \langle 0, b\rangle = 0 \neq |c|$

This shows that there cannot exist a $b$ in any space that includes perpendicular vectors, but still could exist in 1-deminsional space. For one-dimensional space, the number $1$ does the trick if only using positive numbers, but including negative numbers will ruin that as well.


tldr: $b$ will always depend on what $a$ is.

1
On

Assume that $a\ne 0$ and take $b=\frac{a}{|a|}.$ Then $$a\cdot b=\frac{a\cdot a}{|a|}=|a|.$$