Live data from Hacker News

A Programmer's Introduction to Mathematics

jeremykun.com

131–140 of 223 posts

Re: A Programmer's Introduction to Mathematics

#131
post #78

I really wish this book would include probability and statistic sections. My guess is that a lot of people, like me, will want to read it because they're getting started with ML and need help getting used to the math, and probability/stats is an important part of it that's missing. Any chance you could add it in the future?

Well, two chapters have singular value decomposition and neural networks as the applications. So it does have a lot of ML :) But yes, I unfortunately had to cut a probability chapter. I think someone who reads this book would have a much easier time learning probability after, and a better foundation.

Thank you for this book. There is a huge need for this.

It saddens me that schools may be handing out CS degrees without having first required students to at least have taken linear algebra, multivariable calculus, and discrete math that covers basic counting, sets, graphs and groups. How can this be?

Probability and statistics should also be a required part of every CS program.

Re: A Programmer's Introduction to Mathematics

#132
I was teaching a college class for high schoolers last year and thought it would be great to record my lectures for them. Then I put it up as an entire youtube channel for everyone:

https://m.youtube.com/channel/UCuge8p-oYsKSU0rDMy7jJlA

It basically builds up mathematics rigorously from basic definitions, while trying to stay very accessible.

If anyone has the time, or desire to learn math this way, let me know what you think, and if I should make more in this series!

Re: A Programmer's Introduction to Mathematics

#133
post #91

Do the exercises have solutions? The most annoying things about math books is the lack of solutions. A beginner absolutely needs to know whether or not their solutions are correct. The “the reader should know if they are correct” logic doesn’t apply here. A beginner could easily have faulty logic and fool themselves into thinking their solutions are correct. I usually don’t buy math books without solutions if I’m sel…

> The most annoying things about math books is the lack of solutions. To me the most annoying thing about math books is hand-waving, lack of rigor, and unexplained notation. At least in programming, everything is formal and I can figure out the entire problem by looking at the source.

Sentences like "It similarly follows that..." , "It is left as an exercise to the reader to show that..." , "Clearly, ..." always leave me dumbfounded.

Re: A Programmer's Introduction to Mathematics

#134
post #91

Do the exercises have solutions? The most annoying things about math books is the lack of solutions. A beginner absolutely needs to know whether or not their solutions are correct. The “the reader should know if they are correct” logic doesn’t apply here. A beginner could easily have faulty logic and fool themselves into thinking their solutions are correct. I usually don’t buy math books without solutions if I’m sel…

> The most annoying things about math books is the lack of solutions. To me the most annoying thing about math books is hand-waving, lack of rigor, and unexplained notation. At least in programming, everything is formal and I can figure out the entire problem by looking at the source.

I'm reading Calculus, Multivariable from William L. Briggs (amazon link: shorturl.at/ltGVY) ; it has the answers at the back of the book ; I'm quiet happy about it for someone who always sucked in maths. If anybody has books to share, i'm especialy interested in linear algebra and signal processing

Re: A Programmer's Introduction to Mathematics

#135

Earlier quoted context omitted.

But at least all imperative procedural steps are clearly understandable from source code given in many programming books. Where as maths books routinely leave out many steps in proofs and calculations, on top of many ambiguously used notations and terminology that can leave a self-student confused.

A program proves nothing at all so I am not sure what you can understand from it? Typically in programming you are presented with a piece of code, a statement that this piece of code solves a specific problem and then a proof of that it actually works. Those proofs are typically far from understandable or rigorous.

But programs are proofs!

At least in the light of the Curry–Howard correspondence. :)

Anyways, I do agree that in programming it’s easier to see what are introductions, assumptions, definitions, functions, values etc. You can’t just invent a notation and go with it. Everything needs to be defined from the ground up. It’s constructive and I like that, probably because I’m a programmer.

Re: A Programmer's Introduction to Mathematics

#136

I’ve found myself unable to do even elementary maths recently just because I’m sorely out of practice. Hasn’t really affected my performance as a programmer. Wondering, what kind of math I could learn that would benefit me in my job?

> Wondering, what kind of math I could learn that would benefit me in my job

It depends on what you want to do. I’ll get to your question in a bit, but I think this passage from the book on page (i) describes why you might want to learn mathematics.

> So why would someone like you want to engage with mathematics? Many software engineers, especially the sort who like to push the limits of what can be done with programs, eventually come to realize a deep truth: mathematics unlocks a lot of cool new programs. These are truly novel programs. They would simply be impossible to write (if not inconceivable!) without mathematics. That includes programs in this book about cryptography, data science, and art, but also to many revolutionary technologies in industry, such as signal processing, compression, ranking, optimization, and artificial intelligence. As importantly, a wealth of opportunity makes programming more fun! To quote Randall Munroe in his XKCD comic Forgot Algebra [0], “The only things you HAVE to know are how to make enough of a living to stay alive and how to get your taxes done. All the fun parts of life are optional.” If you want your career to grow beyond shuffling data around to meet arbitrary business goals, you should learn the tools that enable you to write programs that captivate and delight you. Mathematics is one of those tools.

