1
$\begingroup$

I have the following equation to solve, $$g(x) = x^t W_i x + {W_i}^t x + v_{i_0}$$

In this equation why the need to use a $x^t$ and $x$? I feel $x$ and transpose of it both are the same ($x$ is a row vector with two values)

Additionally, when you have such a situation and when $w_i$ is another column vector with two components how can I solve it with the inner products given?

Imagine a situation where

$x = (x_1, x_2)$ and $W_1 = \binom{6}{3}$

Maybe my question sounds dumb, but I am very new to linear algebra, sorry about that.

Any help is deeply appreciated.

  • 1
    I tried to edit in order to put mark-up. Please double-check to see that I didn't introduce errors.2012-03-16
  • 1
    $x$ and $x^t$ are not the same, since they have different *dimensions*. Remember that one cannot just multiply any two matrices, in order for a product $AB$ to make sense, the number of columns of $A$ has to match the number of rows of $B$. So, for instance, you would not be able to multiply two $1\times 2$ vectors, $vw$ but you *could* take the transpose of one and multiply it by the other, $vw^t$ (which would yield a $1\times 1$ matrix, i.e. a scalar).2012-03-16
  • 0
    @ArturoMagidin, thanks, you really shed some light to they way I have earlier understood matrices. Some additional question, what is the order to multiply the following: (a scalar).(a 1X2 matrix). (a 2 X 2 matrix). (the transpose of the earlier 1X2 matrix).2012-03-16
  • 1
    If you are asking whether you do "scalar times $1\times 2$ matrix" first and then the result by the $2\times 2$ matrix, or if you do $1\times 2$ matrix by $2\times 2$ matrix first, and then multiply the scalar by the result, the answer is "It doesn't matter", because matrix multiplication *is* associative. If $A$ is $n\times p$, $B$ is $p\times q$, and $C$ is $q\times m$ (so that all the products are defined), then we have that $(AB)C = A(BC)$. If you did not mean that, then I don't understand your question.2012-03-16
  • 0
    Yeah, that is exactly what I meant. Thank you.2012-03-16

2 Answers 2

3

Given $x = \begin{pmatrix} x_1 \\ x_2 \end{pmatrix}$ and $W_1 = \begin{pmatrix} 6 \\ 3 \end{pmatrix}$ then

$$ x^\top\, W_1 = x_1*6 + x_2*3 $$

which is a scalar, but

$$ x \,W^\top = \begin{pmatrix} x_1*6 & x_1*3 \\ x_2*6 & x_2*3 \end{pmatrix} $$

which is a $2\times2$ matrix.

The first is the inner product, and the second is the outer product. Here I use $\fbox{ }^\top$ (\top in LaTeX) for the transpose operator.

3

We can't really tell unless we know the origin of this equation.

But anyways, obviously, the final result $g(x)$ is a scalar. That is, $1\times 1$ matrix. The dimensions of LHS has to match the dimensions of RHS. Also, the dimensions of any matrix-matrix (or matrix-vector) product has to match the rule $$ \underbrace{A}_{m\times n} = \underbrace{B}_{m\times k} \times \underbrace{C}_{k\times n} $$

I can't find a pretty illustration off the web right now, but here is something from Wikipedia.

  • 0
    Here http://www.mathwarehouse.com/algebra/matrix/images/matrix-multiplication/undefined-multiply.gif2012-03-16
  • 0
    Thanks for the answer, the origin was when I was trying to find a Baysean classifier for two gaussian distributions.2012-03-16
  • 1
    Can I give an advice from a fellow learner to another? I know how concepts can be very confusing when you first learn them. I think you should read a tutorial on matrix multiplication from beginning to end. There are plenty of websites & YouTube videos that describe Matrix-Matrix and Matrix-Vector products. And you can always ask questions here on math.SE. Good luck :)2012-03-16
  • 0
    Thanks J.D. That is true, and I find it always convenient to learn new things with places like SE and guys like you all.2012-03-16