Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Open In Colab Binder

Compiled from the original manuscript of Chapter 6 exercises provided by Professor Ping-Zen Ong: 44 top-level exercises in all, in the same order as in the manuscript. Every exercise comes with a hint and a complete solution that can be expanded; computational exercises are followed by a NumPy verification, while pure proof exercises have no accompanying program.

This part uses 0-based indexing. Inconsistent notation and ambiguities in the statements of the original manuscript are noted in the corresponding exercises, and computed results follow the original data.

Row Operations, Reduced Forms, and Rank

============================================================
  Exercise 6-1 | Row-Reduced Form
============================================================

▶ Step 1: Build the matrix and perform Gauss–Jordan elimination
----------------------------------------

[rref(A)]
  Computed value: [[ 1. -2.  0. -5.]
 [ 0.  0.  1.  2.]
 [ 0.  0.  0.  0.]]
  Expected value: [[1, -2, 0, -5], [0, 0, 1, 2], [0, 0, 0, 0]]
  check passed

▶ Step 2: Check the rank
----------------------------------------

[rank(A)]
  Computed value: 2
  Expected value: 2
  check passed
============================================================
  Exercise 6-2 | Different Ways of Eliminating
============================================================

▶ Step 1: Compare three readings of the operations
----------------------------------------

[rref]
  Computed value: [[ 1.  0. -1.]
 [ 0.  1.  2.]]
  Expected value: [[1, 0, -1], [0, 1, 2]]
  check passed

[rref]
  Computed value: [[ 1.  0. -1.]
 [ 0.  1.  2.]]
  Expected value: [[1, 0, -1], [0, 1, 2]]
  check passed

[rref]
  Computed value: [[ 1.  0. -1.]
 [ 0.  1.  2.]]
  Expected value: [[1, 0, -1], [0, 1, 2]]
  check passed
============================================================
  Exercise 6-3 | Recovering the Matrix
============================================================

▶ Step 1: Check the rref of the recovered matrix
----------------------------------------

[rref(A)]
  Computed value: [[ 1.  3.  0.  2.]
 [ 0.  0.  1. -1.]
 [ 0.  0.  0.  0.]]
  Expected value: [[1, 3, 0, 2], [0, 0, 1, -1], [0, 0, 0, 0]]
  check passed

[column relation]
  Computed value: [ 0 -1 -1]
  Expected value: [ 0 -1 -1]
  check passed

[rank of the two basis columns]
  Computed value: 2
  Expected value: 2
  check passed
============================================================
  Exercise 6-4 | Undoing Row Operations
============================================================

▶ Step 1: Redo the three row operations after recovering M
----------------------------------------

[E2 E1 E0 M]
  Computed value: [[3. 1. 1.]
 [0. 2. 1.]
 [0. 0. 1.]]
  Expected value: [[3, 1, 1], [0, 2, 1], [0, 0, 1]]
  check passed
============================================================
  Exercise 6-5 | A Parameter and the Rank
============================================================

▶ Step 1: Check the degenerate value and generic values
----------------------------------------

[λ=-3: rank]
  Computed value: 1
  Expected value: 1
  check passed

[λ=-2: rank]
  Computed value: 2
  Expected value: 2
  check passed

[λ=0: rank]
  Computed value: 2
  Expected value: 2
  check passed

[λ=4: rank]
  Computed value: 2
  Expected value: 2
  check passed
============================================================
  Exercise 6-9 | Reduced Form with a Parameter
============================================================

▶ Step 1: Check the two degenerate values and generic values separately
----------------------------------------

[λ=1: rref]
  Computed value: [[1. 1. 1.]
 [0. 0. 0.]
 [0. 0. 0.]]
  Expected value: [[1, 1, 1], [0, 0, 0], [0, 0, 0]]
  check passed