You should never feel like a lesser programmer, because you don’t know mathematics it’s just something that might make things a little more interesting and fun while adding some value. Of course it’s not always fun for everyone, so let yourself decide if it’s for you. Mathematics can create value for a programmer in a lot of different ways like as stated above, but yet again people should not feel belittled not having this knowledge because there are many other ways you can add value to your job as a programmer without mathematics.

With that said, I’ll give you a list of programming topics below that are enabled by mathematics and what kind of mathematics can help with those topics. If you’re not needing to study any of these topics or needing to use them in your daily job I think one of the most useful and fun types of mathematics is discrete math for everyday programming. This can build foundations of logic and reasoning needed for programming. Someone else already mentioned the mathematics for computer science course from MIT [9] in this thread and that’s a great intro to discrete though it can be pretty challenging at times especially if you’re new to the topic.

Programming Topic - Math Topics to Study

cryptography - number theory, abstract algebra, probability, basic combinatorics, information theory and asymptotic analysis of algorithms [1]

data science - Linear algebra, Regression techniques, Probability theory, Numerical analysis [2]

art/computer graphics - geometry, linear-algebra, physics-based calculus, topology and numerical methods [3]

signal processing: Fourier transforms, Laplace transforms, differential equations, statistics, linear algebra, and complex analysis [4]

Data structures and algorithms: mostly discrete math (set theory, logic, combinatorics, number theory, graph theory, formal proofs), asymptotic notation.

compression: Information theory, statistics, probability, linear algebra [5]

ranking: statistics, markov chains (think PageRank), probability, linear-algebra [6]

optimization: numerical analysis, computational geometry, discrete mathematics, probability, linear-algebra, calculus [7]

artificial intelligence: discrete math, statistics, analysis, linear-algebra [8]

[0] see the hover over: https://www.xkcd.com/1050/

[1]: https://crypto.stackexchange.com/a/10468

[2]: https://www.datascienceweekly.org/articles/how-much-math-sta...

[3]: https://math.stackexchange.com/questions/830856/how-is-math-...

[4]: https://www.reddit.com/r/ECE/comments/4i7jq9/what_math_will_...

[5]: https://en.wikipedia.org/wiki/Data_compression#Theory

[6]: https://en.wikipedia.org/wiki/Learning_to_rank

[7]: https://en.wikipedia.org/wiki/Mathematical_optimization

[8]: https://math.stackexchange.com/questions/791326/what-maths-a...

[9]: https://ocw.mit.edu/courses/electrical-engineering-and-compu...

Re: A Programmer's Introduction to Mathematics

#137
post #6

It's good to have something that lowers the bar for programmers so they could learn themselves some math without much fear. Knowing math is very important if you are a coder - and not just linear algebra: knowing a formula, for example, might let you do certain things in constant rather than linear time or, perhaps, reduce the cost of the iteration. Unfortunately, too many of those who can call themselves programmers…

I'm sorry if this isn't your intent but the way you structured your comment comes off as very condescending. Aside from that, I'm also skeptical that the frequency in which these maths apply to practical, commercial programming is really that high. Im not anti math or something. I just think the practical value gets way over sold by some people. And sometimes it feels like it's because of the dislike of "those who ca…

It is an incredibly important foundation for analyzing any kind of data. That is a need that crosses many different fields, be it sales forecasting, quantitative finance, econometrics, deep learning, signal processing, any sort of scientific computing etc.

I would be more interested in hearing an argument about why math knowledge is not useful or lucrative.

Re: A Programmer's Introduction to Mathematics

#138

Does it compare to Don Knuth, et al, "Concrete Mathematics: A foundation for Computer Science"?

It might have some crossover, but my guess is it's probably much more introductory than that book. I didn't know this until fairly recently, but Concrete Mathematics was used in a Graduate level course at Stanford as the textbook (with the course name following the book's, Concrete Mathematics). Kind of threw me off when I first found out, because the book says it's a foundation for computer science, so I thought it would be an undergraduate course. So, I don't think you need to be a graduate student or in particular a Stanford level computer science graduate student to read Jeremy Kun's book.

Re: A Programmer's Introduction to Mathematics

#139
I have a genuine question which might sound dumb but I really do wonder.

How do you actually read math, physics and programming books?

Reading them the same way as you'd read a novel doesn't seem right. I try to go chapter after chapter and make notes but I often get bored because I don't see the usage in my real life coding. Maybe I'm not working on problems that are challenging enough? Also after few chapters it often turns into a "job" of finishing the book. I don't have the pleasure of learning new stuff anymore.

Do you really finish such books? What am I doing wrong?

Re: A Programmer's Introduction to Mathematics

#140
post #139

I have a genuine question which might sound dumb but I really do wonder. How do you actually read math, physics and programming books? Reading them the same way as you'd read a novel doesn't seem right. I try to go chapter after chapter and make notes but I often get bored because I don't see the usage in my real life coding. Maybe I'm not working on problems that are challenging enough? Also after few chapters it of…

Depends how they're written. Some are written to be read cover-to-cover, whereas others are references that you dip into as you need.

If you're getting bored because you're reading something that's not relevant to what you're doing, skim over it instead and make a mental note of what the content covers so you'll know what you have available to you should the topic come up later.

Post reply on HN