TITLE: How to multiply a vector from the left side with matrix?
QUESTION [6 upvotes]: I have always dealt with vector - matrix multiplication where the vector is the right multiplicand, but I am not sure how to apply the product between a matrix and a vector when the vector is the left multiplicand.
I have the following example
$$\beta = \begin{pmatrix} \beta_0 & \beta_1 \end{pmatrix} \in \mathbb{R}^{1 \times 2}$$
and a general matrix 
$$A = \begin{pmatrix} a_{11} & a_{12} \\ a_{21} & a_{22}\end{pmatrix} \in \mathbb{R}^{2 \times 2}$$
What would be the algorithm to multiply $\beta \cdot A$? Of course the result is a $1 \times 2$ row vector.

REPLY [7 votes]: Matrix multiplication is defined so that the entry $(i,j)$ of the product is the dot product of the left matrix's row $i$ and the right matrix's column $j$.
If you want to reduce everything to matrices acting on the left, we have the identity $xA = \big(A^Tx^T\big)^T$ where $T$ denotes the transpose. This is because $(AB)^T = B^TA^T$, and the operation that sends a matrix to its transpose is self-inverse.
{"set_name": "stack_exchange", "score": 6, "question_id": 1615793}