Practice: Orthogonality and Projection

Recognition · Error diagnosis

A learner projects b onto W = span ⁡ { v 1 , v 2 } by computing ⟨ b , v 1 ⟩ ⟨ v 1 , v 1 ⟩ v 1 + ⟨ b , v 2 ⟩ ⟨ v 2 , v 2 ⟩ v 2 , where v 1 and v 2 are a basis of W but are not orthogonal. What is wrong, and how would you detect it?

2 hints available, least help first.

Hint 1: Retrieval cue

Where in the derivation of the coefficient formula is orthogonality used?

Hint 2: Concept cue

Apply the definitive test: is the residual orthogonal to each basis vector?

Direct application

Apply Gram–Schmidt to v 1 = ( 1 , 1 , 0 ) and v 2 = ( 1 , 0 , 1 ) in R 3 with the standard dot product, taking u 1 = v 1 .

Compute u 2 = v 2 − ⟨ v 2 , u 1 ⟩ ⟨ u 1 , u 1 ⟩ u 1 . What is its third component?

Enter the value. It is checked against the answer and the precision this task asks for.

2 hints available, least help first.

Hint 1: Retrieval cue

First compute the two inner products ⟨ v 2 , u 1 ⟩ and ⟨ u 1 , u 1 ⟩ .

Hint 2: Concept cue

The multiple being subtracted is 1 2 ( 1 , 1 , 0 ) . What does that do to the third component of ( 1 , 0 , 1 ) ?

Direct application

Project b = ( 1 , 2 , 3 ) onto W , using the orthogonal basis u 1 = ( 1 , 1 , 0 ) and u 2 = ( 1 2 , − 1 2 , 1 ) .

What is the coefficient c 2 = ⟨ b , u 2 ⟩ ⟨ u 2 , u 2 ⟩ ? Give your answer as a decimal.

Enter the value. It is checked against the answer and the precision this task asks for.

2 hints available, least help first.

Hint 1: Retrieval cue

The coefficient is a ratio of two inner products, not a single one.

Hint 2: Concept cue

⟨ b , u 2 ⟩ = 5 / 2 . Now compute ⟨ u 2 , u 2 ⟩ and divide.

Direct application

To fit y = a + b x to the points ( 1 , 1 ) , ( 2 , 2 ) , ( 3 , 2 ) , the design matrix is

A = ( 1 1 1 2 1 3 ) .

The normal equations are A T A x ^ = A T b . What is the entry in row 2, column 2 of A T A ?

Enter the value. It is checked against the answer and the precision this task asks for.

2 hints available, least help first.

Hint 1: Retrieval cue

Which column of A does row 2 of A T correspond to?

Hint 2: Concept cue

Take the dot product of ( 1 , 2 , 3 ) with itself.

Construction · Direct application · Explanation

(a) Let W = span ⁡ { ( 1 , 0 , 1 ) , ( 0 , 1 , 1 ) } ⊆ R 3 with the standard dot product. Apply Gram–Schmidt to produce an orthogonal basis of W , and verify the orthogonality.

(b) Project b = ( 2 , 1 , 0 ) onto W . Give the projection, the residual, and both verification checks.

(c) Fit y = a + b x to ( 1 , 1 ) , ( 2 , 2 ) , ( 3 , 2 ) by the normal equations. State the two orthogonality conditions the equations encode and confirm them on your residuals.

(d) In P 1 , the polynomials of degree at most 1 on [ 0 , 1 ] , use the inner product ⟨ f , g ⟩ = ∫ 0 1 f ( x ) g ( x ) d x . Compute ⟨ 1 , x ⟩ and decide whether { 1 , x } is orthogonal under it. If not, apply one Gram–Schmidt step.

(e) Parts (a) and (d) ran the same construction in different spaces. Say what the construction needed in each case, and what it did not need.

Write your answer, then compare it with the worked solution.

3 hints available, least help first.

Hint 1: Retrieval cue

In Gram–Schmidt, check ⟨ u 1 , u 2 ⟩ = 0 before using u 2 for anything else.

Hint 2: Concept cue

A projection coefficient is a ratio of inner products; the denominator is 1 only for unit vectors.

Hint 3: Strategy cue

In part (d) replace every sum over components by an integral over [ 0 , 1 ] and run the same steps.

Compare with the worked solution

Comparing does not record a result. Judging your own written answer cannot show that you can do this without help.

(a) Gram–Schmidt. Take u 1 = ( 1 , 0 , 1 ) , so ⟨ u 1 , u 1 ⟩ = 2 . For v 2 = ( 0 , 1 , 1 ) : ⟨ v 2 , u 1 ⟩ = 0 + 0 + 1 = 1 , so

u 2 = ( 0 , 1 , 1 ) − 1 2 ( 1 , 0 , 1 ) = ( − 1 2 , 1 , 1 2 ) .

Check. ⟨ u 1 , u 2 ⟩ = − 1 2 + 0 + 1 2 = 0 ✓. Also ⟨ u 2 , u 2 ⟩ = 1 4 + 1 + 1 4 = 3 2 . (b) The projection. With b = ( 2 , 1 , 0 ) :