[λ=-2: rref]
  Computed value: [[ 1.  0. -1.]
 [ 0.  1. -1.]
 [ 0.  0.  0.]]
  Expected value: [[1, 0, -1], [0, 1, -1], [0, 0, 0]]
  check passed

[λ=0: rref]
  Computed value: [[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]
  Expected value: [[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]
  check passed

[λ=2: rref]
  Computed value: [[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]
  Expected value: [[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]
  check passed

[λ=-3: rref]
  Computed value: [[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]
  Expected value: [[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]
  check passed

Homogeneous Systems of Linear Equations

============================================================
  Exercise 6-11 | Solving Homogeneous Systems
============================================================

▶ Step 1: Check the three rrefs and the kernel vectors
----------------------------------------

[system 1: rref]
  Computed value: [[1. 2. 0.]
 [0. 0. 1.]
 [0. 0. 0.]]
  Expected value: [[1, 2, 0], [0, 0, 1], [0, 0, 0]]
  check passed

[kernel vector]
  Computed value: [0 0 0]
  Expected value: [0. 0. 0.]
  check passed

[system 2: rref]
  Computed value: [[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]
 [0. 0. 0.]]
  Expected value: [[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]
 [0. 0. 0.]]
  check passed

[system 3: rref]
  Computed value: [[1. 2. 0.]
 [0. 0. 1.]
 [0. 0. 0.]]
  Expected value: [[1, 2, 0], [0, 0, 1], [0, 0, 0]]
  check passed

[kernel vector]
  Computed value: [0 0 0]
  Expected value: [0. 0. 0.]
  check passed
============================================================
  Exercise 6-12 | Kernel in Four Unknowns
============================================================

▶ Step 1: Check the rref
----------------------------------------

[rref(A)]
  Computed value: [[1. 2. 0. 5.]
 [0. 0. 1. 2.]
 [0. 0. 0. 0.]]
  Expected value: [[1, 2, 0, 5], [0, 0, 1, 2], [0, 0, 0, 0]]
  check passed

▶ Step 2: Check the basis of the kernel
----------------------------------------

[AN]
  Computed value: [[0 0]
 [0 0]
 [0 0]]
  Expected value: [[0. 0.]
 [0. 0.]
 [0. 0.]]
  check passed

[rank(N)]
  Computed value: 2
  Expected value: 2
  check passed
============================================================
  Exercise 6-13 | Only the Zero Solution
============================================================

▶ Step 1: Check the rank and the reduced form
----------------------------------------

[rref(B)]
  Computed value: [[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]
  Expected value: [[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]
  check passed

[rank(B)]
  Computed value: 3
  Expected value: 3
  check passed
============================================================
  Exercise 6-14 | Homogeneous Solutions with a Parameter
============================================================

▶ Step 1: Check the kernels and their dimensions in the degenerate cases
----------------------------------------

[AN]
  Computed value: [[0 0]
 [0 0]
 [0 0]]
  Expected value: [[0. 0.]
 [0. 0.]
 [0. 0.]]
  check passed

[nullity(A)]
  Computed value: 2
  Expected value: 2
  check passed

[AN]
  Computed value: [[0.]
 [0.]
 [0.]]
  Expected value: [[0.]
 [0.]
 [0.]]
  check passed

[nullity(A)]
  Computed value: 1
  Expected value: 1
  check passed

[only the zero solution when λ=0]
  Computed value: 3
  Expected value: 3
  check passed
============================================================
  Exercise 6-15 | Solving from the Row Space
============================================================

▶ Step 1: Check the kernel of the two equivalent equations
----------------------------------------

[B(-1,1,1)^T]
  Computed value: [0 0]
  Expected value: [0. 0.]
  check passed

[rank(B)]
  Computed value: 2
  Expected value: 2
  check passed

Nonhomogeneous Systems

============================================================
  Exercise 6-17 | Solving Nonhomogeneous Systems
============================================================

▶ Step 1: Check that both the new z and the 7z reading from the homogeneous version have no solution
----------------------------------------

[rank(A)]
  Computed value: 2
  Expected value: 2
  check passed

[rank([A | b])]
  Computed value: 3
  Expected value: 3
  check passed

[rank(A)]
  Computed value: 2
  Expected value: 2
  check passed

[rank([A | b])]
  Computed value: 3
  Expected value: 3
  check passed

▶ Step 2: Verify the unique solution and the affine family of solutions
----------------------------------------

[system 2 substituted]
  Computed value: [ 4  0 -2  0]
  Expected value: [4, 0, -2, 0]
  check passed

[system 3 particular solution]
  Computed value: [2 1 2]
  Expected value: [2, 1, 2]
  check passed

[system 3 homogeneous direction]
  Computed value: [0 0 0]
  Expected value: [0, 0, 0]
  check passed
============================================================
  Exercise 6-18 | Structure of the General Solution of a Nonhomogeneous System
============================================================

▶ Step 1: Check the rref of the augmented matrix and consistency
----------------------------------------

[rref of the augmented matrix]
  Computed value: [[1. 2. 0. 5. 7.]
 [0. 0. 1. 2. 5.]
 [0. 0. 0. 0. 0.]]
  Expected value: [[1, 2, 0, 5, 7], [0, 0, 1, 2, 5], [0, 0, 0, 0, 0]]
  check passed

[rank(A)]
  Computed value: 2
  Expected value: 2
  check passed

[rank([A | b])]
  Computed value: 2
  Expected value: 2
  check passed

▶ Step 2: Check the particular solution and the homogeneous solution space
----------------------------------------

[A x_p]
  Computed value: [2 9 3]
  Expected value: [2 9 3]
  check passed

[AN]
  Computed value: [[0 0]
 [0 0]
 [0 0]]
  Expected value: [[0. 0.]
 [0. 0.]
 [0. 0.]]
  check passed

[number of kernel basis vectors vs. rank]
  Computed value: 2
  Expected value: 2
  check passed

▶ Step 3: Substitute the affine general solution x = x_p + x_h
----------------------------------------

[s=0, t=0: general solution]
  Computed value: [7 0 5 0]
  Expected value: [7, 0, 5, 0]
  check passed

[A x]
  Computed value: [2 9 3]
  Expected value: [2 9 3]
  check passed

[s=1, t=-2: general solution]
  Computed value: [15  1  9 -2]
  Expected value: [15, 1, 9, -2]
  check passed

[A x]
  Computed value: [2 9 3]
  Expected value: [2 9 3]
  check passed

[s=-3, t=4: general solution]
  Computed value: [-7 -3 -3  4]
  Expected value: [-7, -3, -3, 4]
  check passed

[A x]
  Computed value: [2 9 3]
  Expected value: [2 9 3]
  check passed
============================================================
  Exercise 6-19 | The Augmented-Rank Criterion
============================================================

▶ Step 1: Check the rrefs in the consistent and inconsistent cases
----------------------------------------

[α=7]
  Computed value: [[ 1.  0. -1. -1.]
 [ 0.  1.  3.  3.]
 [ 0.  0.  0.  0.]]
  Expected value: [[1, 0, -1, -1], [0, 1, 3, 3], [0, 0, 0, 0]]
  check passed

[α=0]
  Computed value: [[ 1.  0. -1.  0.]
 [ 0.  1.  3.  0.]
 [ 0.  0.  0.  1.]]
  Expected value: [[1, 0, -1, 0], [0, 1, 3, 0], [0, 0, 0, 1]]
  check passed

[α=8]
  Computed value: [[ 1.  0. -1.  0.]
 [ 0.  1.  3.  0.]
 [ 0.  0.  0.  1.]]
  Expected value: [[1, 0, -1, 0], [0, 1, 3, 0], [0, 0, 0, 1]]
  check passed

[particular solution]
  Computed value: [2 5 7]
  Expected value: [2, 5, 7]
  check passed

[homogeneous direction]
  Computed value: [0 0 0]
  Expected value: [0, 0, 0]
  check passed
============================================================
  Exercise 6-20 | Nonhomogeneous System with a Parameter
============================================================

▶ Step 1: Check the unique solution for generic parameters
----------------------------------------

[λ=0: solution]
  Computed value: [0.5 0.5 0.5]
  Expected value: [0.5 0.5 0.5]
  check passed

[λ=2: solution]
  Computed value: [0.25 0.25 0.25]
  Expected value: [0.25 0.25 0.25]
  check passed

[λ=-3: solution]
  Computed value: [-1. -1. -1.]
  Expected value: [-1. -1. -1.]
  check passed

▶ Step 2: Check the two special values
----------------------------------------

[λ=-2: rank of the augmented matrix]
  Computed value: 3
  Expected value: 3
  check passed

[λ=1: particular solution]
  Computed value: [1. 1. 1.]
  Expected value: [1. 1. 1.]
  check passed

[λ=1: homogeneous directions]
  Computed value: [[0. 0.]
 [0. 0.]
 [0. 0.]]
  Expected value: [[0. 0.]
 [0. 0.]
 [0. 0.]]
  check passed

Solution Sets and Affine Translations

============================================================
  Exercise 6-22 | True or False: Translations
============================================================

▶ Step 1: Check the wrong and the correct direction in statement 2
----------------------------------------

[residual of the given direction]
  Computed value: [0 1]
  Expected value: [0, 1]
  check passed

[residual of the correct direction]
  Computed value: [0 0]
  Expected value: [0, 0]
  check passed

▶ Step 2: Check the remaining statements about translations
----------------------------------------

[statement 1: translation constant]
  Computed value: 2
  Expected value: 2
  check passed

[statement 3: translation constant]
  Computed value: 0
  Expected value: 0
  check passed

[statement 4: rank of the directions]
  Computed value: 1
  Expected value: 1
  check passed

[constant of the correct plane]
  Computed value: -2
  Expected value: -2
  check passed

LU and Permutation Matrices

============================================================
  Exercise 6-25 | LU Decompositions of 2×2 Matrices
============================================================

▶ Step 1: Check every matrix for which a decomposition exists
----------------------------------------

[ℓ=2.5: LU]
  Computed value: [[2. 1.]
 [5. 3.]]
  Expected value: [[2 1]
 [5 3]]
  check passed

[ℓ=5: LU]
  Computed value: [[ 2  0]
 [10  5]]
  Expected value: [[ 2  0]
 [10  5]]
  check passed

[ℓ=-1: LU]
  Computed value: [[ 0  1]
 [ 0 -1]]
  Expected value: [[ 0  1]
 [ 0 -1]]
  check passed

[ℓ=0: LU]
  Computed value: [[ 0  1]
 [ 0 -1]]
  Expected value: [[ 0  1]
 [ 0 -1]]
  check passed

[ℓ=2: LU]
  Computed value: [[ 0  1]
 [ 0 -1]]
  Expected value: [[ 0  1]
 [ 0 -1]]
  check passed

[ℓ=1: LU]
  Computed value: [[1 0]
 [1 0]]
  Expected value: [[1 0]
 [1 0]]
  check passed

[ℓ=-2: LU]
  Computed value: [[0 0]
 [0 1]]
  Expected value: [[0 0]
 [0 1]]
  check passed

[ℓ=0: LU]
  Computed value: [[0 0]
 [0 1]]
  Expected value: [[0 0]
 [0 1]]
  check passed

[ℓ=3: LU]
  Computed value: [[0 0]
 [0 1]]
  Expected value: [[0 0]
 [0 1]]
  check passed
============================================================
  Exercise 6-29 | Elimination for a 3×3 Matrix
============================================================

▶ Step 1: Compute and compare the LU factors
----------------------------------------

[L]
  Computed value: [[1. 0. 0.]
 [2. 1. 0.]
 [1. 3. 1.]]
  Expected value: [[1, 0, 0], [2, 1, 0], [1, 3, 1]]
  check passed

[U]
  Computed value: [[2. 1. 1.]
 [0. 3. 0.]
 [0. 0. 6.]]
  Expected value: [[2, 1, 1], [0, 3, 0], [0, 0, 6]]
  check passed

[LU]
  Computed value: [[ 2.  1.  1.]
 [ 4.  5.  2.]
 [ 2. 10.  7.]]
  Expected value: [[ 2  1  1]
 [ 4  5  2]
 [ 2 10  7]]
  check passed
============================================================
  Exercise 6-30 | Decomposing a Rectangular Matrix
============================================================

▶ Step 1: Check the LU decomposition and the rank
----------------------------------------

[LU]
  Computed value: [[1 2 0 1]
 [2 4 1 3]
 [3 6 1 4]]
  Expected value: [[1 2 0 1]
 [2 4 1 3]
 [3 6 1 4]]
  check passed

[rank(C)]
  Computed value: 2
  Expected value: 2
  check passed
============================================================
  Exercise 6-31 | Permutation Matrices
============================================================

▶ Step 1: Read off the three permutations
----------------------------------------

[column index of the 1 in each row]
  Computed value: [0 1 2]
  Expected value: [0, 1, 2]
  check passed

[column index of the 1 in each row]
  Computed value: [1 2 0]
  Expected value: [1, 2, 0]
  check passed

[column index of the 1 in each row]
  Computed value: [1 3 0 2]
  Expected value: [1, 3, 0, 2]
  check passed

▶ Step 2: Check the order of composition with concrete noncommuting permutations
----------------------------------------

[Pσ Pτ]
  Computed value: [[1. 0. 0. 0.]
 [0. 0. 0. 1.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]]
  Expected value: [[1. 0. 0. 0.]
 [0. 0. 0. 1.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]]
  check passed

[Pσ^T Pσ]
  Computed value: [[1. 0. 0. 0.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]
 [0. 0. 0. 1.]]
  Expected value: [[1. 0. 0. 0.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]
 [0. 0. 0. 1.]]
  check passed
============================================================
  Exercise 6-32 | Decomposition with Row Exchanges
============================================================

▶ Step 1: Check PA=LU and A=P^T LU separately
----------------------------------------

[PA]
  Computed value: [[1. 2. 3.]
 [0. 1. 2.]
 [2. 3. 4.]]
  Expected value: [[1 2 3]
 [0 1 2]
 [2 3 4]]
  check passed

[P^T LU]
  Computed value: [[0. 1. 2.]
 [1. 2. 3.]
 [2. 3. 4.]]
  Expected value: [[0 1 2]
 [1 2 3]
 [2 3 4]]
  check passed

[PA]
  Computed value: [[1. 2. 3.]
 [0. 2. 1.]
 [2. 4. 0.]]
  Expected value: [[1 2 3]
 [0 2 1]
 [2 4 0]]
  check passed

[P^T LU]
  Computed value: [[1. 2. 3.]
 [2. 4. 0.]
 [0. 2. 1.]]
  Expected value: [[1 2 3]
 [2 4 0]
 [0 2 1]]
  check passed

[PA]
  Computed value: [[1. 3. 5.]
 [0. 1. 2.]
 [0. 0. 1.]]
  Expected value: [[1. 3. 5.]
 [0. 1. 2.]
 [0. 0. 1.]]
  check passed

[P^T LU]
  Computed value: [[0. 1. 2.]
 [0. 0. 1.]
 [1. 3. 5.]]
  Expected value: [[0 1 2]
 [0 0 1]
 [1 3 5]]
  check passed
============================================================
  Exercise 6-35 | Solving via the Decomposition
============================================================

▶ Step 1: Forward substitution, then back substitution
----------------------------------------

[P b]
  Computed value: [2. 5. 1.]
  Expected value: [2, 5, 1]
  check passed

[y]
  Computed value: [ 2.  1. -0.]
  Expected value: [2, 1, 0]
  check passed

[x]
  Computed value: [ 0.8333  0.3333 -0.    ]
  Expected value: [0.8333333333333334, 0.3333333333333333, 0]
  check passed

▶ Step 2: Rebuild the coefficient matrix and substitute back
----------------------------------------

[A x]
  Computed value: [1. 2. 5.]
  Expected value: [1 2 5]
  check passed

LDU and Symmetric Decompositions

============================================================
  Exercise 6-36 | LDU Decompositions of 2×2 Matrices
============================================================

▶ Step 1: Check the unique decompositions and the family with free parameters
----------------------------------------

[LDU]
  Computed value: [[2. 1.]
 [5. 3.]]
  Expected value: [[2, 1], [5, 3]]
  check passed

[LDU]
  Computed value: [[2 0]
 [0 7]]
  Expected value: [[2, 0], [0, 7]]
  check passed

[LDU]
  Computed value: [[2. 8.]
 [1. 4.]]
  Expected value: [[2, 8], [1, 4]]
  check passed

[LDU]
  Computed value: [[1 0]
 [0 0]]
  Expected value: [[1, 0], [0, 0]]
  check passed

[LDU with free parameters]
  Computed value: [[0 0]
 [0 1]]
  Expected value: [[0, 0], [0, 1]]
  check passed

[LDU with free parameters]
  Computed value: [[0 0]
 [0 1]]
  Expected value: [[0, 0], [0, 1]]
  check passed

[LDU with free parameters]
  Computed value: [[0 0]
 [0 1]]
  Expected value: [[0, 0], [0, 1]]
  check passed
============================================================
  Exercise 6-38 | LDU Decomposition with a Parameter
============================================================

▶ Step 1: Check generic values and the singular value λ=0
----------------------------------------

[λ=0: LDU]
  Computed value: [[1. 1. 1.]
 [1. 0. 0.]
 [1. 0. 0.]]
  Expected value: [[1 1 1]
 [1 0 0]
 [1 0 0]]
  check passed

[λ=2: LDU]
  Computed value: [[1. 1. 1.]
 [1. 4. 0.]
 [1. 0. 0.]]
  Expected value: [[1 1 1]
 [1 4 0]
 [1 0 0]]
  check passed

[λ=-3: LDU]
  Computed value: [[1. 1. 1.]
 [1. 9. 0.]
 [1. 0. 0.]]
  Expected value: [[1 1 1]
 [1 9 0]
 [1 0 0]]
  check passed

▶ Step 2: Check that elimination works for λ=±1 after a row exchange
----------------------------------------

[PA=LU]
  Computed value: [[1. 1. 1.]
 [1. 0. 0.]
 [1. 1. 0.]]
  Expected value: [[1. 1. 1.]
 [1. 0. 0.]
 [1. 1. 0.]]
  check passed

[PA=LU]
  Computed value: [[1. 1. 1.]
 [1. 0. 0.]
 [1. 1. 0.]]
  Expected value: [[1. 1. 1.]
 [1. 0. 0.]
 [1. 1. 0.]]
  check passed
============================================================
  Exercise 6-39 | Symmetric Decomposition
============================================================

▶ Step 1: Check the LU and LDL^T decompositions
----------------------------------------

[L]
  Computed value: [[1. 0. 0.]
 [2. 1. 0.]
 [1. 1. 1.]]
  Expected value: [[1, 0, 0], [2, 1, 0], [1, 1, 1]]
  check passed

[V]
  Computed value: [[1. 2. 1.]
 [0. 3. 3.]
 [0. 0. 6.]]
  Expected value: [[1, 2, 1], [0, 3, 3], [0, 0, 6]]
  check passed

[LDL^T]
  Computed value: [[ 1.  2.  1.]
 [ 2.  7.  5.]
 [ 1.  5. 10.]]
  Expected value: [[ 1  2  1]
 [ 2  7  5]
 [ 1  5 10]]
  check passed
============================================================
  Exercise 6-40 | A Degenerate Symmetric Form
============================================================

▶ Step 1: Check the decomposition for different t
----------------------------------------

[t=-2: LDL^T]
  Computed value: [[0 0]
 [0 3]]
  Expected value: [[0, 0], [0, 3]]
  check passed

[t=0: LDL^T]
  Computed value: [[0 0]
 [0 3]]
  Expected value: [[0, 0], [0, 3]]
  check passed

[t=3: LDL^T]
  Computed value: [[0 0]
 [0 3]]
  Expected value: [[0, 0], [0, 3]]
  check passed

Augmented Matrices and Inversion

============================================================
  Exercise 6-43 | Gauss–Jordan Inversion
============================================================

▶ Step 1: Form the augmented matrix and eliminate downward
----------------------------------------
[A | I_4] =
 [[ 1.  0.  0.  1.  1.  0.  0.  0.]
 [ 0.  1. -1.  2.  0.  1.  0.  0.]
 [ 2. -1.  2.  0.  0.  0.  1.  0.]
 [ 1.  0.  2.  2.  0.  0.  0.  1.]]

[augmented matrix after downward elimination]
  Computed value: [[ 1.  0.  0.  1.  1.  0.  0.  0.]
 [ 0.  1. -1.  2.  0.  1.  0.  0.]
 [ 0.  0.  1.  0. -2.  1.  1.  0.]
 [ 0.  0.  0.  1.  3. -2. -2.  1.]]
  Expected value: [[1, 0, 0, 1, 1, 0, 0, 0], [0, 1, -1, 2, 0, 1, 0, 0], [0, 0, 1, 0, -2, 1, 1, 0], [0, 0, 0, 1, 3, -2, -2, 1]]
  check passed

[det(A)]
  Computed value: 0.9999999999999998
  Expected value: 1
  check passed

[rank(A)]
  Computed value: 4
  Expected value: 4
  check passed

▶ Step 2: Eliminate upward and read off the inverse matrix
----------------------------------------

[left half]
  Computed value: [[1. 0. 0. 0.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]
 [0. 0. 0. 1.]]
  Expected value: [[1. 0. 0. 0.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]
 [0. 0. 0. 1.]]
  check passed

[A^{-1}]
  Computed value: [[-2.  2.  2. -1.]
 [-8.  6.  5. -2.]
 [-2.  1.  1.  0.]
 [ 3. -2. -2.  1.]]
  Expected value: [[-2  2  2 -1]
 [-8  6  5 -2]
 [-2  1  1  0]
 [ 3 -2 -2  1]]
  check passed

▶ Step 3: Check by multiplying on both sides
----------------------------------------

[AB]
  Computed value: [[1. 0. 0. 0.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]
 [0. 0. 0. 1.]]
  Expected value: [[1. 0. 0. 0.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]
 [0. 0. 0. 1.]]
  check passed

[BA]
  Computed value: [[1. 0. 0. 0.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]
 [0. 0. 0. 1.]]
  Expected value: [[1. 0. 0. 0.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]
 [0. 0. 0. 1.]]
  check passed
============================================================
  Exercise 6-44 | Inversion with a Parameter
============================================================

▶ Step 1: Check the degenerate parameter
----------------------------------------

[rank for a=2]
  Computed value: 2
  Expected value: 2
  check passed

▶ Step 2: Check the inverse matrix on both sides
----------------------------------------

[B C]
  Computed value: [[1 0 0]
 [0 1 0]
 [0 0 1]]
  Expected value: [[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]
  check passed

[C B]
  Computed value: [[1 0 0]
 [0 1 0]
 [0 0 1]]
  Expected value: [[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]
  check passed

✓ All exercises completed.