In: Computer Science
Calculate the following inner product using distributed arithmetic principles: (-3, 5, 4)(0.5, -1.75, 0.25).
For 2 vectors, a and b, the inner product is the sum of the products of the individual elements in the same index. Similar to the question, consider two vectors, with 3 dimensions (3 elements in each vector). The dot product is calucated as:
[a1, a2, a3] . [b1, b2, b3] = (a1 x b1) + (a2 x b2) + (a3 x b3)
In our example, the two vectors are [-3, 5, 4] and [0.5, -1.75, 0.25]. Note that the vectors are denoted using square brackets and not round brackets as you have denoted them in your question. We calucate the dot product as:
[-3, 5, 4] . [0.5, -1.75, 0.25] = (-3 x 0.5) + (5 x -1.75) + (4 x 0.25)
Multipying the brackets, we get 3 times 0.5 as 1.5, 5 times 1.75 as 8.75, and 4 times 0.25 as 1. We maintain the signs as well. So , the result then becomes
= (-1.5) + (8.75) + (1)
This below step is not required, but I am rearranging the terms while incorporating the signs, so the calucation becomes easier to understand. Result becomes
= 8.75 +1 - 1.5
= 9.75-1.5
= 8.25
So, 8.25 is the final answer