Sitemap
Data Science Collective

Advice, insights, and ideas from the Medium data science community

Member-only story

Systems Of Linear Equations And Gaussian Elimination

What “Singular Matrix” Really Means, Explained With a Daily Commute

Least squares explained with twenty noisy receipts. See how fitting a line becomes a small linear system, and how a lost dwarf planet started it all.

20 min readOct 20, 2026

--

Open your email and search for “your ride receipt.” You’ll find a little pile. Same app, same city, prices all over the place, and one from 1:14 am with a tip of exactly 40 cents that you have no memory of leaving.

Free reading link here

That pile is hiding a secret. Most ride apps work out a fare the same way, a starting fee plus a price per kilometre plus a price per minute. So three receipts give you three equations with three unknown prices, and if you solve them, you’ve worked out the app’s pricing.

Python does it in one line.

Try the same trick on a month of commute receipts, though, and numpy, the maths library behind most Python data work, stops with two words. Singular matrix. Ask two other popular libraries and they don’t complain at all. They each hand back an answer, the answers don’t match, and neither one mentions the other exists. Keep that in mind, because we’re coming back for it.

Press enter or click to view image in full size
Student detective pinning three ride receipts to a corkboard with red string, decoding app fares by solving linear equations
Every detective story needs a corkboard, and this one is about a $9.10 ride

--

--

I write about machine learning, deep learning, and statistics with Python, making complex ideas ridiculously clear.

Data Science Collective
Data Science Collective

Published in Data Science Collective

Advice, insights, and ideas from the Medium data science community