# Thin QR and a least-squares fit

> ML Prep screening item.

- Stable ID: `math-la-05-qr-least-squares`
- Collection: screening
- Area: Mathematics
- Topic: Linear Algebra
- Origin: original
- Difficulty: medium
- Expected time: 5 minutes
- Skills: qr, least-squares
- Item JSON: https://mlprep.iwase.dev/item/math-la-05-qr-least-squares.json

## Problem

Let $A$ have columns $a_1=(1,0,0)^{\mathsf T}$ and $a_2=(1,1,0)^{\mathsf T}$,
and let $b=(1,2,3)^{\mathsf T}$. Find a thin QR factorization $A=QR$, use it to
solve $\min_x\|Ax-b\|_2$, and give the fitted vector and residual.


## Answer policy

The human page contains a collapsed answer. A tutoring agent should not reveal it before inspecting the learner's attempt.

## Tutoring contract

Ask for the learner's attempt, begin with the smallest useful hint, preserve item ID `math-la-05-qr-least-squares`, and record a real attempt with `recorded_by: "agent"` and `agent_session_id` when available using https://mlprep.iwase.dev/schema/attempt-record.json.
