# dot product and norm [closed]

Can you solve the following problem in mathematica program? Thank you.

Let x=(x1,x2,x3),y=(y1,y2,y3) and ⟨x,y⟩=x1y1+2x2y2+x3y3 be an inner product in a three-dimensional real vector space.

Define the function that calculates the dot product of two vectors and calculate the dot product of the vectors (−1,1,2),(3,2,−1).

Define the function that calculates the norm of a vector obtained from this dot product and calculate the norm of the vector (−1,1,2),(3,2,−1).

• Welcome to Mathematica StackExchange. While we are happy to help you with your homework, you have to first show some of your work. Have you tried writing any code? Where do you get stuck? Jan 2, 2022 at 9:18
• You could start with Dot: {x1,x2,x3}.{y1,y2,y3} Jan 2, 2022 at 9:21
• Try Norm[{a, b, c}] and also check out EuclideanDistance[{2, 3, 4}, {5, 4, 3}] as an example.
– Syed
Jan 2, 2022 at 9:27

x = {x1, x2, x3};
y = {y1, y2, y3};
Dot[x, y]

v1 = {-1, 1, 2}
v2 = {3, 2, -1}
Dot[v1, v2]
Norm[v1]
Norm[v2]
Norm[Dot[v1, v2]] 