Euclidean space — exam-style exercises with music taste: norms, cosines, Gram matrix, Gram-Schmidt and a Campus-style quiz (and the form I ticked too many times)
In quiz 3 on the Campus there was a multiple-answer question with four ways of writing the dot product of two vectors of with the identity, and I got half marks: I ticked the two right ones and also the column-times-row ones. As in the exam each wrongly ticked option cancels a right one, I lost half. A column times a matrix times a row cannot even be multiplied; fragment 1 of “What’s wrong here?” is about that.
Table of Contents
How to use this article
In the AG exam, : T is the 20-question test taken from the Campus quizzes and P, the written exercises. You can see how it combines with the quizzes and the assignments in the AG grade calculator.
In recent years’ exams there is no exercise only about the Euclidean space: the topic appears inside the bilinear forms exercise, when they ask you to “compute, if possible, the cosine of the angle” with the dot product the form defines, and in the test, where half of quiz 3 is norms, angles, orthogonality and Gram matrix. That is why the exercises here have the format of one part of an exam question (marks and criteria), and the 20-question quiz at the end is where most is at stake.
- Do each exercise on paper: first write down the Gram matrix you need.
- Compare with the expected result and, if it does not match, open the hint before looking at the solution.
- In “What’s wrong here?”, look for the mistake yourself before reading the explanation.
- Do the quiz and check the exercises in MATLAB. For the systems that come up when looking for perpendiculars, the Gauss-Jordan step-by-step simulator also works.
If some method gets stuck, go back to the Euclidean space guided practice.
Exercise 1 (basic level): four genres
Exercise 1. [3 points] In with the standard dot product, the weekly hours of pop, rock, classical and reggaeton of three friends are , and . a) (1 point) Compute , and the unit vector with the direction and sense of . b) (1 point) Compute the cosine and the angle between and , and say whether and are orthogonal. c) (1 point) Compute the orthogonal projection of onto and check that the remainder is orthogonal to .
Expected result: , , unit vector ; , ; , yes they are orthogonal; projection .
. And to project onto a single direction you do not need Gram-Schmidt: a quotient is enough.
Exercise 2 (intermediate level): an odd dot product
Exercise 2. [3 points] In define , with and . a) (1 point) Write its Gram matrix in the standard basis and compute . b) (1 point) Compute the cosine of the angle between and . c) (1 point) Compute the Gram matrix with respect to the basis and deduce an orthonormal basis from it.
Expected result: , ; ; , orthonormal basis .
with the vectors of as columns. If it comes out diagonal, you already know is orthogonal with this product.
Exercise 3 (challenge): Gram-Schmidt, projection and cross product
Exercise 3. [4 points] In with the standard product, let and . a) (1 point) Compute an orthonormal basis of by Gram-Schmidt. b) (1.5 points) Compute the orthogonal projection of onto and the distance from to . c) (1 point) Compute a vector perpendicular to with the cross product and check that it is parallel to . d) (0.5 points) Compute the volume of the parallelepiped formed by , and .
Expected result: ; projection , distance ; normal ; volume 4.
The volume is base area times height, and the height of over is exactly the distance from b). Use it to check d).
What’s wrong here?
Three solutions with one mistake each. Read, find the mistake and then the explanation.
Fragment 1: column times row
G = [2 1; 1 1] u = (1, 2) v = (3, 1)
u · v = (column of u) · G · (row of v)
= [1; 2] · [2 1; 1 1] · [3 1]
First [1; 2] · [3 1] = [3 1; 6 2], and then times G:
[3 1; 6 2] · [2 1; 1 1] = [7 4; 14 8]
Predict: what is ?
A dot product is a number, and here a matrix came out. To get it, the order of the factors was also changed ( cannot be multiplied: by ). The right way is row column: , and .
Writing or with , columns. The right form is : row, matrix, column. If you do not end up with a , something is the wrong way round.
Fragment 2: the norm with two signs
u = (3, -4) ||u|| = ±sqrt(3^2 + (-4)^2) = ±5 Unit vector in the direction of u: u / 5 = (3/5, -4/5) (it is the only one)
Predict: what is wrong?
Two things, crossed over. The norm is , positive only: a length is not negative. And there are two unit vectors in that direction: , one for each sense. The ± goes on the unit vectors, not on the norm (and if you are asked for one “in the same sense as “, only the ).
Ticking as the definition of the norm. It is the trap of one question in Campus quiz 3.
Fragment 3: orthogonal with the wrong product
Dot product with Gram matrix G = [1 0 0; 0 2 0; 0 0 1] u = (1, 1, 0) v = (1, -1, 0) u · v = 1·1 + 1·(-1) + 0·0 = 0 -> u and v are orthogonal
Predict: are they orthogonal with that product?
No. The standard product was used. With , . Both norms are , and : they make about , not .
Forgetting the Gram matrix when the statement gives a dot product. In the exam, the cosine “with respect to the bilinear form” is computed with its matrix; with the standard one, the part scores 0.
Solutions
Exercise 1
Before any arithmetic, the plan. The product is the standard one, so every measurement uses the same operation: multiply genre by genre and add up. And the parts are chained: the norms from a) come back in the cosine of b), and comes back in the projection of c). Work out each number once and write it down on the side.
And why does the question ask for the angle to compare tastes, and not the distance? The first thing you would think of is subtracting and measuring, but distance mixes two things: what you listen to and how much you listen. If listened to twice as much of everything, , their tastes would be the same, and yet their distance to would go from to . The cosine does not move: the 2 appears on top and at the bottom, cancels out, and it still gives . The cosine compares the proportion of each genre, not the hours: that is what “having similar tastes” means.
a) and . The unit vector with the direction and sense of :
(with norm ).
b) , so
And : orthogonal. only listens to rock, and listens to no rock at all.
c)
Remainder: . And .
The projection in c), step by step, with the reason for each piece:
| Step | Calculation | Why |
|---|---|---|
| 1 | How much of points towards ; you already had it from b) | |
| 2 | It is , not : since is not a unit vector, you divide by its norm twice | |
| 3 | How many times fits in the shadow of | |
| 4 | The projection is a multiple of : it has to live in | |
| 5 | remainder times gives 0 | If it does not give 0, something earlier is wrong |
Dividing by instead of by . You get , and the remainder gives with : it is not orthogonal. That is why the check in c) is worth marks: it warns you about the mistake.
Why it is done this way: in there is no cross product and no drawing, but the formulas for norm, angle and projection are the same in any dimension. The check in c) is what convinces the marker.
How it is marked (indicative, mine): a) 0.25 each norm and 0.5 the unit vector; b) 0.5 the cosine with the angle and 0.5 the justified orthogonality; c) 0.75 the projection and 0.25 the check.
Exercise 2
a) In position , the coefficient of :
, so .
One thing about a), which is where most marks are lost: the coefficient of goes whole into entry and the one of , whole into entry . You only divide by 2 when the expression merges the two cross terms into one, as in a quadratic form with ; here they come separately.
And before b), watch out for the trap. The obvious move is to look at the two vectors and say they are perpendicular, because with the standard product and they form . But the question has changed the rule for measuring, and the angle depends on the dot product, not on the drawing. That is why all of b) is done with , and with the standard basis vectors you just read off its entries.
b) With the standard vectors everything is read from : , , :
c) With (the vectors of as columns):
Diagonal: is orthogonal with this product, and on the diagonal are the squared norms, (as in a) and . Dividing:
Why it is done this way: the congruence gives the three products of the basis at once (two norms and the cross one). And it is symmetric and positive definite (minors and ), so it is a genuine dot product: you will check it this way in topic 6.
If you do not trust the congruence, check it the long way: the three products of the basis with the formula in the question, .
| Product | With the formula | Value | Where it goes in |
|---|---|---|---|
| 2 | |||
| 1 | |||
| 0 |
Same result. So why the congruence? Because in there would be six products, six chances to get a sign wrong; does them all with two matrix products. And the last step, dividing each vector by its norm, breaks nothing: if two vectors are orthogonal, their multiples are too, so and are still perpendicular and now have length 1.
How it is marked (indicative):
| Part | What is assessed | Points |
|---|---|---|
| a) | with the cross terms not halved | 0.5 |
| a) | with | 0.5 |
| b) | Cosine with | 1 |
| c) | correctly computed | 0.5 |
| c) | Deducing it is orthogonal and giving the orthonormal basis | 0.5 |
Exercise 3
The plan: a) is not there for nothing. The projection in b) is the sum of the projections onto each vector of the basis of , but only if the basis is orthogonal.
What happens if you skip a) and project straight onto and , which is the obvious move? You get , and the remainder gives with : it is not perpendicular to , so that is not the projection. Since , the two vectors overlap and each shadow counts again a piece of the other one. Gram-Schmidt removes exactly that overlap:
| Step | Calculation | Why |
|---|---|---|
| 1 | The first one stays as it is: there is nothing yet to be orthogonal to | |
| 2 | How much of points in the direction of : that is what you have to remove | |
| 3 | What is left of is already perpendicular to | |
| 4 | Multiplying by 2 does not change the direction and gets rid of the halves; the quotient makes up for it | |
| 5 | Divide by and | Only for the orthonormal basis in a); b) is done with the orthogonal one |
a) Gram-Schmidt with , :
(, ; I multiply by 2 to remove the halves). Check: . Normalising:
b) , :
c)
and : parallel, as it should be, because both are perpendicular to the plane .
d)
Volume 4. Check with the hint: the base area is and the height, : .
Why it is done this way: the exercise links the four tools of the topic, and each one checks another: the normal from the cross product matches the remainder of the projection, and the volume, base times height.
How it is marked (indicative):
| Part | What is assessed | Points |
|---|---|---|
| a) | Orthogonalise and normalise | 1 |
| b) | Projection with the orthogonal basis | 1 |
| b) | Distance | 0.5 |
| c) | Cross product and parallelism | 1 |
| d) | Scalar triple product | 0.5 |
Check it in MATLAB
The three exercises in one session (the same code works in the website’s MATLAB playground):
format short %% Exercise 1 m = [1 2 2 4]; j = [2 0 1 2]; k = [0 3 0 0]; c = dot(m, j) / (norm(m) * norm(j)) acos(c) * 180 / pi dot(j, k) format rat p = dot(m, j) / dot(j, j) * j %% Exercise 2 G = [1 -1; -1 3]; C = [1 1; 1 0]; C' * G * C % G' in the basis B'
Output:
c =
0.8000
ans =
36.8699
ans =
0
p =
8/3 0 4/3 8/3
ans =
2 0
0 1
Now exercise 3:
%% Exercise 3 v = [1; 2; 3]; u1 = [1; 0; 1]; w2 = [1; 1; 0]; u2 = w2 - dot(w2, u1) / dot(u1, u1) * u1 p = dot(v, u1) / dot(u1, u1) * u1 + dot(v, u2) / dot(u2, u2) * u2 format short norm(v - p) % the distance cross([1 0 1], [1 1 0]) det([1 0 1; 1 1 0; 1 2 3]) % the volume
Output:
u2 =
1/2
1
-1/2
p =
7/3
2/3
5/3
ans =
2.3094
ans =
-1 1 1
ans =
4
u2 comes out as , the paper one before multiplying by 2; the projection and the distance match. A detail of format rat: if you compute a root with it on, MATLAB approximates it with a fraction ( comes out as 1393/985), so for norms and distances it is better to go back to format short.
Campus-style quiz
Twenty questions like those in Campus quiz 3 (the dot product part; the vector spaces and subspaces part is in the topic 3 quiz). It does not count for anything and you can repeat it as many times as you like. In questions with several correct answers, as in the exam, each wrong option you tick cancels a correct one.
The norm of a vector in a Euclidean space is defined as:
- None of the above
Solution
Answer:
The norm is the positive root of the product of the vector with itself: .
Say whether each statement is true or false:
- Two non-zero vectors are orthogonal if and only if their dot product is 1.
- Two non-zero vectors are orthogonal if and only if their dot product is 0.
- Whether two vectors are orthogonal depends on the dot product used.
Solution
- F — Two non-zero vectors are orthogonal if and only if their dot product is 1.
- T — Two non-zero vectors are orthogonal if and only if their dot product is 0.
- T — Whether two vectors are orthogonal depends on the dot product used.
Orthogonal means product 0 (an angle of ). With another Gram matrix the same pair of vectors may stop being orthogonal: and have product .
With the standard dot product, what is the norm of ? Write just the number.
Solution
Answer: 7
.
With the standard product of , the cosine of the angle between and is:
Solution
Answer:
Product , norms and : , that is, .
With , and the standard dot product, which of these expressions give ?
Solution
Answer: ·
The matrix expression is row · · column, and by symmetry it does not matter which vector goes first. The column · · row ones are not a number (they cannot even be multiplied in that order).
In , with , the Gram matrix in the standard basis is:
Solution
Answer:
Position holds the coefficient of : (from ) and (from ).
With the Gram matrix , what is ? Write just the number.
Solution
Answer: 3
, so .
About the Gram matrix of a dot product with respect to a basis :
- is symmetric.
- If is orthogonal, is diagonal.
- If is orthonormal, is the identity.
- is the same in every basis.
Solution
- T — is symmetric.
- T — If is orthogonal, is diagonal.
- T — If is orthonormal, is the identity.
- F — is the same in every basis.
. In an orthogonal basis the cross products are 0, and in an orthonormal one, in addition, the norms are 1. When you change basis, changes to a congruent .
If and are the Gram matrices of a dot product in two bases and is the change-of-basis matrix from the second basis to the first, then:
Solution
Answer:
and are congruent: , and they have the same rank.
With the standard product of , which of these vectors are orthogonal to ?
Solution
Answer: ·
Check the product: and . The opposite has product .
A unit vector in the direction of is:
Solution
Answer:
You divide by the norm, . The other unit vector in that direction is the opposite, .
Match each cosine with the position of the two vectors:
| cos α = 1 | |
| cos α = 0 | |
| cos α = −1 |
Definitions:
- Orthogonal
- Same direction and sense
- Same direction, opposite sense
- Unit vectors
Solution
- cos α = 1 → Same direction and sense
- cos α = 0 → Orthogonal
- cos α = −1 → Same direction, opposite sense
The cosine is 1 for , 0 for and for . Being unit vectors does not depend on the angle between them.
The cross product is:
Solution
Answer:
, by the right-hand rule. In the opposite order, .
About the cross product in :
- is perpendicular to and to .
- .
- If and are parallel and non-zero, .
- is the area of the parallelogram of and .
Solution
- T — is perpendicular to and to .
- F — .
- T — If and are parallel and non-zero, .
- T — is the area of the parallelogram of and .
It is anticommutative: . Its norm is , which vanishes for or .
Three vectors of have scalar triple product 0. Then:
- They are coplanar (linearly dependent)
- They are pairwise orthogonal
- They form an orthonormal basis
- One of them is the zero vector
Solution
Answer: They are coplanar (linearly dependent)
The triple product is the determinant of the three vectors and its absolute value, the volume of the parallelepiped. Volume 0 means they lie in the same plane.
Complete:
A real vector space with a ____ product is a ____ space. A basis whose vectors are pairwise orthogonal and have norm 1 is an ____ basis, and in it the Gram matrix is the ____.
Words:
- identity
- diagonal
- dot
- orthogonal
- orthonormal
- Euclidean
- cross
Solution
A real vector space with a dot product is a Euclidean space. A basis whose vectors are pairwise orthogonal and have norm 1 is an orthonormal basis, and in it the Gram matrix is the identity.
Orthogonal only requires zero cross products (diagonal Gram); orthonormal, in addition, norms 1 (identity Gram).
With the standard product, what is the dot product of and ? Write just the number.
Solution
Answer: 0
: they are orthogonal in .
Order the steps to compute the cosine of the angle between and with a dot product given by an expression:
- Write the Gram matrix from the coefficients
- Compute times each vector as a column
- Divide and round only at the end
- Compute , and as row times those columns
Solution
Correct order:
- Write the Gram matrix from the coefficients
- Compute times each vector as a column
- Compute , and as row times those columns
- Divide and round only at the end
Every measurement comes from . Leaving the roots unrounded until the last step avoids errors in the fourth decimal.
Applying Gram-Schmidt to and with the standard product, the second orthogonal vector is:
Solution
Answer:
, and .
Which of these matrices can be the Gram matrix of a dot product on ?
Solution
Answer: ·
It has to be symmetric (property 1) and positive definite (property 4): for every . The first two satisfy it.
What next?
With topics 3 and 4 you have the whole of Campus quiz 3 and the subspaces exercise of the exam. The Euclidean space comes back in two places: in topic 6, bilinear and quadratic forms, where you will decide whether a form is a dot product and compute the cosine with it (the exam part), and in topic 8, the affine space, where the cross product gives planes and distances. Before that comes topic 5, linear transformations and diagonalisation. If you want to review bases and implicit equations, go back to the vector spaces exercises.
Cheat sheet: Euclidean space
The essentials in 30 seconds: product (row · · column), , , orthogonal if the product is 0. Orthogonal basis diagonal; orthonormal .
| I want… | By hand | MATLAB |
|---|---|---|
| Standard product | dot(u, v) | |
| Product with | u * G * v’ (u, v rows) | |
| Gram matrix in another basis | C’ * G * C | |
| Norm | norm(u) or sqrt(u * G * u’) | |
| Unit vectors | u / norm(u) | |
| Angle | of the quotient | acos(c) * 180 / pi |
| Orthogonal basis | Gram-Schmidt | loop with dot |
| Projection onto | (orthogonal basis) | the same sum |
| Perpendicular to two vectors of | Cross product | cross(u, v) |
| Volume / coplanar | Scalar triple product (determinant) | det([u; v; w]) |
Template for the exam part:
- Write (coefficient of in position , not halved).
- Check it is a dot product (topic 6: symmetric and positive leading principal minors).
- times each vector as a column; products and norms.
- Cosine with exact roots; decimals only at the end.
| Symptom | Likely cause |
|---|---|
| The product comes out as a matrix | Column · · row |
| A cosine greater than 1 | Norm miscalculated or with another |
| Two “orthogonal” vectors that are not | You used the standard product instead of |
| The fourth decimal does not match | You rounded along the way |
| The remainder of the projection is not perpendicular | You projected with a non-orthogonal basis |
Before handing in, ask yourself:
- Which dot product am I given? Did I use its in every measurement?
- Are my products row · · column?
- Are my norms positive and my cosines between and ?
- Did I check the orthogonality of what I said was orthogonal?
Did this article help you? Here is how you can support SergioLearns →
Ready for the exam?AG theory mock exam — the 20-question test with the Campus rules, no negative marking (and the catch in the several-correct ones)


