Question: Given vectors u = (u1, u2 ,..., un) and v = (v1, v2 ,..., vn), the inner product of u and v is defined to

Given vectors u = (u1, u2 ,..., un) and v = (v1, v2 ,..., vn), the inner product of u and v is defined to be u1*v1 + u2*v2 + ... + un*vn. Write a curried F# function inner that takes two vectors represented as int lists and returns their inner product (assuming the two lists are of equal length):

> inner [1;2;3] [4;5;6];;

val it : int = 32

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!