I am new to matrices and to systems of inequalities. When I look at a matrix it's difficult to tell where the $1's$, $0's$ and $-1's$ come from. I know they somehow come from the inequality itself, but for some reason I'm not seeing how.
My questions are:
- How these inequalities become (get plugged into) these matrices (source): $$ 1 \leq i \leq n : \begin{bmatrix} 1 & 0\\ -1 & 0 \end{bmatrix} \begin{pmatrix} i\\ j \end{pmatrix} + \begin{pmatrix} -1\\ n \end{pmatrix} \geq 0 $$ $$ 1 \leq j \leq n : \begin{bmatrix} 0 & 1\\ 0 & -1 \end{bmatrix} \begin{pmatrix} i\\ j \end{pmatrix} + \begin{pmatrix} -1\\ n \end{pmatrix} \geq 0 $$
- Specifically, how $1 \leq i \leq n$ becomes \begin{bmatrix}1 & 0\\-1 & 0\end{bmatrix}
- And how $1 \leq i \leq n$ becomes \begin{pmatrix}-1\\n\end{pmatrix}
Now I'll describe the problem I'm having in more detail if that's helpful.
(I assume this equation is from $\textbf{A}\vec{x} + \vec{b} \geq 0$).
Take for example these two parts:
$$ (a):1 \leq i \leq n\ \ \ \ (b):\begin{bmatrix} 1 & 0\\ -1 & 0 \end{bmatrix} $$
I know (a) can be rewritten into a set of two inequalities (though I'm not even sure I'm doing that right):
\begin{align} 0 &\leq -1 + i\\ 0 &\leq -i + n \end{align}
So then in my attempt to figure out how the inequality goes into the matrix, I do this:
\begin{align} 0 &\leq -1 + i \mapsto -1, 1\\ 0 &\leq -i + n \mapsto -1, 1 \end{align}
since $\mathbf{-1} + i$ is like $(\mathbf{-1} + (\mathbf{1} \times i))$ and $\mathbf{-}i + n$ is like $((\mathbf{-1} \times i) + (\mathbf{1} \times n))$. But that would lead to a matrix like this:
$$ \begin{bmatrix} -1 & 1\\ -1 & 1 \end{bmatrix} $$
when it should be
$$ \begin{bmatrix} 1 & 0\\ -1 & 0 \end{bmatrix} $$
So I'm confused how that matrix (b) gets created from the inequality (a). The same goes for the second matrix in the first diagram.
Also, I am not sure where this comes from either:
$$ \begin{pmatrix} -1\\ n \end{pmatrix} $$
The full set of inequalities/matrices (if it's helpful) is below. I'm basically just trying to understand how they got those matrix equations from the inequalities in the diagram:
They got the inequalities out of the for loop if that helps.
Another example is the following diagram. Even though they have the colors showing how they mapped the values, I still don't see how they did it (went from inequality $\to$ matrix).
I would simply like to know how to do it for one of these inequality/matrices pairs, so I can apply it to all of them. Thank you so much for the help.