Vector multiplication. Difference between scaler and dot product?

2.6k Views Asked by At

We just started a new class where the first topic is briefly talking about vectors and vector multiplication. All tying this into neural networks. I am a bit behind with the understanding of what the multiplication of two vectors is and was hoping someone could help.

Note i have these completed in my understanding which may be wrong, so I'm just asking for some information about what I did do.

x = [0.5 0.5] y = [0.75, 1.25]
1) Multiply the following two vectors x y 
2) Multiply the following two vectors xT y (transpose)

1)Are those two questions equivalent since x has both 0.5?

3)What is the dot product of x + w?

Is this just (0.5*0.75) + (0.5 * 1.25)?

3

There are 3 best solutions below

0
On BEST ANSWER

Dot product has the form of $u_1v_1+u_2v_2+...u_nv_n$

In this case, you can write the standard form as $x_1y_1+x_2y_2+...x_ny_n$

Since, x = [0.5 0.5]

y = [0.75, 1.25]

$x_1 = 0.5 \space y_1 = 0.75$

$x_2 = 0.5 \space y_2 = 1.25$

Therefore, $x \cdot y$ is

$(0.5)(0.75) + (0.5)(1.25)$

$0.375 + 0.625 =1$

When we have to Transpose a Matrix, we need to change the order. For example, x = [0.5 0.5] is a 1 x 2 matrix because it has one row and two columns.

Therefore, $x^T$ would be a 2 x 1 matrix and would be written as $\left(\begin{array}{c} .5 \\ .5 \end{array}\right)$. We see two rows and one column and that's a good sign that we did it correctly.

For this problem, a $x^T$ form of a matrix is written as
$ \begin{array}{c} x_1 = 0.5\\ x_2 =0.5\\ \vdots\\ x_n \end{array}$

I've added the values so it would be easier to see.

Now $x^T$ multiply by $y$

$\left(\begin{array}{c} .5 \\ .5 \end{array}\right)\left(\begin{array}{cc} .75 & 1.25 \end{array}\right)$ would be $(0.5)(0.75) + (0.5)(1.25)$ = $0.375 + 0.625 = 1$

0
On

You can think of these two vectors as $1 \times 2$ matrices.

In the case of 2) you can indeed multiply them as $x^T = \left(\begin{array}{c} .5 \\ .5 \end{array}\right)$.

Then, perform matrix multiplication on $\left(\begin{array}{c} .5 \\ .5 \end{array}\right)\left(\begin{array}{cc} .75 & 1.25 \end{array}\right)$.

Assuming that 1) means to do dot product, you are indeed correct.

3) I am not sure where $w$ comes from (in your original post).

0
On

If $x= [.5,.5] \text{, and }y= [.75, 1.25] $, then they cannot be multiplied using tradition matrix multiplication. They are both $1x2$ matrices, and when multiplying matrices the number of rows in $x$ must equal the number of columns in $y$.

The only way to multiply them would be by using the dot product (assuming that is what is being asked of you, your question isn't very clear on this point). $$ x \cdot y = x_1y_1 + x_2y_2=(.5*.75)+(.5*1.25)= 1$$

If you were not asked to take the dot product, then they cannot be multiplied.

Now for part 2 when matrix $x$ is transposed, the multiplication can easily be performed. $$ x = \begin{bmatrix}.5\\.5\end{bmatrix} \text{ and } y = \begin{bmatrix}.5,1.25\end{bmatrix}$$ So $x*y=(.5*.75)+(.5*1.25) = 1$

Now I am not sure where the $w$ comes from, or how you can take the dot product of a sum, but if you check the problem you could apply these steps to work it out the same way.