What kind of math is used in computer programming?
While programming itself doesn’t need the programmer actually to engage in hard mathematics, there are quite a few different branches of math included in the essence of computer programming.
Basic programming math, algebra, and trigonometry are the most common strains of math for programming. However, it is recommended that you are familiar with concepts more than hard mathematics. Knowing probability, propositional logic, and proofs will be extremely helpful for math programming.
Math Books for Programmers
These books will educate you further in math programming and mathematical concepts in general:
1. Math For Programmers by Paul Orland
This more recent book is filled with fantastic exercises, examples, and helpful math designs to help you net a career in programming.
Orland’s book focuses on exactly what you need to be a successful programmer, data scientist, and machine learning.
2. Mathematics for Machine Learning by Marc Peter Deisenroth
This book is geared towards introducing the reader to what mathematical functions are essential to getting the hang of machine learning. These include calculus, algebra, and analytic geometry.
This book aims to more easily blend different flavors of mathematics into one to teach a programmer or computer science student better the basics of machine learning.
“Brilliant and Precise” – 5/5 Rating
“The explanations are clear, and the book is designed to bring clarity and lucidity onto the topics, not send the student on an endless pit of proofs and rigor.”
3. A Programmer’s Guide to Computer Science: A Virtual Degree for the Self-Taught Developer by Dr. William M Springer II
Dr. Springer sets out to ensure the reader knows their basic math for programming and computer science. You’ll get a crash course in some of the most critical topics, including graphs, problem-solving, complexity theory, and graphs.
“An excellent starting point for the working programmer” – 4/5 Rating
“It is not comprehensive and it is not meant to be. But it does accomplish its mission well and serves as a nice introduction to a variety of useful topics.”
4. Grokking Algorithms: An Illustrated Guide for Programmers and Other Curious People by Aditya Bhargava
This more casual and lighthearted guide will be great for visual learners out there. It sets out to easily convey common problems in programming and how to solve them. This, of course, includes a healthy dash of discrete mathematics.
Through over 400 drawings of detailed walkthroughs, you will be better at math programming by the end.
“Visual learners start here” – 5/5 Rating
“This is by far the best introduction to algorithms out there, especially if you have not encountered them before. If you want to learn the basics and learn them well, start here. After you read this book you’ll be ready for the more dense ones.”
5. Doing Math with Python: Use Programming to Explore Algebra, Statistics, Calculus, and More! By Amit Saha
This is the perfect starting point for those who want to explore the kind of math for programmers with Python. It gives you projects to work on, emphasizing algebra, probability, and calculus.
“A Book That Let’s You Learn On Your Own” – 5/5 Rating
“I’ve learned a more from this book than from others…I’m confident that I’ll be able to accomplish writing a few useful Python programs after studying this book.”
6. Math Adventures with Python: An Illustrated Guide to Exploring Math with Code by Peter Farrell
This fun book on math programming will show you how to best harness the power of math for programming. You will explore mathematical concepts by using the coding language Python.
“Wonderful for early high school students and adults first learning code.” – 5/5 Rating
“If you are new to writing code, it is quite nice to see these graphics produced with simple code. The author does provide code for the exercises on the nostarch.com/mathadventures website. Unfortunately, the code is not completely written out.”
7. Foundation Mathematics for Computer Science: A Visual Approach by John Vince
John Vince dives right into the nitty-gritty of understanding mathematical concepts to better succeed at computer science, and nail math for programming. He blends how it all applies to math, programming, and the real world, illustrating its importance.
“Good book for revision not an introduction.” – 4/5 Rating
“The author teaches mathematical concepts in an interesting and engaging way by making historical references and relating those same concepts to everyday activities. He makes you understand why certain mathematical constructs are the way they are.”
8. Essential Discrete Mathematics for Computer Science by Harry Lewis
Harry lewis delves deep into all of the significant pieces of programming math that you will need as a computer scientist. This is a quick read, with 31 short chapters, each covering a different topic.
“Approachable “Math-Heavy” Textbook, with some Flaws” – 5/5 Rating
“Generally speaking, I thought the authors did an excellent job in the earlier portions of the book, introducing proofs and theorems in a cautious, slow-paced way that make them feel more digestible to students who likely prefer to review formal mathematics with as little formal proof-work as they can manage.”
9. Mathematical Structures for Computer Science by Judith L. Gersting
In this hefty tome, readers will be introduced to the exciting and multifaceted relationship of math programming. With a gentle pace through the chapters, you will feel familiar with the material by the end.
“This text is a fine work. The progression through material is logical” – 4/5 Rating
“There are good explanations of basic concepts and methods, general proofs, specific examples, and practical discussion of application. I would recommend this book to those interested in logic, proofs, math, and computer applications.”
10. Mathematical Programming: Theory and Methods by S. M. Sinha
This book covers everything from linear programming to its implementation in our daily lives. Readers will get a clear picture of what the marriage of math and programming is like. There are detailed and challenging proofs for you to explore and hone your skills.
“Excellent except for the unbelievable amount of typos” – 4/5 Rating
“The proofs presented are very rigorous, and the author every now and then brings up interesting facts to help students develop intuition (as when he mentions Lagrange Multipliers and their relation to the Simplex method). There are lots of exercises (no solutions!).”
11. Mathematics & Physics for Programmers by Danny Kodicek
This guide is aimed at programmers who want to make the most out of mathematical education. This also includes physics for game developers. This is an excellent resource for math programming and has further use for game developers.
“Very useful resource” – 4/5 Rating
“And while this book certainly had material relevant for doing so, I probably would have appreciated a little more detail on the subject. That’s not to say that this isn’t a useful book, it certainly is… But it covers a vast range of topics, from 2D (and some 3D) physics to AI path finding.”
12. Introduction to Applied Linear Algebra: Vectors, Matrices, and Least Squares by Stephen Boyd
This intro text to algebra is perfect for math programming. Although it may be a starter text, this outlines all you need to know when programming while using mathematical concepts.
“I would recommend this book to people who don’t like math” – 5/5 Rating
“This book is a treasure of diverse applications ranging from stock market, car control to medical imaging and machine learning. Every piece of theory is justified with clear applications, thus keeping the reader engaged and, at times, absolutely amazed.”
13. Calculus For Dummies by Mark Ryan
It’s no surprise that a For DUmmies book makes the list of some very complicated subjects. After this book, you’ll know all the basics of calculus and can better use them for math programming.
“Don’t Even Bother Learning Calculus Without This Book!” – 5/5 Rating
“I am a great student but I had a full 5 years between high school and college. Needless to say, calculus is far from the easiest course to take after a break like that. Anyway, I started with a D and ended at 88.9%!…Unlike my professor, this book is memorable, hilarious, and easy to read and comprehend.”
14. Discrete Mathematics by Gary Chartrand
Chartrand makes the topic of discrete mathematics more accessible. With knowledge of discrete mathematics, calculus, and algebra, you can better apply it to programming. It’s a relaxed and casual read about a denser subject.
“A Text Essential for Advanced Mathematics” – 5/5 Rating
“I wish I had access to such a textbook while I was an undergraduate. I intended to earn my degree in mathematics but lost interest while taking a transition course in advanced mathematics because the textbook used (interesting enough still used) provided insufficient information and too few examples. I now am reading this for pleasure, believe it or not.”
15. Digital Design and Computer Architecture by David and Sarah Harris
This is an excellent starter text in showing the reader the fundamentals of digital design. Familiarizing yourself with computer architecture, so you can further enhance your programming skills.
“A hardware and low-level focused book” – 5/5 Rating
“It does a great job of walking the student through everything from the basic construction of a transistor, to a complete microarchitecture, to programming. The writing style is precise, the knowledge contained in the book is thorough, and the exercises and examples are challenging. This is a beast of a textbook.”
16. An Introduction to Formal Languages and Automata by Peter Linz
What better way to enhance your programming math skills than by going in-depth with the pillars of computer science? Peter Linz goes smooth on the reader here, not bogging you down with mathematical jargon.
“A must have book for Theory of Computation and Automata” – 5/5 Rating
“Concepts are illustrated in a lucid manner with suitable examples. Large amount of practice problems and keys to some hard problems.”
17. Algorithms Illuminated: Part 1: The Basics by Tim Roughgarden
Familiarizing the reader with the very essence of computer science, Tim Roughgarden aims to make the reader a better programmer through his excellent guide through algorithms and technical skills.
“An excellent, clear intro to important concepts in the analysis of algorithms!” – 5/5 Rating
“The author, Tim Roughgarden, has taught this material to Stanford computer science students for many years, and has been honing his exposition all the while. It is the first of what is to become a series of small texts that cover the same content as the Coursera Algorithms Specialization.”
18. Algorithms Illuminated (Part 3): Greedy Algorithms and Dynamic Programming by Tim Roughgarden
After becoming more comfortable with ROughgarden’s previous works, this is the motherlode of math programming. There are fantastic and comprehensive math problems for you to solve in this complete guide.
“My favorite instructor who taught me so much” – 5/5 Rating
“Prof. Roughgarden has impacted me on three levels. First, he made the algorithm knowledge clear and I may owe my future job to him. Second, he ignited my passion for algorithm, math, and general computer science, the journey is so fun guided by a charming master. The third level inspiration was his direct-to-the-essence minimalist philosophy, things get simple after you know the essence and only in this way can you hold more.”
19. The Art of Doing Science and Engineering: Learning to Learn by Richard W. Hamming
This is a more conceptual text aimed at tailoring your thought process towards different problems in logic, math, and programming. This is a fantastic resource to gain scientific inspiration from.
“Developing Better Thought Processes for Effective Problem Solving” – 5/5 Rating
“I realise this book is not groundbreaking, but I’ve enjoyed his thought process as it differs from many similar books where it leaves me to reflect on things I was taking for granted in my thinking. And any book that’s a cause for reflection on one’s thoughts is a worthy exercise if it means overall better progress for oneself.”
20. Numerical Methods in Engineering with Python 3 by Jaan Kiusalaas
Regardless of what Python version you are using, Jaan Kiusalaas’s guide introduces you to essential fundamentals that you will need in math for programming. It features equations, data fitting, and more.
“Good addition for your machine learning bookshelf” – 4/5 Rating
“Concise and well explained; if you are looking for easy to read and unencumbered implementations of numerical algorithms, this book is a great addition.”
21. A Student’s Guide to Numerical Methods (Student’s Guides) by Ian H. Hutchinson
This guide introduces readers to the vital field of mathematics, numerical analysis. It’s helpful to both programmers and physical scientists, containing useful knowledge for future math programming.
“Four Stars” – 5/5 Rating
“Excellent resource for the beginner. It has a very nice choice of topics, and it is well written.”
22. Mathematical Logic (Dover Books on Mathematics) by Stephen Cole Kleene
Logic is one of the most crucial math programming concepts and is tackled in this book. It’s perfect for those with no prior knowledge of logic, proofs, and commands.
“Comprehensive, not so clear” – 3/5 Rating
“The book is comprehensive and more sophisticated and detailed than I needed, but you can’t blame the book for that. I’ve given it a good/fair rating because the exposition and organization could have been better.”
23. Introduction to Probability, Statistics, and Random Processes by Hossein Pishro-Nik
Probability is a big concept in math for programming. It’s aimed at several different scientific fields, particularly engineers, programmers, and other areas of science.
“Great book, amazing professor, killer price.” – 5/5 Rating
“Pashro-Nik is an amazing professor. I have had the pleasure of actually being in one of his probability courses. He wrote this book to make the material more accessible and cheaper for students. “
24. The Humongous Book of Trigonometry Problems by W. Michael Kelley
This book is chock full of 750 trigonometry problems. It’s billed as being for those who ‘don’t speak math,’ which is perfect for beginners. This is a good practice book if you plan on learning math for programming.
“Outstanding book and invaluable companion for any Trig student…” – 5/5 Rating
“I had to re-learn Trigonometry after having learned it some 35 years ago. For explanations of various concepts, this book is far superior to the Larson text. The Humongous book covers all the Trig topics in the Larson text, so it definitely covers the Trig topics in a High School level course.”
25. Essential Calculus Skills Practice Workbook with Full Solutions by Chris McMullen
Since calculus is another one of programming math’s fundamentals, getting a necessary hold on calculus is a must. This workbook offers the reader a chance to flex their math design muscles.
“Too easy for college level but perfect for high school” – 3/5 Rating
“This workbook is for PRACTICING not studying, I’ve used this workbook for my [college] Calculus classes but found that it wasn’t very helpful because their questions are relatively easy but they are definitely helpful in terms of refreshing your memory and tutoring high school students.”