Linear Algebra midterm, solved the way Prof. Koçak solves it
Weeks 1 to 7 in about 3 hours: what he asks, the steps he wants to see, and the mistakes that cost points.
- −2R1
- multiply row 1 by −2 (row 1 itself stays as it is)
- + R2
- add row 2 to that
- → R2
- write the result in place of row 2
Every 40-point question on his exam is a chain of lines like this one. Write each of them, in this form.
1What the exam looks like
Four past papers from Prof. Koçak are in your files. They all have the same shape. The 2024–25 paper says 50 minutes.
So: one easy vectors question worth about 20 points, and then 80 points from three tools that are all the same row operations in different packaging.
- Elimination (Gauss, Gauss–Jordan): sections 4 and 5
- Inverse matrix: sections 6 and 7
- Factorization (L·U and L·D·U): sections 8 to 11
This year's review sheet asks exactly these, and nothing from "vector spaces and subspaces".
2His way: seven rules
These come straight from how his slides are written. Follow them on every question.
- Use the method the question names. A correct answer by another method is the classic way to lose the 40 points.
- "Gauss elimination": augmented matrix to upper triangle, then solve from the bottom equation up.
- "Gauss–Jordan": augmented matrix all the way to the identity matrix.
- "Inverse matrix": find A−1 from [A ⋮ I], then X = A−1·B.
- "Factorization": find L and U, then solve two triangle systems.
- Write every row operation in his form, next to the arrow: kRi + Rj → Rj. The row after the arrow is the row that changes. Do not write "R2 − 2R1" or "R2 ← …".
- The pivot row never changes in an operation. You multiply it, add it to another row, and only that other row is rewritten.
- No shortcut formulas for 3×3. No determinant-and-cofactor inverse, no Cramer's rule. He taught [A ⋮ I] and that is what he marks.
- Write "Step 1" and "Step 2" for the inverse matrix method and for factorization, like his slides.
- Keep fractions as fractions (4/5, 12/5), never decimals. Roots stay as roots: his slides leave 1/√30 as it is.
- Finish with one clear answer line: x = …, y = …, z = ….
3Vectors
Week 1. This is the 20 easy points. Every past paper asks the same things, so learn the six lines below by heart.
For u = (2, −1, 2) and v = (1, 2, 2): find Cosθ, the distance, and check whether u is a unit vector.The usual question 1, with fresh numbers
Write the formula first, then the numbers, then the result, as above. If the roots do not simplify, leave them: Cosθ = 19 / (√26·√74) is a finished answer.
u = (k, 2, −1) and v = (3, −4, 1) are perpendicular. Find k.
The p-norm distance
His slide defines a whole family of distances. Only the power changes.
x = (3, 1) and y = (5, 2). Distance for 1.norm and for 2.norm.His slide example
v = (1, −3, 4, 2). Find v̂.His slide example
- A negative number squared is positive: (−3)² = 9.
- The dot product can be negative. Keep the minus sign in Cosθ.
- Distance is not ‖u‖ − ‖v‖. Subtract the vectors first.
- If the vector is not a unit vector, do not stop at "no". Always give v̂.
- The 2024–25 paper says "identity vector". It means unit vector.
- "When does the dot product give zero?" Answer: when the vectors are perpendicular (orthogonal), because then Cosθ = 0.
The slides also define the cross product for vectors in ℝ³ (a 3×3 determinant with i, j, k in the first row, giving a vector perpendicular to both, with ‖u×v‖ = ‖u‖·‖v‖·Sinθ). It is in no past paper and not in this year's review, so it is your lowest priority.
Find Cosθ, d(u, v), û, and the 3.norm distance between A = (1, 2) and B = (3, 5).
Show the full solution
4Row operations in his notation
Weeks 2 and 3. Everything after this section is built from three moves. He calls them elementary row operations, and R1, R2, R3 are the rows.
How to choose k
The pivot is the diagonal entry you are working under (or above). To turn an entry into 0:
Then do the same thing to every number in the row, including the part after the dotted line when there is one.
Bring the matrix to an upper triangle matrix.His week 3 slide
All zeros under the diagonal: this is an upper triangle matrix. The pivots are 2, 1, 4.
Under the arrow he sometimes also writes l21 = 4. That only names the entry being killed: row 2, column 1, value 4. It is a label, not a new step.
Words he uses
- Upper triangle matrix: all entries under the diagonal are 0. Lower triangle: all entries above it are 0.
- Row echelon form (REF): zero rows at the bottom, and each row's first non-zero entry is to the right of the one above it. An upper triangle is this staircase shape. His definition also wants each leading entry to be 1, but on the week 5 slide he calls the triangle with pivots 2, 1, 4 row echelon form too.
- Reduced row echelon form (RREF): the leading entries are 1 and they are alone in their columns. For a system with one solution this is the identity matrix.
- Gauss elimination stops at the upper triangle. Gauss–Jordan goes on to the identity.
- Identity matrix I: 1 on the diagonal, 0 elsewhere. Transpose AT: rows become columns. Symmetric: AT = A. Trace: sum of the diagonal.
Elimination matrix
You need this idea once, in section 8. Do one row operation on the identity matrix and you get the elimination matrix E of that operation. Its inverse is the same matrix with the sign of that one number flipped.
Operation −2R1 + R2 → R2
The multiplier −2 sits in row 2, column 1, the place where the zero is made. In the inverse it becomes +2.
5Gauss and Gauss–Jordan elimination
Week 5. Solving A·X = B by elimination. His sentence for it: the main idea is to produce an upper triangle matrix or an identity matrix from the augmented matrix.
- Write the augmented matrix [A ⋮ B]: the coefficients, a dotted line, the right-hand side. A missing variable is a 0.
- Column 1: make zeros under the first pivot.
- Column 2: make zeros under the second pivot. (On his slide he clears the entry above it in the same arrow.)
- Gauss elimination ends here. Write the rows back as equations and solve from the bottom one up.
- Gauss–Jordan continues: make every pivot 1 with kRi → Ri, clear what is left above the pivots, until the left side is I. The last column is the answer.
Solve the system with the elimination method.His week 5 slide, same operations in the same order
Row echelon form. Read the rows as equations, bottom first:
Reduced row echelon form. The left side is I, so the last column is the solution.
Both halves are one continuous calculation. If the question says Gauss–Jordan, you write all of it and you do not back-substitute.
- The operation hits the whole row, including the number after the dotted line.
- "Gauss–Jordan" with a triangle and back-substitution at the end is Gauss, not Gauss–Jordan. Reach the identity.
- Two operations on one arrow must both use the rows from before the arrow.
- Check at the end: put x, y, z into one of the original equations. It takes ten seconds.
Show the full solution
Check in equation 2: 2·1 + 5·2 + 3 = 15.
6Inverse of a matrix
Week 4. A−1 is the matrix with A·A−1 = A−1·A = I. A matrix has at most one inverse.
Three quick facts from his notes
Slide example: find the inverse.
The method he marks: [A ⋮ I] → [I ⋮ A−1]
- Write A, a dotted line, and the identity matrix next to it. This is the augmented matrix [A ⋮ I].
- Do Gauss–Jordan on it. Every operation is applied to all six numbers of the row.
- When the left half is I, the right half is A−1. Write it out separately as the answer.
Find A−1 by Gauss elimination method.His week 4 slide gives this matrix without a solution. Solved here with his operations.
If a pivot is not 1, divide that row at the end, as he does in week 6 with 1/5R2 → R2. Fractions in the answer are normal: this year's review inverses have denominators like 7 and 16.
- Forgetting the right half. Each operation changes six numbers, not three.
- Stopping at the triangle. The left half must be exactly I, with 1s on the diagonal.
- Using the cofactor or determinant method on a 3×3. Not his way.
Show the full solution
7Solving a system with the inverse matrix
Week 6. Worth 40 points on the 2024–25 paper.
- Step 1. Write A (the coefficient matrix) and find A−1 with [A ⋮ I], exactly as in section 6.
- Step 2. Multiply: X = A−1·B. Each answer is one row of A−1 times the column B.
Solve the system by inverse matrix.His week 6 slide
Solve the system by inverse matrix.3×3 version
This is the matrix from section 6. In the exam, the full [A ⋮ I] working goes here.
- Order matters: it is A−1·B, never B·A−1.
- Do not solve the system by Gauss–Jordan on [A ⋮ B] here. The question wants the inverse shown, then the multiplication.
- When the exam gives the system already as matrix · column = column, A is that matrix and B is the column on the right.
This one is on his week 6 slide without a solution.
Show the full solution
8Factorization: A = L·U
Week 7 slides (the file is titled "Hafta 7"). Factorization means writing A as a product of two triangle matrices:
- U is the upper triangle you get from elimination.
- L is a lower triangle with 1s on the diagonal. Under the diagonal it stores the multipliers you used, with the sign flipped.
The "easy way" (his own name for it)
- Eliminate A down to an upper triangle using only kRi + Rj → Rj, working downwards. No scaling of rows, no clearing above the pivots, no right-hand side. The result is U.
- Start L as the identity. For each operation kRi + Rj → Rj, put −k in row j, column i of L.
- Write A = L·U with both matrices.
A = L·U = ? (find the factorization)His week 7 slide, the example labelled EASY WAY
Multipliers used: −2, −3, −3/2. Flip the signs and place them where the zeros were made:
Why it works: the long way
He shows this first, so recognise it. Each operation is an elimination matrix (section 4). Doing them one after another gives U, and moving them to the other side inverts them, which is where the sign flip comes from.
A = L·U = ?His week 7 slide. The L and U printed on the slide have typing mistakes; these are the correct ones.
Their inverses: flip the sign of the one multiplier.
- Putting the multiplier into L without flipping its sign. This is the number one mistake.
- Dividing a row of U to make the pivot 1. In L·U the pivots stay as they are (2, −5, 12/5 …).
- Working on the augmented matrix. Factor A alone; B comes in later.
Show the full solution
9Solving a system with factorization
Week 7. On the papers this is "find the solution by using factorization", worth 30 to 40 points.
- Step 1. Factor the coefficient matrix: A = L·U, exactly as in section 8.
- Step 2. Write A·X = B ⟹ L·U·X = B. Give the product U·X a name: the column (a, b, c).
- Solve L·(a, b, c) = B from the top row down. The first row gives a immediately.
- Solve U·X = (a, b, c) from the bottom row up. The last row gives z immediately.
Solve the system with factorization.His week 7 slide. The operation labels and one row of U are mistyped on the slide; the numbers here are the correct ones and give his final answer.
Call U·X the column (a, b, c). First solve L·(a, b, c) = B:
Then solve U·X = (a, b, c):
A 4×4 system
An older paper gave a 4×4 system here for 30 points, and his slide has one too. Nothing new happens, there is just more of it:
- Six eliminations, in this order: column 1 (rows 2, 3, 4), column 2 (rows 3, 4), column 3 (row 4).
- L gets six numbers under the diagonal.
- The helper column is (a, b, c, d), then you solve for the four unknowns from the bottom.
- Solving with Gauss elimination on [A ⋮ B] and never writing L. The answer will be right and the method wrong.
- Using B in the second triangle system. The right-hand side of U·X is (a, b, c), not B.
- Top-down for L, bottom-up for U. Mixing them makes it look impossible.
Same matrix as the Try it in section 8, so Step 1 is already done.
Show the full solution
10Factorization: A = L·D·U
L·D·U is L·U with one more step: the pivots are pulled out of U into a diagonal matrix D.
- Find A = L·U as in section 8. L is finished and does not change.
- D is the diagonal matrix made of the pivots of U (its diagonal entries).
- The new U: divide each row of the old U by its own pivot. Its diagonal becomes 1, 1, 1.
- Write A = L·D·U with all three matrices.
A = L·D·U = ?The EASY WAY matrix from his slide, continued
From section 8:
Pivots of U: 1, 2, −1/2. Row 2 divided by 2, row 3 divided by −1/2:
- Dividing by a negative or fractional pivot: −1/2 divided by −1/2 is 1, and 1 divided by 2 is 1/2. Go slowly.
- L and the new U both have 1s on the diagonal. D has zeros everywhere except the diagonal.
- When the question says "A = LU and A = LDU", write both results.
You found L and U in section 8.
Show the full solution
11When a pivot is zero
You cannot use 0 as a pivot, because k = −entry/pivot would divide by zero. So interchange rows first, then factor the reordered matrix as usual.
- Interchange the row that has the 0 with a lower row that has a non-zero number in that column: Ri ↔ Rj. If you can choose, pick the swap that leaves a 0 under the pivot, it saves an operation.
- Factor the new matrix into L·U (and D if asked).
- In a system, this is only writing the equations in a different order, so interchange the same entries of B.
- Say it in words on the paper: "after R1 ↔ R2, A = L·U".
A = L·U = ?Fresh example
L·U gives the matrix after the interchange, not the original A.
The same thing can happen in Gauss–Jordan or in [A ⋮ I]: if a pivot position holds 0, interchange with a lower row and carry on.
12Summary, slide mistakes, exam room
One-screen summary
Mistakes in the slides
If you open the PDFs and something does not match this guide, it is probably one of these. They are typing errors on the slides, checked by recalculating each example.
- Week 1, Cosθ example: both vectors are printed as (1, 3), but the result 6/10 belongs to u = (1, 3), v = (3, 1).
- Week 4, inverse of elimination matrix: the matrices are printed with 0 on the diagonal where there should be 1, and the second inverse repeats the first.
- Week 5, Gauss–Jordan: the row (1 0 −3 7) should be (1 0 −3 −7).
- Week 7, first L·U example: the final L is missing its −1 and the final U has a stray 2. The correct ones are in section 8.
- Week 7, second L·U example (the one before EASY WAY): the printed answer is copied from the first example and is not correct for that matrix.
- Week 7, system example: the three operation labels are mistyped and U's first row is printed as 1 2 2 instead of 2 2 2.
- Week 7, 4×4 system: the slide's second equation is −x − 3y − z − 4t = 0, which gives his printed answer (28, −6, −2, −2). The older review sheet prints +3x2, which is a typo.
In the exam room
- Do the vectors question first. It is fast and settles you.
- Before each 40-point question, underline the method word in the question.
- Copy the matrix carefully. One wrong sign in line one ruins everything after it.
- Leave two minutes to check: put your x, y, z into one original equation.