QBUS1040 Tutorial 3 Semester 2, 2022
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
QBUS1040
Tutorial 3
Semester 2, 2022
Exercise 1: Norm identities
Verify that the following identities hold for any two vectors a and b of the same size.
(a) (a + b)T (a − b) = ∥a∥2 − ∥b∥2 .
(b) ∥a + b∥2 + ∥a − b∥2 = 2(∥a∥2 + ∥b∥2 ). This is called the parallelogram law.
Exercise 2: Difference of squared distances
Determine whether the difference of the squared distances to two fixed vectors c and d, defined as f(x) = ∥x − c∥2 − ∥x − d∥2 ,
is linear, affine, or neither. If it is linear, give its inner product representation, i. e ., an n-vector a for which f(x) = aT x for all x. If it is affine, give a and b for which f(x) = aT x + b holds for all x. If it is neither linear nor affine, give specific x,y,α, and β for which superposition fails, i. e .,
f(αx + βy) αf(x) + βf(y).
(Provided α + β = 1, this shows the function is neither linear nor affine.)
Exercise 3: Mathematical proofs
(a) Show that the average, RMS value, and standard deviation of a vector are related by the formula: rms(x)2 = avg(x)2 + std(x)2
(b) Show that Cauchy-Schwarz inequality holds for any vectors a and b;
|aT b| ≤ ∥a∥∥b∥
using the method on slides 17 of the lecture.
Exercise 4: Nearest neighbour and smallest angle
Using Python, find the nearest neighbour of a = (1, 3, 4) among the vectors
x1 = (4, 3, 5), x2 = (0.4, 10, 50), x3 = (1, 4, 10), x4 = (30, 40, 50).
Report the minimum distance of a to x1 , . . . ,x4 . Also, find which of x1 , . . . ,x4 makes the smallest angle with a and report that angle. Can you write a function to perform the same operation?
2022-11-04