⟨ b , u 1 ⟩ = 2 + 0 + 0 = 2 , c 1 = 2 2 = 1 ,
⟨ b , u 2 ⟩ = − 1 + 1 + 0 = 0 , c 2 = 0 3 / 2 = 0 .

So proj W ⁡ ( b ) = 1 ⋅ ( 1 , 0 , 1 ) + 0 ⋅ u 2 = ( 1 , 0 , 1 ) . Residual. e = ( 2 , 1 , 0 ) − ( 1 , 0 , 1 ) = ( 1 , 1 , − 1 ) . Orthogonality check. ⟨ e , u 1 ⟩ = 1 + 0 − 1 = 0 ✓ and ⟨ e , u 2 ⟩ = − 1 2 + 1 − 1 2 = 0 ✓. Since e is orthogonal to a basis of W , it is orthogonal to all of W . Pythagoras. ‖ b ‖ 2 = 4 + 1 + 0 = 5 ; ‖ proj W ⁡ ( b ) ‖ 2 = 1 + 0 + 1 = 2 and ‖ e ‖ 2 = 1 + 1 + 1 = 3 , and 2 + 3 = 5 ✓. That c 2 = 0 is informative rather than degenerate: b happens to have no component along u 2 , so the nearest point of the plane lies on the u 1 line. (c) The least-squares fit. With n = 3 , ∑ x i = 6 , ∑ x i 2 = 14 , ∑ y i = 5 , ∑ x i y i = 11 , the normal equations are

( 3 6 6 14 ) ( a b ) = ( 5 11 ) .

The determinant is 42 − 36 = 6 , so a = 5 ( 14 ) − 6 ( 11 ) 6 = 4 6 = 2 3 and b = 3 ( 11 ) − 6 ( 5 ) 6 = 3 6 = 1 2 . The fitted line is y = 2 3 + 1 2 x . Residuals. Fitted values are 7 6 , 5 3 , 13 6 , giving

e = ( − 1 6 , 1 3 , − 1 6 ) .

The two conditions. Each row of A T e = 0 is the residual against one column of A . Row 1, the column of ones: ∑ i e i = − 1 6 + 1 3 − 1 6 = 0 ✓. Row 2, the column of x i : ∑ i x i e i = − 1 6 + 2 3 − 1 2 = 0 ✓. The first holds because the model has an intercept; it is a consequence of the geometry, not of the data. (d) A different inner product.

⟨ 1 , x ⟩ = ∫ 0 1 1 ⋅ x d x = [ x 2 2 ] 0 1 = 1 2 ≠ 0 ,

so { 1 , x } is not orthogonal under this inner product, even though the two functions look unrelated. One Gram–Schmidt step, with u 1 = 1 and ⟨ u 1 , u 1 ⟩ = ∫ 0 1 1 d x = 1 :

u 2 = x − ⟨ x , 1 ⟩ ⟨ 1 , 1 ⟩ ⋅ 1 = x − 1 2 .

Check. ⟨ 1 , x − 1 2 ⟩ = ∫ 0 1 ( x − 1 2 ) d x = 1 2 − 1 2 = 0 ✓. So { 1 , x − 1 2 } is an orthogonal basis of P 1 under this inner product. (These are the first two Legendre polynomials on [ 0 , 1 ] , up to scaling.) (e) What the construction needed. In both parts it needed exactly three things: a way to pair two elements into a number, that pairing being symmetric and linear, and ⟨ v , v ⟩ > 0 for v ≠ 0 . Everything used, subtracting a projection, checking the result pairs to zero, is written in those terms alone. What it did not need: coordinates, a finite dimension, or the elements being lists of numbers. In (a) the pairing was a sum over three components; in (d) it was an integral over an interval. The formulas were identical because the axioms are identical, which is the point of defining an inner product abstractly rather than defining the dot product and stopping. What is specific to the choice: which vectors count as orthogonal. Under the standard dot product ( 1 , 1 ) and ( 1 , − 1 ) are orthogonal; under ⟨ u , v ⟩ = u 1 v 1 + 2 u 2 v 2 they are not. Orthogonality is a relation between two vectors and an inner product, and naming only the first two is incomplete.

A complete answer does each of these:

  • runs gram schmidt
  • computes projection coefficients
  • verifies residual orthogonality
  • states the normal equations
  • works beyond the dot product
Practice data

Your practice record is stored in this browser only. Clearing it removes every answer and every scheduled review, and cannot be undone.

Results update as you type. Use the up and down arrow keys to move between results, Enter to open one, and Escape to close.

Type to search.

Settings

Appearance

Interface density

Your record

Your progress is stored in this browser and nowhere else: an identifier, the answers you have given, the mastery states and review schedule derived from them, and the lesson you last opened. Clearing it makes you a new learner on this device. It cannot be undone, and it will not affect your appearance or density settings.

Focus timer

Focus--minutes remaining

Phase

Kept in this browser only, and used to label the session in your own history.

Today

Nothing recorded yet. Finish a focus session and it will appear here.

Settings

Focus sessions between long breaks.

Sessions you are aiming for in a day.

Notifications

Your history

Sessions are stored in this browser and nowhere else. They are not evidence and never reach your mastery record.