Do It By Hand hero
LaboratoryLinear Algebra Part 1 (Vectors & Dot Products)

Do It By Hand

Solidify your understanding with hands-on practice problems, calculating vector arithmetic, projections, and dot products manually.

Part 1: The Underlying Mechanics

Problem 1: Vector Construction (Position is Identity) A credit-risk model locks its feature order as [Credit Score (in 100s), Years Employed, Debt Ratio]. An applicant has been employed for 4 years, carries a Debt Ratio of 0.3, and has a Credit Score of 720 (encode as 7.27.2). Construct the correctly-ordered feature vector xx.

Reveal Solution

x=[7.240.3]x = \begin{bmatrix} 7.2 \\ 4 \\ 0.3 \end{bmatrix}

The applicant's facts were given out of order (Years, Debt Ratio, Credit Score) — the vector must still follow the locked order (Credit Score, Years, Debt Ratio), not the order the facts happened to be mentioned in.

Problem 2: Position Swap Consequence A weather model locks its order as [Temperature (°F), Humidity (%), Wind Speed (mph)]. Monday's true weather is correctly logged as [70,60,12][70, 60, 12]. An intern re-logs the exact same physical weather for Tuesday but accidentally swaps positions 1 and 2, recording [60,70,12][60, 70, 12]. According to the locked feature order — not what the intern intended — what does the vector [60,70,12][60, 70, 12] actually claim Tuesday's Temperature and Humidity were?

Reveal Solution

Position 1 is always read as Temperature and position 2 as Humidity, regardless of intent. So [60,70,12][60, 70, 12] claims Temperature =60°F= 60°F and Humidity =70%= 70\% — a physically different (and wrong) reading from Monday's actual 70°F70°F / 60%60\%. The math has no way to know positions were swapped; it just reads position 1 as Temperature, every time. This is exactly why the order must never be scrambled.

Problem 3: Linear Combination Calculate 2v1v22v_1 - v_2 where v1=[10]v_1 = \begin{bmatrix} 1 \\ 0 \end{bmatrix} and v2=[42]v_2 = \begin{bmatrix} 4 \\ 2 \end{bmatrix}.

Reveal Solution

2[10][42]=[20][42]=[22]2 \begin{bmatrix} 1 \\ 0 \end{bmatrix} - \begin{bmatrix} 4 \\ 2 \end{bmatrix} = \begin{bmatrix} 2 \\ 0 \end{bmatrix} - \begin{bmatrix} 4 \\ 2 \end{bmatrix} = \begin{bmatrix} -2 \\ -2 \end{bmatrix}

This is scalar multiplication and vector subtraction composed: scale v1v_1 by 22, then subtract v2v_2.

Problem 4: 3D Dot Product (Mixed Weights) Calculate the dot product wxw \cdot x where w=[2.01.50.5]w = \begin{bmatrix} 2.0 \\ -1.5 \\ 0.5 \end{bmatrix} and x=[3.02.04.0]x = \begin{bmatrix} 3.0 \\ 2.0 \\ 4.0 \end{bmatrix}.

Reveal Solution

wx=(2.0)(3.0)+(1.5)(2.0)+(0.5)(4.0)=6.03.0+2.0=5.0w \cdot x = (2.0)(3.0) + (-1.5)(2.0) + (0.5)(4.0) = 6.0 - 3.0 + 2.0 = \mathbf{5.0}

Problem 5: The "Zero Weight" Impact Calculate wxw \cdot x where w=[000]w = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} and x=[100500999]x = \begin{bmatrix} 100 \\ 500 \\ 999 \end{bmatrix}.

Reveal Solution

wx=(0)(100)+(0)(500)+(0)(999)=0+0+0=0w \cdot x = (0)(100) + (0)(500) + (0)(999) = 0 + 0 + 0 = \mathbf{0}

No matter how large a feature's measurement is, a weight of exactly 00 erases its influence on the score completely.


Part 2: Applied Scenario: The VC Greenlight Decision

Imagine you are building an AI decision model for a Venture Capital firm. The firm receives hundreds of startup pitches each week and wants to predict which startup pitch to greenlight based on its Unicorn Potential (whether a startup has the potential to become a billion-dollar company or fail).

