
Coding the Matrix
by Philip N. Klein · first published 2013
54mentions
31recommended by
41HN commenters
2013–2026first – last mentioned
76% recommend22% neutral2% critical
Why HN recommends it
Teaches linear algebra through Python programming and real CS applications like image processing, so concepts show up in code early. Suits programmers who want practical motivation behind the math.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.







…Axler's book, someone else brings up Treil's book. But there's a third one in the same league/group which is Linear Algebra: An Introduction to Abstract Mathematics by Robert Valenza[3]. Other favorites are Coding the Matrix by Philip Klein[4] for Python aficionados and Linear Algebra Through Geometry by Banchoff/Wermer[5] for those who like geometry. If you are way beyond all this, you can still pick up new things from…
on “The best linear algebra books” ↗…Christmas Tree Lectures, to be incredibly informative and inspirational [1]. Another area of math that you need to know for C.S. related activities is linear algebra. To get started I'd recommend reading 'Coding the Matrix' by Phillip Klein. [1] => https://www.youtube.com/playlist?list=PLoROMvodv4rNMsVRnSJ44...
on “Ask HN: How or where to begin learning mathematics from first principles?” ↗The texts that I hate least (LA and I have a long and rocky relationship): - Coding the Matrix, Klein https://www.amazon.com/Coding-Matrix-Algebra-Applications-Co... This has a strong emphasis on LA's utility in CS, and includes concepts outside traditional LA that enrich the narrative. - Intro…
on “The most mentioned books on Stack Overflow” ↗…"Intro to Programming". I started to write a library implementing Gilbert Strang's Linear Algebra book assuming nothing but core Python. What inspired me to do that was reading Philip N. Klein's book "Coding the Matrix". I thought writing a LA library for fun and study purposes makes sense if you want to go on and study data science. However, that project is not yet ready to be published. Would that be what you are…
on “Show HN: Intro to Python and Programming for non-CS majors” ↗Well, I suppose I might want to try something like Coding the Matrix: Linear Algebra through Applications to Computer Science, or a book on games programming -- if I was trying to interest the kid in math and CS subjects. For fiction, it's damned hard to say. My own…
on “What Would You Recommend to a Bright 14 Year Old?” ↗Seconding Klein's Coding the Matrix. It's a great alternative introduction and actually implementing linear algebra ideas in Python is both useful and a great aid for learning. The auto-grader is helpful for making sure you got the right…
on “The best linear algebra books” ↗Coding the Matrix: Linear Algebra through Applications to Computer Science for more theoretical I'm planning to read: Vector Calculus, Linear Algebra, and Differential Forms: A Unified Approach
on “Ask HN: What's your favourite book to understand linear algebra for CS?” ↗…mathematical perspective (versus engineering/applied science), there's Axler's Linear Algebra Done Right. For the programmers in the audience, another fun and illuminating (and cheap!) text is Klein's Coding the Matrix.
on “So You Want to Learn Physics” ↗For the math: MIT OCW Scholar and maybe Klein's Coding the Matrix. For AI specifically, MOOCS on Coursera, edx, and Udacity will give you plenty of options. The ones by big names like Thrun, Norvig, and Ng are great places to start. It really helps to already be comfortable…
on “Ask HN: What free resources did you use to learn how to program ML/AI?” ↗Regarding linear algebra, I highly recommend Klein's Coding the Matrix which uses Python to teach linear algebra. I believe it was developed for Brown's linear algebra course for CS undergrads.
on “Ask HN: Best way to get started with AI?” ↗Coding the Matrix: Linear Algebra through Applications to Computer Science [0] A hands on introduction to both Python and Linear Algebra using real world cases (ex. you are given a high res image, make a low res version…
on “Ask HN: What's the best textbook you've read?” ↗3blue1brown on Linear Algebra: https://www.youtube.com/watch?v=fNk_zzaMoSs&list=PLZHQObOWTQ... Gilbert Strang - Linear Algebra: https://www.youtube.com/playlist?list=PLE7DDD91010BC51F8 Coding The Matrix: https://cs.brown.edu/video/channels/coding-matrix-fall-2014/ Other: https://hn.algolia.com/?query=%22linear%20algebra%22&sort=by...
on “Ask HN: Linear algebra textbooks” ↗If you want to learn LA by coding, coding the matrix by philip klein is a really good book. He even has his Coursera lecture videos (not available on coursera anymore last I checked) up on his website.
on “A 2020 Vision of Linear Algebra” ↗…to the DFT by Julius Smith * Introduction to Digital Filters by Julius Smith * Physical Audio Signal Processing by Julius Smith also a couple not directly about audio but helpful for the domain: * Coding the Matrix by Philip Klein * Accelerated C++ by Andrew Koenig and Barbara Moo Hope someone gets some value from these - have fun!
on “Ask HN: How to get started with audio programming?” ↗Coding the Matrix
on “Ask HN: Best beginner friendly linear algebra book?” ↗