σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
Linear Algebra skill›Module 2 · Solving linear systems›Topic 2.3·~50 minIntermediate

Inverse and conditioning

Skill positionModule 2 of 4 · Topic 3 of 3
2.3 Inverse and conditioning
—Lab score— / 100Total XP—Streak—

Undoing a map

A square matrix AAA has an inverse A−1A^{-1}A−1, with A−1A=AA−1=IA^{-1}A=AA^{-1}=IA−1A=AA−1=I, exactly when its map loses no information: different inputs give different outputs. The determinant measures how AAA scales volumes (with a sign for flips), so AAA is invertible exactly when det⁡A≠0\det A\neq0detA=0. For a 2×22\times22×2 matrix, A−1=1ad−bc(d−b−ca)A^{-1}=\frac{1}{ad-bc}\begin{pmatrix}d&-b\\-c&a\end{pmatrix}A−1=ad−bc1​(d−c​−ba​). Useful rules: det⁡(AB)=det⁡A det⁡B\det(AB)=\det A\,\det Bdet(AB)=detAdetB and det⁡(A−1)=1/det⁡A\det(A^{-1})=1/\det Adet(A−1)=1/detA.

κ(A)=∥A∥ ∥A−1∥=σmax⁡σmin⁡,∥δx∥∥x∥≲κ(A) ∥δb∥∥b∥\kappa(A)=\|A\|\,\|A^{-1}\|=\frac{\sigma_{\max}}{\sigma_{\min}},\qquad \frac{\|\delta\mathbf{x}\|}{\|\mathbf{x}\|}\lesssim\kappa(A)\,\frac{\|\delta\mathbf{b}\|}{\|\mathbf{b}\|}κ(A)=∥A∥∥A−1∥=σmin​σmax​​,∥x∥∥δx∥​≲κ(A)∥b∥∥δb∥​(1)

Invertible is not the same as safe. The condition number κ(A)\kappa(A)κ(A) says how much a small relative error in b\mathbf{b}b (or in the entries of AAA) can be magnified in the solution x\mathbf{x}x. A rule of thumb: you lose about log⁡10κ\log_{10}\kappalog10​κ of your roughly 16 digits of double precision. A small determinant alone proves nothing, because it depends on the scale: 0.001 I0.001\,I0.001I has a tiny determinant but κ=1\kappa=1κ=1. Nearly collinear columns are what make κ\kappaκ huge.

An inverse and a near missFor A=(4726)A=\begin{pmatrix}4&7\\2&6\end{pmatrix}A=(42​76​): det⁡A=24−14=10\det A=24-14=10detA=24−14=10, so A−1=110(6−7−24)A^{-1}=\frac{1}{10}\begin{pmatrix}6&-7\\-2&4\end{pmatrix}A−1=101​(6−2​−74​). Now compare B=(1111.0001)B=\begin{pmatrix}1&1\\1&1.0001\end{pmatrix}B=(11​11.0001​): its columns are almost equal, det⁡B=0.0001\det B=0.0001detB=0.0001 and κ(B)\kappa(B)κ(B) is about 4×1044\times10^{4}4×104, so a 10−610^{-6}10−6 relative error in the data can become an error of about 4%4\%4% in the solution.
  • Invertible: square with det⁡A≠0\det A\neq0detA=0; no information is lost.
  • Condition number: how much errors in the data are magnified; large means a fragile solve.
  • Never form A−1A^{-1}A−1 to solve: a factorisation solve is faster and more accurate.
Collinear assets break covariance matricesTwo ETFs that track nearly the same index give a covariance matrix with nearly equal rows. Its κ\kappaκ is huge, so a minimum-variance optimiser built on its inverse swings wildly with tiny changes in the data. Check κ\kappaκ (or drop or combine the near-duplicates) before you trust the weights.

Lab · what's graded

  • The inverse of a 2 by 2 matrix20 pts
  • A 3 by 3 determinant10 pts
  • Find the singular matrix15 pts
  • Digits you can trust15 pts
  • Good numerical practice15 pts
  • Determinant rules10 pts
  • Why not invert15 pts
0/ 7 answered
Tasks
1Matrix · vector20 ptsNot answered

Fill in A−1A^{-1}A−1 for A=(4726)A=\begin{pmatrix}4&7\\2&6\end{pmatrix}A=(42​76​) (decimals are fine).

A−1=A^{-1} =A−1=
2Numeric answer10 ptsNot answered

Compute det⁡(201132014)\det\begin{pmatrix}2&0&1\\1&3&2\\0&1&4\end{pmatrix}det​210​031​124​​.

det⁡=\det =det=accepted: ± 0.001
3Choice15 ptsNot answered

Which of these matrices is singular (has no inverse)?

4Numeric answer15 ptsNot answered

A system has κ(A)=106\kappa(A)=10^{6}κ(A)=106 and you solve it in double precision (about 16 digits). Roughly how many correct digits does the solution have?

[objectObject]=[object Object] =[objectObject]=accepted: ± 1
5Choice15 ptsNot answered

Select all the good practices.

6Fill the blanks10 ptsNot answered

Suppose det⁡A=4\det A=4detA=4 and det⁡B=3\det B=3detB=3. Fill in the blanks.

det⁡(AB)=,det⁡(A−1)=\displaystyle \det(AB)=\htmlData{blank=p}{\phantom{\rule[-0.35em]{2.4em}{1.35em}}},\qquad \det(A^{-1})=\htmlData{blank=q}{\phantom{\rule[-0.35em]{2.4em}{1.35em}}}det(AB)=,det(A−1)=
7Explain in words15 ptsNot answered

In two sentences, say why code should call solve(A, b) rather than inv(A) @ b.

Math modeKeyboard or LaTeX inputTask 1 of 7 · Ctrl ⏎ to check

Log in to run your code.

Every lecture is free to read. Create an account or log in to run code, run tests and submit this lab.

  • In-browser IDE with a bash terminal — nothing to install
  • Instant grading, XP and your place on the skill
Create an accountLog in
OR
Continue with GitHub