First, the algorithm loads the firm's Unicorn Potential Weights (ww) across four locked criteria: [Team Experience, Market Size, Competition, Risk]. This represents what the VC firm believes indicates a massive outcome, which directly influences whether a pitch gets greenlit or passed:

w=[4.02.03.01.0](Team Experience Weight)(Market Size Weight)(Competition Weight)(Risk Weight)w = \begin{bmatrix} 4.0 \\ 2.0 \\ -3.0 \\ 1.0 \end{bmatrix} \begin{matrix} \text{(Team Experience Weight)} \\ \text{(Market Size Weight)} \\ \text{(Competition Weight)} \\ \text{(Risk Weight)} \end{matrix}

The partners heavily value a proven Team (+4.0+4.0) and a massive Market (+2.0+2.0). They strongly penalize crowded Competition (3.0-3.0), and maintain a mild appetite for high-upside Risk (+1.0+1.0).

Now, two startups submit their pitch decks:

  • OmniFlow (The Hyped Veteran Pitch): Team Experience 1.01.0 (repeat founders), Market Size 0.30.3 (small enterprise niche), Competition 1.01.0 (crowded market), Risk 0.20.2 (safe, conventional product).
  • Solaris AI (The Scrappy Moonshot): Team Experience 0.30.3 (first-time founders), Market Size 1.01.0 (massive untapped market), Competition 0.00.0 (no direct rivals), Risk 0.80.8 (high technical risk).

Problem 6: Two Pitches, One Decision

Part A: Encode both pitches into feature vectors, xOmniFlowx_{\text{OmniFlow}} and xSolarisx_{\text{Solaris}}, respecting the locked position order above.

Part B: Calculate the raw Dot Product score (wxw \cdot x) for each startup.

Part C: In one sentence, which startup does the firm's Unicorn Potential model favor, and which single feature is doing the most damage to the weaker pitch?

Reveal Solution

Part A: xOmniFlow=[1.00.31.00.2]xSolaris=[0.31.00.00.8]x_{\text{OmniFlow}} = \begin{bmatrix} 1.0 \\ 0.3 \\ 1.0 \\ 0.2 \end{bmatrix} \qquad x_{\text{Solaris}} = \begin{bmatrix} 0.3 \\ 1.0 \\ 0.0 \\ 0.8 \end{bmatrix}

Part B: wxOmniFlow=(4.0)(1.0)+(2.0)(0.3)+(3.0)(1.0)+(1.0)(0.2)=4.0+0.63.0+0.2=1.8w \cdot x_{\text{OmniFlow}} = (4.0)(1.0) + (2.0)(0.3) + (-3.0)(1.0) + (1.0)(0.2) = 4.0 + 0.6 - 3.0 + 0.2 = \mathbf{1.8} wxSolaris=(4.0)(0.3)+(2.0)(1.0)+(3.0)(0.0)+(1.0)(0.8)=1.2+2.0+0.0+0.8=4.0w \cdot x_{\text{Solaris}} = (4.0)(0.3) + (2.0)(1.0) + (-3.0)(0.0) + (1.0)(0.8) = 1.2 + 2.0 + 0.0 + 0.8 = \mathbf{4.0}

To visually verify how each term contributes to the final scores, examine the computational dataflow below:

VC Greenlight Decision Flow Diagram
Comparative dataflow for the VC Greenlight model: Although OmniFlow scores high on Team Experience ($+4.0$), the intense Competition penalty ($-3.0$) pulls its raw score down to $+1.8$. Solaris AI wins the greenlight ($+4.0$) thanks to zero competition and a massive market.

Part C: The Unicorn Potential model favors the scrappy moonshot Solaris AI (4.04.0 vs. 1.81.8). While human investors might be dazzled by OmniFlow's repeat-founder team (+4.0+4.0), the model exposes that intense Competition (1.0×3.0=3.01.0 \times -3.0 = -3.0) drastically drags down its potential to return venture-scale returns.

Just like the Netflix scores of +9.5+9.5 and 1.5-1.5, these are raw linear scores, not final funding decisions — they still need a Bias and an Activation Function (Topic 2) before they become clean, comparable probabilities.