Express the matrix expression $p(i,j)= (D I^\top) \cdot p$

16 Views Asked by At

Consider:

  • a vector $D$ with dimension $n\times 1$ containing one element equal to one, and all the other elements equal to 0

  • a vector $I$ with dimension $1\times n$ containing one element equal to one, and all the other elements equal to 0

  • a matrix $p$ with dimension $n\times n$.

Suppose $D(i)=1$ and $I(j)=1$. I want to write down a formula which gives me $p(i,j)$.

This is my attempt: $$ p(i,j)= (D I^\top) \cdot p $$ where "$\cdot$ " denotes the element-wise product. Is there a simpler and more common notation to represent $p(i,j)$?

1

There are 1 best solutions below

0
On BEST ANSWER

The more common way to do this is to write $$p(i,j) = D^TpI$$ One advantage is that since this is a product of an $[1 \times n][n \times n][n \times 1]$ it reduces to a $[1 \times 1]$ matrix, or essentially just a scalar.

In general, if $x$ is $m \times 1, \ y$ is $n \times 1,$ and $A$ is $m \times n$ then

\begin{align} x^TAy &= x^T\begin{bmatrix} \sum_{\ell=1}^n A(1,\ell)y(\ell) \\ \vdots \\ \sum_{\ell=1}^n A(m,\ell)y(\ell) \end{bmatrix} = \sum_{k=1}^m x(k) \sum_{\ell=1}^n A(k,\ell)y(\ell)\\ &=\sum_{k=1}^m \sum_{\ell=1}^n x(k)A(k,\ell)y(\ell) \end{align}

Specializing to your case, set $x = D, y = I, A = p$ to obtain $$D^TpI = \sum_{k=1}^n\sum_{\ell=1}^n D(k)p(k,\ell)I(\ell) = p(i,j)$$ where in the last equality we have used that $D(k)I(\ell) = 1$ when $k = i$ and $\ell = j$ and is 0 otherwise.