Ask HN: How or where to begin learning mathematics from first principles?

345 points by smtucker ↗ HN
A little bit of background:

As I've become more skilled with programming and electronics I have felt myself begin to near a wall. My knowledge of and skills in math is relatively poor and all the interesting things that make up the more advanced programming and electronics pursuits seem to be heavily based on math.

When I butt heads with these more advanced topics I find I resort to scouring the internet to cobble together pieces of various tutorials and guides. While it does feel good in a way to hack together limited understandings to make satisfactory solutions I'm beginning to feel less like a hacker and more like a hack. The knowledge I gain is shallow and I don't think my tactics will get me much further.

Instead of working backwards from implementation I would like to start from the beginning and learn math the proper way. Unfortunately most of the resources I find online seem to more focused on teaching me how to solve math problems. I have no interest in solving specific math problems on a test, I'm not going to school and I doubt I will ever take a math test again in my life. I want to work up from first principles and gain the tools to reason about the world mathematically and understand the cool things that are currently out of my reach like antenna design, machine learning, electromagnetism, cryptography etc.

Unfortunately I so know so little I have no idea how where to start. What websites are helpful, what books I should buy, etc. I was hoping someone here could share. Thank you.

128 comments

[ 6.3 ms ] story [ 213 ms ] thread
I'm in a not too different situation from yourself as a self taught developer. I spent about 6 months and taught myself most of the mathematics concepts I forgot or never tried hard enough to learn from the Khan Academy. Their mathematics tutorials are excellent.

http://khanacademy.org

Try http://www.khanacademy.org (free), their math series starts from basic arithmetic and walks all the way through to undergrad-level mathematics.

I personally preferred khanacademy to my math teaching at school and it's been handy during my degree.

