# let's define the vectors
v=[-3,4,-5,6]
u=[4,3,6,5]

vu = 0

for i in range(len(v)):
    vu = vu + v[i]*u[i]

print(v,u,vu)

u = [-3,-4]

uu = u[0]*u[0] + u[1]*u[1]

print(u,u,uu)

u = [-3,-4]
neg_u=[3,4]

v=[-4,3]
neg_v=[4,-3]

# let's define a function for inner product
def dot(v_one,v_two):
    summation = 0 
    for i in range(len(v_one)):
        summation = summation + v_one[i]*v_two[i] # adding up pairwise multiplications
    return summation # return the inner product

print("the dot product of  u and -v (",u," and ",neg_v,") is",dot(u,neg_v))
print("the dot product of -u and  v (",neg_u,"   and ",v,") is",dot(neg_u,v))
print("the dot product of -u and -v (",neg_u,"   and ",neg_v,") is",dot(neg_u,neg_v))

# let's define a function for inner product
def dot(v_one,v_two):
    summation = 0 
    for i in range(len(v_one)):
        summation = summation + v_one[i]*v_two[i] # adding up pairwise multiplications
    return summation # return the inner product

v = [-1,2,-3,4]
v_neg_two=[2,-4,6,-8]

u=[-2,-1,5,2]
u_three=[-6,-3,15,6]

print("the dot product of v and u is",dot(v,u))

print("the dot product of -2v and 3u is",dot(v_neg_two,u_three))