For more advanced stuff i've found Stanford's online courses (https://www.youtube.com/user/StanfordUniversity/playlists) and MIT OpenCourseWare (http://ocw.mit.edu/index.htm) to have the best material for Physics

I second this and would strongly advise this approach.

The courses available on Khan Academy help you visualize the math and gain a better understanding on the 'why' (reasoning) while also teaching you the 'how' (application).

There's sufficient math courses available to teach you everything from pre/primary school arithmetic to first year university/college level calculus/linear algebra.

I hope that their math section is better than some of their engineering courses. See the critique at,

http://www.leancrew.com/all-this/2012/12/khan/

I've also been involved in teaching similar material as Dr. Drang and agree completely with his critique.

I've come across students who've had similar sloppy teaching and had to re-teach material so they could unlearn what they'd learnt and get a proper foundation for moving forward. Consistently, they would have very poor assignments for the first few weeks until they had that foundation.

"This course covers elementary discrete mathematics for computer science and engineering. It emphasizes mathematical definitions and proofs as well as applicable methods. Topics include formal logic notation, proof methods; induction, well-ordering; sets, relations; elementary graph theory; integer congruences; asymptotic notation and growth of functions; permutations and combinations, counting principles; discrete probability. Further selected topics may also be covered, such as recursive definition and structural induction; state machines and invariants; recurrences; generating functions.:

http://ocw.mit.edu/courses/electrical-engineering-and-comput...

There is some distance from this to antenna design, electromagnetism, etc, but I think you have to be fluent in proofs to actually follow along on those. Math is a big subject; ymmv.

A Transition to Advanced Mathematics by Douglas Smith (Author), Maurice Eggen (Author), Richard St. Andre (Author)

ISBN-13: 978-0495562023 ISBN-10: 0495562025 Edition: 7th

It shows up on Abebooks which could help with the price. It's a small book, exceedingly well-crafted and worth every nickel.

>There is some distance from this to antenna design, electromagnetism, etc, but I think you have to be fluent in proofs to actually follow along on those. Math is a big subject; ymmv.

I'm only 20 years old and hopefully I have a long life ahead of me so I'm not too worried about how long it takes, I just want to get on the right track.

Thank you on the book recommendation, that looks like it is exactly the type of resource I was looking for!

Mathematics: Its Content, Methods and Meaning by Aleksandrov, Kolmogorov, and Lavrent'ev

http://www.amazon.com/Mathematics-Content-Methods-Meaning-Do...

Covers something like three years of an undergraduate degree in mathematics. Lots of words - but that text is used to develop an understanding of the concepts and images. Considered a masterpiece. An enjoyable read.

Very similar question: http://www.reddit.com/r/compsci/comments/2notz5/how_do_you_p...

(with a good answers regarding Khan Academy, Polya "How to Prove", lamar.edu, math.stackexchange.com, universityofreddit.com, lots of online curriculums from different universities, curricula aimed at data science (Prob/stats, linear algebra, calculus). These're good listings of resources for precalc and for data science:

http://www.reddit.com/r/math/comments/2mkmk0/a_compilation_o...

http://www.reddit.com/r/MachineLearning/comments/1jeawf/mach...

http://www.zipfianacademy.com/blog/post/46864003608/a-practi...

______________

The threshold question are,

- can you locate like minded folks to bootstrap a study group, or tutor(s) who are willing to devote time?

- (if you're in US/Canada) how about community colleges by you, in a lot of places they're still well funded and will efficiently pull you up to first year college calculus and linear algebra, and maybe further

- What level of high school / college math did you last attain, because reviewing to that level shouldn't be too stressful. At least, in my very biased view of math education.

you can visit http://functionspace.org or Khanacademy.org both side provide amazing stuff like video lectures, materials, articles etc for all level starting from very beginner to advance to Experts. Good luck :)
I got started on "real" math with Spivak's Calculus. Some people start with Topology by Munkres, which is not a difficult book but is very abstract and rigorous so makes a good introduction. If you feel like you have ok calculus chops, maybe Real Mathematical Analysis by Charles Pugh. Other good books are Linear Algebra Done Right by Axler, or the linear algebra book by Friedberg, Insel, and Spence. Maybe even learn linear algebra first. It's so useful.

Do plenty of exercises in every chapter, and read carefully. Count on about an hour per page (no joke). Plenty of math courses have their problem sets published, so you can google a course which uses your chosen book and just do the exercises they were assigned.

If you don't feel comfortable with basic algebra and other high school math, there's Khan Academy, and some books sold to homeschoolers called Saxon Math.

If you haven't had a course in calculus before, maybe you should skim a more intuitive book before or alongside reading Spivak. I don't know of any firsthand, but I heard Calculus for the Practical Man is good. Scans are freely available online (actually, of all these books) and Feynman famously learned calculus from it when he was 12.

OP wants it from first principles as their maths is "poor" . I don't think Spivak is a good choice to jump right into calculus.

If OP wanted a more softer approach, Spivak's Hitchhiker's Guide to Calculus is probably a better option first before going full Spivak.

I honestly couldn't tell what he meant, whether he had stumbled through calc 3 and gotten sick of memorizing arbitrary rules, or if he can't solve a quadratic.

I tried to include some good high-school level math resources.

Do any of those resources actually cover math from 'first principles'?
(comment deleted)
I'd start with Discrete Mathematics before Spivak. From what I remember, Spivak jumps in to constructing the reals out of set theory pretty quickly.

A discrete math text will drill you over a lot more basic proofs involving set theory that would help in understanding his construction.

Construction of the reals is in an appendix at the back. He starts with ordered field axioms.

Frankly there's something about the presentation in "discrete math" books that I find much more confusing and difficult than Spivak, which is just talking logically about numbers and their properties.

There are also some very good books by Israel Gelfand, written for a high-school level. Titles are Algebra, Trigonometry, The Method of Coordinates, etc. All by Gelfand and one other author. Sort of unusual because they are basic books written by one of the greatest mathematicians of the 20th century.
here I also found this website http://codingmath.com where they only teaches you math and how to apply it to program i found it very interesting. you should give it a try too.
This is a bit of a divergence, but a fun way to practice what you learn is Project Euler, which will link it to your programming. https://projecteuler.net/ It's more of an applied problem set of increasing difficulty than learning from first principles though.
Do you suggest finding a closed solution for every problem?
I had the same problem with math. There are two books which changed my mindset forever:

http://en.wikipedia.org/wiki/What_Is_Mathematics%3F

http://en.wikipedia.org/wiki/Concrete_Mathematics

The first one is the general book about math. It's a classical book.

The second one is Donald Knuth's book written specifically for computer science guys.

Does Concrete Mathematics have any practical applications? and by practical, I mean, can you use the knowledge there to learn more math?

I have the impression that it is mostly a book that teaches you techniques of how to solve recurrences. Am I wrong?

It's not just about recurrences. Although, It looks like this at the first glance. This book will give you mathematical mindset which you will be able to apply in practice (while working with algorithms).

Each chapter in the book is written in essay style, authors gave you very curious math pearls, and teach you how to think by using these examples.

Concrete Mathematics is essentially the mathematics needed to study analysis of algorithms. From the preface:

  One of the present authors had embarked on a series of books called
  The Art of Computer Programming, and in writing the first volume he
  (DEK) had found that there were mathematical tools missing from his
  repertoire; the mathematics he needed for a thorough, well-grounded
  understanding of computer programs was quite different from what he'd
  learned as a mathematics major in college. So he introduced a new
  course, teaching what he wished somebody had taught him.
So yes, there are practical applications. And recurrences are a recurring theme, but there's more to it than just that.
Betterexplained.com has many very good intuitive explanations of mathematical concepts. Elements by the publishers of Dragonbox will give you reasonable intuition for geometry. If you just want to use calculus Silvanus P. Thom(p?)son's Calculus Made Easy is excellent. Linear Algebra Done Right and LAD Wrong are both good books. LADW is free, legally.

The Art of Problem Solving series of books are uniformly excellent.

First principles? You're not going to beat:

  http://en.wikipedia.org/wiki/Naive_Set_Theory_(book)
It starts with defining what a set is, then builds up from there while being completely contained. No knowledge is assumed and could be enjoyed by someone with high school maths.
For those whore are still in University, consider taking a proof-based calculus course, the methods and rigor you learn there will help you learn more. The same can be said for a proof based linear algebra course, which for programmers is even more useful.
On where to start => I'd start by getting a very solid grasp of graph theory. It is the bedrock of many algorithms and along the way you'll learn all kinds of useful mathematical notation, but in a way that should be easier for you to pick up than plain old 'pure-math.' I've found the following series of videos presented by Donald Knuth, aka The 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...

If he's looking for a more of an actual first principles approach to linear algebra, I could not recommend starting with Linear Algebra Done Right by Sheldon Axler enough.

It starts from a few basics which most people would be comfortable with post calculus, and builds up to the most important theorems in linear algebra. It's probably not the book for you if you are actually interested in linear algebra algorithms.

I was in a very similar situation. The thing that helped me the most was getting an understanding of what it is mathematicians are trying to do and what their methods are. "What is Mathematics?" ended up being pretty pivotal (as another poster mentioned), though the topics did seem pretty random to me when going through it at first. The introductory material to "The Princeton Companion to Mathematics" is an excellent compass for orienting yourself. That introductory portion is about 120 pages, though it's a huge book (well over 1000 pages) and the rest of it probably won't be too useful to you for a while (but at the same time, those intro essays were invaluable). I'd second Axler's "Linear Algebra Done Right" as a nice early (yet pretty serious, despite the title) book. Linear algebra is used all over the place, and the way it's addressed in that book you'll learn something about creating mathematical systems rather than merely how to use some existing system. It also helped me understand what's interesting and why in mathematics to read in philosophy of mathematics and math history, and popularizations, etc. "Men of Mathematics" is quite good, as are "Gödel's Proof" and "Mathematics and the Imagination."

Once I was immersed in it for a while, I started getting into more CS related mathematics: things in computation theory, programming language theory, category theory--and I would spend a lot of time reading networks of wikipedia math articles from basically random starting points inspired by something I read. Didn't understand much to start with, but I'm glad I did it and I find them indispensable now.

I think it's of the utmost importance to go into it with an understanding that you SHOULD feel lost and confused for quite a while--but trust in your mind to sort it out with a little persistence, and things will start coming together. If you find yourself avoiding math, finding it unpleasant and something you 'just can't do,' check out Carol Dweck's 'Self-Theories.' Good luck!

I wanted to give some recommendations before I hijacked your thread with my own question but I was going to suggest What is Mathematics, How to Prove it and Naive Set Theory which have already have been mentioned.

I'm actually in a related situation in which I'm competent in analysis (bachelors in physics) but I struggle with all the category theory inspired design patterns in functional programming.

Every book/article I've tried to read is either far too mathematical and so is disconnected from programming or is too close to programming and lacking in general foundations (ie: a monad is a burrito).

I would greatly appreciate any suggestions!

I came here to suggest the same thing. I started with real analysis but realized that I was lacking the mathematical maturity to understand things back to first principles. My suggestion is to start with learning how the foundations of mathematics were rebuilt starting from axiomatic principles in the last part of the 19th century and early 20th century.

The book How to Prove It helped me tremendously. Get a good book on abstract algebra. Maybe start with Herstein, then progress to Dummit and Foote and, maybe eventually, to Hungerford. This is the kind of math that will help you reason about data sets. It's foundational in mathematics and it also happens to be very applicable to computer science.

After that, you will have a strong basis for branching out to more specialized branches of mathematics that may have more relevance to the types of problems that you're solving.

That is excellent advice. If the student is struggling to write proofs in her or his real analysis text, s/eh should definitely seek out "How to Prove It".
What language specifically are you looking at monads in? If it's anything other than haskell, I can give advice, having recently had the concept click, and gone through similar frustrations.
That would be awesome, I'm using Scala and I would like to incorporate more scalaz into my programming but I have yet to find information convincing me how to go from math concept to implemented functional design pattern.
How To Prove It is definitely the best (it's the only I read till now though, apart from online tutorials and course notes) book on how to learn on your own. Especially since it details the thought process on how to prove something, has around 20 questions per subsection with answers (especially this is great)!

Another book that I think is great is 'Getallen: van natuurlijk naar imaginair', but its in Dutch.

Other people have given very good suggestions. But just mention that there is not any first principles for mathematics, that is an active area for research for pure math.

There are a lot of layers of mathematics, the deeper you get, the more difficult it becomes. But for normal applications (like antenna design, machine learning, electromagnetism, cryptography etc), you don't need to get to the deepest level, which are mostly proofs for a formulation of the whole mathematics framework.

"Read Euler, read Euler, he is the master of us all." - Pierre-Simon Laplace

Seriously though, 'Euler: The Master of Us All' by William Dunham was the book that got it going for me. Good mix of history, narrative and mathematics. Really great read.

As an aside, it's absolutely fascinating to learn how much we don't know about maths.