15 ms·
How much math you need for programming (2014)
- kathe 6y agoFor those programmers who are weak at math and trying to figure out just how much and what kind of math is required to get started with programming or get better at it.
- robocat 6y agoThe Steve Yegg link: http://steve-yegge.blogspot.com/2006/03/math-for-programmers.html http://steve-yegge.blogspot.com/2006/03/math-for-programmers... (The given link didn’t work for me)
- ensiferum 6y agoProgramming is not math. Computer science however is based on boolean and predicate logic and borrows requires mathematical thinking and methods as well. That being said I don't find the basic algorithmic analysis stuff very math heavy unless we go into induction and analysing recursive functions. That being said some domains equipment require a fair bit of maths. Currently working on a game engine and trigonometry and linear algebra are very common tools for me.
- CtrlD-me 6y agoHm. To me programming is a subset of mathematics. You are right it is not math, but its origins are definitely mathematical. There was Alan Turing who built the first computer to decifer nazi communications. But the axis too used "programming", by calculating optimization algorithms to determine rocket trajectories... Of course there is more too it, but an understanding of mathematics is good for any programmer.
- ensiferum 6y agoYes I agree with you but I like to make the distinction between computer science and "programming". I.e the study of computer programs and algorithms is absolutely based on math but most of every day programming isn't really focused on that. As in when you write your business logic or UI code or whatever there's not that much math per se related to the software itself more just the domain math if any.
- CtrlD-me 6y agoYea I'd agree with that too.
- tgv 6y agoI have/had a few colleagues with almost no math knowledge beyond primary school. One was quite a good programmer, interested in all kinds of technical stuff. He had failed secondary school because of, well, reasons, but he wasn't dumb, and wrote decent code and was quite inventive. Another one was someone with a business school degree who had changed careers. Not a glitch in his school career, but his math was very weak. Not a great programmer, but he had a good feel for UI. I've also had a colleague with a math PhD. He was a very good programmer, although not very fast. In my experience, you don't need it if you work on the more conservative projects. If you want to build the next YouTube or facebook, you might find a good understanding of math invaluable.
- dstick 6y agoFollowed you fully, right up to the end. Why would a good understanding of math be invaluable to start the next big thing? At their core, isn’t what makes them great, their simplicity? Upload videos, connect with other people? I’m no math wiz but can probably code an MVP of the product that FB and YT were when they launched. The colleagues you described probably could too. Would love to learn more about the hidden complexity!
- mekkkkkk 6y agoI think (and I believe the parent poster does too) that math becomes relevant when things are starting to scale. Sure, creating an MVP of FB can be done quickly with minimum knowledge of maths. However, if it starts attracting a lot of users, suddenly algorithms and theory becomes very very important to minimize cost while optimizing performance.
- cageface 6y agoIn twenty years of coding I’ve used math beyond junior high algebra exactly once.
- ChrisMarshallNY 6y agoDepends on what you write. For some applications, you need a great deal of advanced dynamic maths, for some applications, matrix math, for some, heavy-duty topology, etc. I have a lot of admiration for folks that write software that implements advanced mathematical reasoning, but that is only a part of what is required to develop shipping applications and systems. For me, I learned the standard calculus stuff, but never used it. I was never a math whiz. What has probably had the most impact for me in my work, was good ol’ Algebra 2. It taught me how to do things like express word problems as formulae, use variables, balance equations, understand functions, abstraction and encapsulation, etc.
- agumonkey 6y agoIt would be nice to have a map. Some programming is plumbing.. some is investigating (maintenance).. some is more attention to details (specs and protocols) but sometimes it's raw wide and deep math. You don't solve dynamic programming problems without a mathematical thinking (or else I want to see 'you' operate :)
- ChrisMarshallNY 6y ago> You don't solve dynamic programming problems without a mathematical thinking Absolutely. Reflecting on my path, I got that in Algebra 2. Everything after that, was really just scaling and application. Calculus is 90% trig and algebra. Lots of it, and applied. Quite voluminous, but rather pedestrian.
- _void 6y agoIt really depends on what software you're working on. If its regular web development, eshop, fintech etc, math knowledge required is close to none. Backend or frontend doesn't matter. If you switch to more advanced software e.g. geo, cad, games then it's a different story.
- realharo 6y agoThat's not just true for math, it's a more general fact - if you make software in a particular domain, you're going to need domain knowledge.
- maccard 6y agoI'm a game programmer, so I definitely have some bias (bare minimum of acceptable is somewhere between advanced high school and first/second year linear algebra, with some calculus being very helpful), but in practice I've found the more math I know, the more I use. I've been working on stats recently in the evenings, and have used quite a few of the concepts in my day job already.
- makach 6y agoIt depends on what problem you want to solve. "How much X do yo need for programming" It helps to have knowledge about X if you want to come up with a solution.
- adamnemecek 6y agoLook, this discussion again. What exactly is math is never actually discussed.
- Someone 6y agoand that’s so problematic that Wikipedia has a page on it: https://en.wikipedia.org/wiki/Definitions_of_mathematics https://en.wikipedia.org/wiki/Definitions_of_mathematics. What’s more, that page says “Mathematics has no generally accepted definition. Different schools of thought, particularly in philosophy, have put forth radically different definitions. All proposed definitions are controversial in their own ways.” I think all programming can be considered math (not higher math (https://www.merriam-webster.com/dictionary/higher%20mathematics https://www.merriam-webster.com/dictionary/higher%20mathemat...: “mathematics of more advanced content than ordinary arithmetic and algebra, geometry, trigonometry, and beginning calculus”), but math)
- mkl 6y agoOf course it is. In this case, it's the biggest subthread here.
- iamben 6y agoI gave up maths as soon as I could at school (16) and didn't study it for an A-Level. It was required for my CS degree, but they let me in without it. I had to apply myself a little more to pass the maths modules, but I don't think maths has really been important to me or my career. I can totally understand WHY maths would be important for some programmers (and why thinking mathematically would help), but "programming" covers such a spectrum - for me it's always felt more like the Lego I spent my entire childhood building was more important. Somewhere between logic and creativity.
- mattlondon 6y agoSame here, although my degree didn't require maths A-level. There are times when I wonder "hmm would I have known this alreay had I done A-level maths at school?" but that I think is general imposter syndrome more than anything. At least for me, I've never needed anything particularly special maths-wise for professional work, apart from derivatives for ML/AI and even that was just academic-self-pleasuring from the course I took... no ML library requires you to mathematically prove something before you can use them (at least not the ones I have used)
- ashconnor 6y agoI did A Level Maths and I don’t recall any of it showing up when I did my degree at the University of Liverpool.
- adder46 6y agoWhere do I apply to get back 5 minutes I spent reading this?
- tuvistavie 6y agoI think the only possible answer to how much math do you need is that it depends on what you work on. There is a lot of stuff that can be done only using very basic math, that's for sure. I would tend to agree with the article that math can be quite useful as a general mental model and can often help to find cleaner solutions to some problems. There are also a lot of applications that require some, often quite specific, knowledge of math: machine learning, cryptography, game engines, to name a few.
- WJW 6y agoFor sure. The question itself is wrong because "programming" is not a monolithic field. You'll need more math for some areas than for others.
- goto11 6y agoBut you use math all the time when programming, probably without thinking of it as math. Boolean logic is math. Incrementing an integer is math. A pixel coordinate is math. But most programmers don't need to use or understand the specialized notation of math - all the weird and beautiful symbols. We use the programming language as notation instead. Some branches like calculus or statistics are not used regularly by the average programmer, but other branches like integer arithmetic or boolean logic is pervasive in any form of programming.
- xiphias2 6y agoIt depends on the scale and latency requirements: for a startup creativity and pace of execution/person is the most important (just like Facebook in the early times). But when you're working on a huge project with many people and many users, lots of data (while slowing down the number of new features), math gets very important for modelling the behaviour of that huge system and getting every extra $$$ out of the network effect. I myself love math, and a very bad fit for small companies, while people who just like to get dirty in throwing together features thrive there. As an example Facebook was dropping messages for a long time, and when Google started Google+, Facebook got serious in fixing bugs with consistency of its features, and started to focus on latency (using Google hires of course).
- deleted 6y ago[deleted]
- Agingcoder 6y agoThere are two different problems actually : what you write, and the quantitative aspects of your code. What you write may or may not have a strong maths component ( game engine vs crud app say, or PDE solver vs typical 'plumbing' app). However, the moment you start having performance issues (and this is everywhere), maths comes in very handy : big o, back of the envelope calculations, orders of magnitude, etc. You may call it engineering (and to a large extent it is), but I tend to lump quantitative reasoning on the math side and not on the compsci/engineering side. It's not necessarily extremely sophisticated, but having a 'quantitative view' of your code can help a lot. I remember many many years ago developing a sudden interest in algorithmic complexity (and what quadratic meant..) after having used a bubble sort to sort polygons in my 3d engine. Needless to say, log became a fairly interesting function after reading a bit more on sorting!
- wendello 6y agoI'm self-taught with minimal maths and this is something I've used. I started re-learning some basic math for fun and now I find it helpful now to visualize mathematical models of some basic runtime characteristics of my programs. A simple example is that I will visualize X number of users firing Y number of requests, and I'll actually imagine this as a live system with various statistical properties (% of errors and the like). It's not typically strictly mathematical—I don't write down many (if any) numbers or symbols—but I'm creating a quantitative model in my mind to think through the behavior of my program when actually in use as opposed to a sequence of logical commands like I usually do.
- Agingcoder 6y agoIndeed! I very much agree with the model vs sequence opposition. Another useful side of the model / math approach is that it allows you to formalize your problem and derive hard bounds, ie know in advance what's achievable and what's not (the 'let' s derive a bound' approach being another standard method in maths).
- alkonaut 6y agoYou need all the math for the domain. If you are in engineering, games, DSP, ML, then that can be a lot. At the same time some developers can go a whole career without ever (knowingly) using a floating point number. They work with web sites/services/databases/apis etc. But developers should at least know basic calculus, logic, and what what you need to grok basic algorithms and data structures. That part of math isn’t even meaningfully separated from “programming”. It’s one and the same. Programming is math. Math isn’t just a useful skill that some times pops up as useful. Without math, programming is merely typing. How much English do I need for writing?
- throw6537 6y agoMeh, disagree. A bunch of developers I know don't know the Pythagorean theorem but they are crazy good (developers). It completely depends on what your job requires you to do. For some developers to be great, they don't need even middle school math.
- alkonaut 6y agoI doubt Pythagoras would show up very often outside of domain problems, but basic logic and polynomials, logarithms etc shows up everywhere where you do algorithms and data structures. Math is a language and a developer will get a code review explaining something using that language (complexity etc). You can do without it but that doesn’t mean it’s a good idea not to simply know those things. It’s not years and years of math, it’s a tiny bit.
- MeinBlutIstBlau 6y agoI agree with this 100%. Hard math rarely has a use outside of it's scope. How often are you really trying to simplify the cotangent multiplied by an arcsin? Sure people who deal with trigonometry do often. But that subset of people is even smaller than people who do geometry. I'd wager carpenters do more math on a daily basis than the average programmer.
- contravariant 6y agoNot knowing some part of mathematics doesn't preclude them from doing something mathematical. The fact that middle school mathematics is often disconnected from what most people would find useful is a big problem.
- reedf1 6y agoHaving a good math basis keeps you from jumping down rabbit holes.
- moonbug 6y agoHow much vocabulary do you need for speaking?
- enriquto 6y agoThe question seems a bit backwards to me (who come to programming from maths). I am more familiar with the opposite question "how much, if any, programming do you need for math?" Every year I meet lots of math students who love math but hate the very idea of programming, as if it was a dirty and unnoble thing to do. I have to convince them that sometimes it may be useful for them. The best course of action is to start by offering the game: "you don't need any programming for math, except in very particular cases". This gives them a clear starting point where they feel safe. Then we work from there, showing them inductive experiments that would be impossible without computing. For example, it is well known that Gauss would check, by hand computation, many theorems about prime numbers before attempting to prove them. This entailed many days of tedious hand computation that he was very proficient at. Today, most of these experiments can be programmed in a handful lines of code and the computer verifies them in a second. Then some students are eager to actually see these lines of code, but more importantly, to see their result.
- godelski 6y agoHaving come from the science I think you have a good viewpoint. We didn't learn programming to program. We learned it because it is a useful tool to model and stimulate. A necessity to do science in the modem world. It was only later that I started to dig in more because I found that I actually liked using this tool.
- vacheron 6y agoAs someone who has formal degrees in Math, I believe this is mostly because the programming Math students do is extremely tedious and simply not enjoyable. In school we were making graphs in Matlab/Octave/Mathematica/R which I think most programmers would not like. Maybe some used Python if they were lucky. Coding visualizations, solving matrices or convex optimizations in Mathematica is not exactly inspiring.
- mattbit 6y ago> Now what does does a mathematician do? He tries to understand nature and uses mathematics as a language to do that. I would argue that this is wrong. That's what physicists do, not mathematicians. Mathematics is about abstract ideas, which can live regardless of nature or application. Physics instead is about understanding nature. Most physicists use mathematics to do that, but that's just for practical reasons. They don't always take it for granted, there's a very famous article by Eugene Wigner on this: “The Unreasonable Effectiveness of Mathematics in the Natural Sciences”. I think it's important to understand this. Sure, computer programming is not math. Physics is not math either. Mathematics is kind of a way of thinking, and mathematical language turns out to be very useful in describing and understanding nature and many other things. Computer programming theory stems out of mathematics, but I agree that everyday programming practice does not strictly require an in-depth math knowledge. But it depends. One day you wake up and you want to solve a problem: sometimes you need programming, sometimes you need math, sometimes both, or maybe you need some business experience, psychology, whatever. We need different perspectives, I don't think we can compartmentalize these things any more.
- Garlef 6y agoYep. A better version would be: > They try to understand mathematics and use mathematics as a language to do that.
- enriquto 6y ago> I would argue that this is wrong. That's what physicists do, not mathematicians. Notice that many mathematicians would not agree with you, here (but probably, a majority would). As the mathematician V.I.Arnold famously said, "mathematics is a branch of physics where experiments are cheap". So, yes, in the minds of lots of mathematicians, what they do is precisely to study and understand nature.
- TeMPOraL 6y agoIn that sense, though, programming would be a branch of physics that's concerned with making brute-force experiments cheap (thus saving the mathematical work needed to find clever tricks to do that same experiment by manipulating a small bunch of symbols).
- gitgud 6y agoSo basically in programming, mathematics is abstracted... This can be generalised even further! In programming X is often abstracted, so you don't need to know much of X to know how to program...
- tim44 6y agoUnless you are doing something novel, not so much imo. I generally trust standard approaches and tools, I'm not trying to write my own encryption, right, or reinvent wheels. You can often get by with no real understanding of the underlying math, just what you put in, what you get out, and what that generally means. Lots of respect to you math geniuses who make it all possible. I'd rather play and prototype stuff than perfect and get into the nitty gritty. But math in programming is great for learning and understanding, it being actually applied.
- mekkkkkk 6y agoIt's all depending on the domain you work in. When working as a web/app frontend developer I've barely ever needed any real maths knowledge beyond basic algebra. As a backend developer, I've had to read up on certain select algorithms. As a game developer I've had to study a bunch of trig, pathfinding and search algorithms. It also depends on the stacks you work with of course. If you are doing doing a lot of Haskell for example you probably want to understand category theory and lambda calculus and whatever.
- js8 6y agoI would say computer science is useful, but as in any craft, you can get by without a theory. Confusingly, CS is considered to be a branch of mathematics, but it is still quite different from "traditional" (up to 19th century) math (linear algebra, calculus). I have a slightly different philosophical view, I consider CS to be on equal footing with most of traditional mathematics. In my view: - Traditional math (which came mostly out of physics and geometry) studies primarily infinite but countable structures (functions on countable sets, infinite series). The finite structures are often considered trivial, and the uncountable structures are considered to be too large to have practical importance. - Computer science (gosh I wish there was a better name of the two disciplines) is concerned with finite structures which are too large (in practice, functions on sets with more than 2^32 elements) to be represented by enumeration. In analogy to finite/countable/uncountable sets distinction in traditional math, small structures that can be enumerated in practice are trivial in CS, larger structures (infinite ones) are pretty much impractical, and they are simply universe in which we operate. (This leads to algorithmic languages, which are essentially descriptions of arbitrarily large finite sets.) - There are other branches of mathematics, logic, category theory, algebra, which are concerned with building bridges between the two above subareas, which are probably many. My point is that for (theory of) programming, you need computer science (focus on large finite sets), and study of infinite sets is less useful. But historically, it's not how mathematics became subdivided, and it is a distinction useful from applications of mathematics, not mathematics as a general study of structures (regardless of size).
- aleurwal 6y agoMy CS tutor at university used to say that calling the discipline "computer science" is like calling chemistry "test tube science" :).
- ccortes 6y ago>Traditional math (which came mostly out of physics and geometry) studies primarily infinite but countable structures (functions on countable sets, infinite series). The finite structures are often considered trivial, and the uncountable structures are considered to be too large to have practical importance. I don't think this is the case at all. Basically all of calculus theory in based on uncountable structures and it's arguably the most used branch of mathematics.
- NotPavlovsDog 6y ago1) How much physics and math do you need to ride a bike? 2) How about designing and manufacturing a bike? Spokes and gears and diameters and metal expansion / contraction coefficients and whatnot. 3) How about doing number 2 from scratch? You start with some iron-enriched bacteria sludge .... For 1), not a lot. Same for basic applied programming. I was perfectly fine modifying source code files to change strings & output without understanding any math, or even much programming. For 2) When I wanted to develop a trading application, I needed some. It was before proper APIs, so I had to learn about rounding and what pitfalls it entails for currency. But today so much of development is glue. I made a license scanning and identifying app just by using someone else's code and gluing it together, but you bet there is math underneath doing the text recognition. And then, if you want to develop something algorithmic, such, as, an example, a search algorithm, well, you are basing your algorithm on theory, and some of it math. Behavior and the concept of quality comes in, etc etc, but you better be good at math. So really, if you want to make a product, you should be asking how much traction do I need before I invest more in the product. If you want to program, you want to program what you like. If you need to program to solve a problem, then you start with the science classic, the literature / domain review. It sure will outline how math heavy the domain is. And if you want to address something with math, you probably know at least some math. I'm not going into how you address finding out what you don't know. My point, as many others have made above, is: how much math you need for programming depends on what you need to program, and why.
- andi999 6y agoNormal computer or quantum computer?
- Traubenfuchs 6y agoAs a CRUD or frontend dev you should be able to know the numbers from -100 to +100. Modulo is a bonus. Anything else is not required for the majority of programming jobs/tasks. Yet beginners getting hazed and outsiders getting scared with CS/algodat and math is essential for keeping wages up and „normies“ away.
- st1x7 6y ago- there is a lot more to programming than CRUD and frontend - you're putting algorithms and data structures in the same basket as mathematics - algorithms and data strucutures are useful in pretty much any programming job including CRUD and frontend
- User23 6y agoAlgorithms and data structures are mathematics.
- ratsimihah 6y agoNot much it seems. Concepts like logarithmic and exponential growth can be found everywhere, maybe one just needs the right approach to grasp them. I can't think of much more that's needed to become a decent programmer.
- sizt 6y agoBill Gates proves that a math background actually leads to bad code, and that you don't even have to be a human being.
- tompazourek 6y agoI think as a programmer you usually need to understand boolean algebra. And if you are working with some data (tracking some analytics, or measuring performance), some very basic statistics is needed as well. Otherwise I think it just depends on the domain you're programming in, I can't think of much else that would be general. Idk if you'd actually call these basics "math"...
- hyperpallium2 6y ago0 Unless you're in an area that needs math, e.g. fluid simulation, computer graphics, proving algorithms, deep learning, crypography etc. Although there is pure mathematics, I'm not sure there is such a thing as "pure programing". It's all applied, to do something. So there's always another field required. Sometimes it's math. There is theoretical conputer science, but (a) it's not programming and (b) is it math.
- blargmaster42_8 6y agoAll of it! Math is weight lifting for your mind, it makes you smarter. Lack of math gives us Phyton script kiddies when we could have had far superior C++ developers
- pc86 6y ago> You want to learn computer programming, then learn computer programming. Do not flip through Math books, read whatever is written on a particular newsgroup (comp.lang.c, comp.lang.lisp for example). I'm sorry but how long has it been since newsgroups were relevant? I loved them back in the day but it's absolutely not where a programmer noob should go in order to learn programming.
- arnuld 6y agoYes, you are right, in 2020 Stackoverflow and other forums have taken over. Usenet is no longer relevant (not 100% true, but you get the point). Web-based forums are the places where one learns now. Also, the documentation of different software, libraries and tools has improved a lot. I wrote that blog-post back in 2014, that was 6 years ago. I learned programming from 2005-2008 and all of that was because of the help I got from the mentioned newsgroups. There used to be a few known names on USENET and everyone knew them and ask them for help. I really loved USENET. These days comp.lang.c is mostly filled with spam and comp.object died sometime ago. Life is about change.
- susam 6y agoI have found Reddit r/lisp and Freenode #lisp to have great communities these days. They serve as good alternatives to comp.lang.lisp. It wasn't always so but both communities have evolved over the last decade to become more friendly to beginners. Also some of us here from this forum also hang out at a Freenode channel named #spxy (also accessible via https://app.element.io/#/room/#spxy:matrix.org https://app.element.io/#/room/#spxy:matrix.org on Matrix). This is a small computer science and mathematics literature club, so quite relevant to those who are curious about or who work in the intersection of mathematics and programming. Incidentally, many members of this channel are also Lisp programmers.
- jamil7 6y agoA lot more than people make out, at least in my experience. There’s a lot of talk about how you don’t need maths or cs theory but to me this only seems true for certain areas or levels. For me its been especially true with performance, cs theory and maths can help you to know what and where to optimise and give you ideas on the how.
- wendello 6y agoJonathan Blow has a good talk about this. He says when he interviews he wants somebody that will default to a naive implementation (because most code is not performance-sensitive and you should optimize for development time in those cases), but he expects people to have a wide knowledge of tricks and techniques for the ~10% that is performance sensitive. That seems fair to me, as somebody who probably wouldn't pass his standards and needs to develop my algorithmic knowledge to handle that 10% better.
- jamil7 6y agoThis sounds interesting, as you mentioned it’s not that often that you need these skills but the times you do it’s incredibly difficult to know where to start without some theory. Also unsure why my original comment was downvoted, I did preface with saying it was my experience not a fact.
- deleted 6y ago[deleted]
- z3t4 6y agoWhen working with CSS/design I used subtraction, multiplication and division. When working with e-commerce/finance I used algebra. When making a 2d game I used geometry. When making a 3d engine I needed to learn about vector, matrices, etc. When working with weather forecasting there where formulas involving sin,cos,atan etc. So while you do not need math to get started in programming/development, you will definitely stumble on it. And you don't really know your math until you put the wrong formula into programs/production used by thousands of people.
- GuB-42 6y agoWhen you do design you need to know about typography, when you do finance, you need to know about accounting, when you are making a game, you need to know about game design, when you are doing weather forecasting, you need to know about meteorology. None of them are skills that a programmer needs unless he works in the field. Maths is the same. You need very little maths to code unless your field requires it. And even then, sometimes you don't even need to. I worked on a software that computed material fatigue with absolutely no idea about the maths involved, the mechanical engineers just told me the formulas and constants to use as well as the expected results and I implemented them. (not entirely true, but it was just personal curiosity, absolutely not required for the job).
- PaulKeeble 6y agoIt definitely depends on the work you are doing. When working in aerospace I used maths a lot, 3D vector work as well as physics like velocity, acceleration, gravity simulations etc were all pretty important. I have also had roles where I suspect I never used much beyond basic addition and multiplication. But if your maths isn't there you are not going to be getting roles that are heavy on the fundamental maths problems. It is the same with algorithms. Some times a role is utilising the basics all the time and you rarely get passed some DB access, lists and maps. In others I have needed to build a Type 2 ary tree with lockless parallel access. I think what ends up happening is that most projects have some tough stuff and some have a lot more of it but you can contribute to those projects without knowing how to solve it because the bulk of most programming is fairly simple. But that deeper knowledge is needed by at least someone on the team at some point in time.
- dstola 6y agoThere is a joke/saying/anecdote I heard a long time ago that may or may not be relevant "Programmers are mathematicians that solve all their problems by Induction" After being a software engineer for over half a decade now, that still rings strangely true to me
- dmak 6y agoI don’t understand this. Could you elaborate on it?
- dstola 6y agoFrom Wikipedia [1] "Mathematical induction proves that we can climb as high as we like on a ladder, by proving that we can climb onto the bottom rung (the basis) and that from each rung we can climb up to the next one (the step)." For-loops are a discrete form of mathematical induction and is a basic concept to do any kind of programming, hence the joke (of course its more nuanced than that but is true in a tongue-in-cheek kind of way) [1] https://en.wikipedia.org/wiki/Mathematical_induction https://en.wikipedia.org/wiki/Mathematical_induction
- GnarfGnarf 6y ago"Induction" means you prove it's true for 1, then you prove that if it's true for 'N', then it's true for N+1.
- AnimalMuppet 6y agoI'm not sure I agree with that outside of functional programming.
- newen 6y agoFor loops, while loops, and recursion are all induction. Functional programming is just a style of programming, as in, algorithms which are designed and proven using induction can be implemented in imperative or functional styles.
- the_only_law 6y agoI’ve been trying to do some work with signals among other things and for the first time in my life, I wish I had payed attention to trig and calc.
- mcguire 6y agoIt depends on what you mean by 'math'. Calculus? Not that much. Formal logic? Programming is applied formal logic.
- mirko22 6y agoJust a random opinion: You don't need math at all to make a computer program. All you need is a computer with some kind of language that is easy to run installed and a tutorial for hello world for it. But what about programming a program that does some math calculations? Seem like it would be good to know those math calculations that you need to implement... Or lets take accounting software for example? You need basic math most of the time but it turns out it is quite valuable to know about accounting. Yes, you can write an accounting software without knowing any accounting and just depend on what product manager tells you. But it is much easier to understand what he is saying if you know a lot about accounting... It is also much easier and faster to make decisions without going to product for each tiny detail. You can expand this to the problem of building teams. You can read few tutorials on agile development and what not, however knowing psychology and having enough empathy to understand people you work with in depth will bring much better results then any so called management book that is taken literally. And so it goes... The more you know about how world works the better decisions you can make that eventually might lead you to better solutions to the problem at hand. This is a general thing in life in my experience, but also one that seems to be looked over quite often... The more you know about problem domain the better you will be at problem solving inside that domain. Coding that solution into a computer program at that point is just a matter of knowing how to use that tool (which is a specific problem domain in of it self.)
- alephnil 6y agoHow much math you need for programming does not have a single right answer. Often you can get away with very little math, but if you know math, you may be able to see patterns in the domain you are working in that allows you to come up with a much better and more elegant solution than you would otherwise. Or you can attack problems that the people around you consider too hard or go beyond the standard library used in your domain. Then, if you don't know the math that applies, you may never even see the opportunity, and be convinced that math does not applies to what you do, and that you never needed it in the first place. And often, it makes you the most natural person to work on the most interesting and challenging problems.
- carapace 6y agoReminds me of one of my favorite jokes, I have forgotten who said it, maybe Dijkstra? "Computer science could be called the post-Turing decline in the study of formal systems."
- daxfohl 6y agoAsking the converse. Are there any fields in programming that require like measure theory or topology or whatever?
- realjohng 6y agoI think the ML and data science folks are close to Math. I agree though generally speaking most programming doesn't involve math.
- justnotworthit 6y agoOff topic personal story time: My high school offered a programming class for the first time (1998). I took it my freshman year, not having the required math. I remember realizing my sub-par math book was out on my desk in front of the teacher, then quickly hiding it. I think he pretended he didn't notice. Of the 35 students (total) that took the class, 8 completed it. There was no second year class but the teacher (one of the few whose name I remember) asked me to come back next year and be his assistant and receive training one on one. The next year, the school canceled the class. I checked out of schooling from there on.
- austincheney 6y agoAgreed! > Computer Programming is not Math. Let me say it again, computer programming is not Math and will never be. You want to learn computer programming, then learn computer programming. Programming is far more aligned with writing than math. If you want to be a better programmer be a better writer. Math will not make you a better programmer. Conversely, programming will not make you a better writer, but it will make you better at math. This is complicated, but provable with testing. The term math is extremely misunderstood. Math is not a practical exercise, it is a philosophy, a way of thinking. Lay people believe the word math is interchangeable with arithmetic, which it isn't. Arithmetic is the expression of immediate computation. Math is more than that. Writing algorithms and instructions is algebra. Algorithms are always algebra. Always. Algebra is the conveyance of instructions, which is inclusive of arithmetic, but is more expansive and accounts for variability. The word algorithm literally comes from the Latinized name for the father of Algebra, Algorithmi. https://en.wikipedia.org/wiki/Muhammad_ibn_Musa_al-Khwarizmi https://en.wikipedia.org/wiki/Muhammad_ibn_Musa_al-Khwarizmi Planning is calculus. Calculus is the expression of continuous change. Calculus accounts for states in fluctuation and differentiation. Calculus allows for thinking in terms of various potentials and collections of decisions. The reason why writing makes you a stronger programmer but math doesn't is because math doesn't force critical examination like writing does, at least not until you get to Calculus. The reason programming does make you better at math is because it teaches you to solve tough math problems without ever having to do math, because Math is a philosophy, a way of thinking. This is provable with numbers. Simply test people, compare the testers, and then compare those differences against programming capability. This is provable objectively with numbers. If you want to hire better programmers test for writing performance. The best filter of a group of candidates, for programming potential, is a tough essay to write under time pressure. When I took the military aptitude test, the ASVAB, the first time I was 17. My scores indicated that I was smarter than 79% of the people who took the test that year, but the only score that really mattered is the GT score. It is an examination of solving complex mathematical word problems under time pressure and is graded on a scale of 0-130. I scored I 107. Smarter than average but not smart enough to become a military officer. 17 years later when I wanted to be a military officer I needed to retake that test at which point I was smarter than 98% of the population who took the test that year and I scored a GT score of 129 (out of 130). I had been programming for 6 years at that point.
- hordeallergy 6y ago+1, -1, mod 2. My 25-ish year career.
- no_wizard 6y agoI know the question posed here has nuances (the question of the title of the blog post as well as its contents as it tries to answer. Here’s a simple truth I’ve found about it though: It’s more than you think, but less than advertised in the end. A lot of the most complex mathematics is abstracted away from the average or even maybe not so average developer. This I would say is a loose guideline more than a rule of course, there are exceptions I will say though that what I have learned is that a typical thing we need to be better at as developers (myself included) is math related to date/time and currency. These are actually quite complex problems that even the best developers get wrong
- ajarmst 6y agoAs usual, the answer to the eternal question of “how much formal math training do you need for X” turns out to be “right around the amount the author of the argument has had.” Why is it that we always have to prove the instrumental value of maths education? You’re a lot more likely to “need” your maths in the “real world” than your Shakespeare, but few have much energy for fighting the idea that literature should be studied for it’s own sake. Wondering about the minimum amount of effort required for success is more valuable for its insights into whether this is something you should pursue than for any answer you could find. So here’s what I should think is the obvious answer: No, significant formal or informal maths training is neither necessary nor sufficient for a successful or even exemplary career as a programmer. But talent and success in the two do seem to correlate pretty strongly, and those who do have above average backgrounds in maths seem to feel it’s beneficial and provides an advantage. No, you don’t need maths any more than you need strong writing skills or comfort teaching or experience with office politics or a sophisticated sense of humour. Those are all, however, astonishingly useful in getting the things you want, even if that’s only a richer experience of life.
- jkaptur 6y agoI agree with everything you’ve said, but I want to push back on the (non-load-bearing) “few have much energy for fighting the idea that literature should be studied for it’s own sake.” It seems to me that lots of people have endless energy for this fight, unfortunately.
- ajarmst 6y agoIt’s possible that the sample set of anecdotes I base this on is a bit skewed, as I teach undergraduate maths. In my limited experience I had to put a lot more effort into keeping basic differential calculus in the required freshman curriculum than my colleagues from the English department had to keep the %#^* five-paragraph essay. (Full disclosure, I’ve also taught our “Communications” course because of a misspent youth in an Arts program and work as a technical writer, and my colleagues from the English department supported me in killing the Essay Writing part of the course—-the fight was with government and industry reps who’d swallowed the “soft-skills” pill.)
- smonff 6y agoYou basically need almost no maths knowledge to learn programming. This is the first thing the person that trained me told us. Especially for fields like web development and stuff. Sure, if you need to send rockets to mars, it's not the same. With 12 years of experience, I would say this is true. I would even say that my fucked up logic makes me a very good debugger.
- pyfan878 6y agoslightly off topic but do you have some resources that explain maths in simple language, or using visualisation and code samples? Although I had calculus, linear algebra, probability theory, and discrete maths at uni, I have forgotten most of it. This sucks especially because from time to time I bump into a problem that could easily be modelled elegantly using math.
- shepherdjerred 6y agoI work at AWS. The highest level math course I've taken is College Algebra. I wish I had taken more math courses and now I'm seeking to learn on my own or possibly taking classes.
- jariel 6y agoThe Math proponents here I think should accept that it's a little more 'domain knowledge' as opposed to inherently part of the craft, which is I think the point of the article. 'Musical theory' background probably correlates pretty well with 'good programmer' in my completely unscientific guess, though it's obviously not remotely a requirement. 'Building' however, is quite fundamentally different from 'theory'. Do you remember the supposedly 'not so bright kids' who went to work in 'shop class' because they liked 'working with stuff' and not 'stuff in books'? I don't they were so dumb. The process of 'making' engages us on an entirely different level than intellectualizing, and I think really differentiates the discipline. There are many bits of software that we use daily, not made by 'genius' but rather the sweat and effort of 'some guy who did it, mostly because it worked'. You don't need any maths, but it's probably a good sign if you do.
- geniium 6y agoSpoiler alert: not so much. It’s probably better to be well organized and a bit of a cleaning maniac to keep your code clean and easy to maintain.
- TrianguloY 6y agoI would say 'studying maths teachs you how to abstract problems' or 'computer science usually cares for the results, not the method' but that has been said a lot in other comments (and it's not exactly right). Instead I will point an interesting fact I've noticed myself among my computer science classmates (from my second degree, I first did mathematics). When you stumble around 'maths' (which in classes it's pretty common, to explain things using mathematical formulas, but in the real world it's also common to have some explanations even in stack overflow using math expressions), in that situation other computer science students usually see them as something 'strange', something to be afraid of or reject by searching alternatives; whether myself and other math/physics-students just don't care, we are used to it (and most times it's just a function) My opinion is: you don't need maths (99.99% of the time), but you also don't need to be afraid of them and knowledge is very good for that.
- master_yoda_1 6y agoThe question is fundamentally misleading. Amount of math needed depend on task you do. The first atom bomb simulated using programming and a simple html is also written using programming.
- tracer4201 6y agoIf you’re remotely interested in understanding ML, calculus and linear algebra are essential.
- supernova87a 6y agoThe most critical thing a programmer needs is a sense of order-of-magnitude, to know when the thing he/she is building or implementing is going to break. And a sense of how likely such a thing is to break, again, within order of magnitude common sense-driven probability. From loops to architecture, this is applicable. Of course, you can apply this deeper, to processing efficiency, fetch times, etc. etc. I think most other fancy equations or theorems can be learned as needed. But sense checking your math with skepticism about your own assumptions, and knowledge of orders of magnitude, is key.
- todd8 6y agoOver the many years, I've taken over 25 university math courses. There are a handful that I feel I would not have missed as a programmer. I've been a computer scientist and software engineer for over 45 years, here are the mathematical subjects I've taken college classes in divided into two groups: Useful for at least some programming or work I've done in the past: * Linear Algebra * Geometry * Calculus and Vector Calculus * Differential Equations, Partial Differential Equations, and Control Theory * Logic * Combinatorics and Graph Theory * Number Theory * Fourier Analysis and Laplace Transforms * Operations Research * Discrete Math * Computability * Probability * Statistics * Numerical Methods Classes that I haven't needed for programming yet: * higher levels of Abstract Algebra, Non-Commutative Ring Theory * Real Analysis, Complex Analysis, Measure Theory * General Topology (I suppose some concepts are useful in category theory and perhaps kernel transformations in machine learning are superficially similar to the subjects covered in Topology) The world is full of programs so some don't require much math, but mathematical sophistication is needed for advanced programming and young programmers should do their best in school to learn math well.
- sunstone 6y agoIf you're programming a basic business app then you won't need too much math. If your app is simulating the big bang origin of the universe you would probably need a bit more.
- at-fates-hands 6y ago>> If you're programming a basic business app then you won't need too much math Unless its in finance. I'm a front-end developer and never needed any math until I got a job at a large finance company. We had several mobile apps that required some calculus, statistical models and some differential equations. In college, I only had to take through Trigonometry for my major so when I was suddenly tasked with this stuff, I eventually had to lean pretty hard on two of my co-workers who had CS degrees and were much better with it than me. I got through it unscathed and ended up with a much greater love and appreciation for math.
- fortran77 6y agoWe're staffing for a new project involving navigation systems and we need to find a few people who are comfortable with partial differential equations, etc. You'd be amazed how many "computer programmers" are out there that have not completed a course in or have no memory of calculus!
- graycat 6y agoHow much? Depends. In some contexts essentially nothing. In other contexts up to and including some of the most advanced known so far with advances wanted. First, Military During the Cold War, around DC a large fraction of the interest in programming was for some of the math for the work of the Cold War. Then I was programming at the David Taylor Model Basin in numerical fluid flow, that is, solution of the Navier-Stokes equations. Some of the work involved an early computer algebra package Formac; I used it for local series solutions to the equations. Later there was work with the fast Fourier transform (FFT): A guy had wired up a hardware box for the algorithm. I showed him a version of the FFT that used the same signal flow graph at each algorithm stage. His jaw hit the floor: That version of the FFT could have saved him a big fraction of all the circuitry in his box. Later I was in a software house bidding on a software project from a Navy lab. In part the lab wanted to be able to analyze and simulate ocean waves. They wanted to regard the waves as a second order (covariance) stationary stochastic process. For the analysis, calculate the power spectrum of data collected at sea on ocean waves. Then for the simulation, generate sample paths of the stochastic process with that power spectrum. So, I dug into Blackman and Tukey, The Measurement of Power Spectra, saw the statistical basics, and quickly wrote some illustrative software that did the work. One of the lessons was, to get an accurate power spectrum takes, roughly, some number of cycles of data at the frequencies of interest so that at low frequencies, i.e., for ocean waves, need possibly a lot of data, hours, where in radio engineering can need just seconds. I showed the results of my software, and our company got sole source on the software development project! Second, Academic At one point, I was consulting in programming, data analysis, and algorithms at Georgetown U. and teaching courses in computer science. One prof had programmed some polynomial curve fitting and was getting bad numerical accuracy. There are connections with the notorious Hilbert matrix. I programmed for him a version based on constructing polynomials orthogonal over the given input data; that approach had much better numerical accuracy. Third, Commercial E.g., GE was running a computer time sharing service, and there I was the main GE HQ guy for math, numerical analysis and statistics. So, it was statistical hypothesis testing, classic regression analysis, analysis of variance, factor analysis, polynomial curve fitting, some non-linear curve fitting, random number generation, sorting algorithms, all of standard numerical linear algebra, interval arithmetic (for guaranteed numerical accuracy), digital filtering, the fast Fourier transform, solution of ordinary differential equations, and more. Later I was programming at FedEx. A first little bit of math, hard for the other FedEx people, was how to calculate great circle distances. A simple solution is to use the law of cosines for spherical triangles. The software I wrote to schedule the fleet used that solution. Later FedEx wanted some revenue projections. We knew (a) our current revenue and (b) the revenue at the planned full service. So, the projections were a version of an interpolation between those two. So, how was the interpolation to go? I argued that the growth would be from word of mouth advertising, that is, viral growth and that growth would be directly proportional to (i) the number of current customers talking about the service and (ii) the number of target customers to be hearing about the service. This led to the first order, linear, ordinary differential equation initial value problem d/dt y(t) = y'(t) = k y(t) ( b - y(t) ) where t is time (in days), y(t) is the revenue (dollars) a time t, b is the planned capacity of the service, k is the constant of proportionality, and y(0) the current revenue. There is a simple closed form solution. We picked a value for k that gave a reasonable graph, and that was our projections. Uh, with more details, each of those two FedEx projects saved the company once. It may be that currently in the commercial world there is interest in principal components analysis and various cases of curve fitting, linear and non-linear. Fourth, Startups Currently I have two startup projects going: In some contrast with Sam Altman, How to Start a Startup at https://startupclass.samaltman.com/ https://startupclass.samaltman.com/ key to both is some relatively advanced, original math I derived. The math is the crucial key to being able to deliver the service and is the secret sauce, "unfair advantage", technological barrier to entry, difficult to equal. Broadly, the power of current computing is a wide open invitation to use the computing to do the data manipulations for some math that can be powerful for some real problems. Then that computing needs programming so that it can help if the programmer knows the math. Net, in some contexts it can help if a programmer knows some math.
- Animats 6y agoWhat math you need has changed over time. Today, probability and statistics are used more, while discrete math and number theory are less essential. CS used to have a lot of automata theory, and that's not important much now unless you have to write regular expression parsers. If you do anything with graphics, you need a subset of matrix math, and there are graphics books which cover what you need. If you get into robotics, you need differential equations.
- cmrdporcupine 6y agoI didn't get a CS degree precisely because I bombed out of math so bad in high school that I couldn't get admission to any program. Here in Canada a good grade in academic-stream high school math was simply mandatory for admission to any BSc program. Took a philosophy BA instead, though didn't finish it... dropped out to go get a job programming during the .com boom, and now 25 years later I work at Google. Was a long road, and would have been a lot less torturous if I had been better in math. Not because I've needed math much in my programming career, but because my bad math became a reason that gatekeepers closed doors on me over and over again. Perhaps the strongest cause of imposter syndrome I have at work is less related to not having a CS degree -- because I feel like I know about 99% of the content of any CS program -- but more to do with the fact that I work around a lot of maths geniuses. In reality the "math" I failed in high school was more arithmetic than mathematics per se. I feel like I might have a disability around numbers but I've rarely had problems with the higher level symbolic manipulation involved in algebra or programming or symbolic logic, etc. though my probably-ADHD means I have to really step back and work through things at my own pace in my own environment, and so whiteboard coding type interviews really piss me off.
- vacheron 6y ago> Here in Canada a good grade in academic-stream high school math was simply mandatory for admission to any BSc program Perhaps that's why I've always found excellent engineers from Canada's flagship schools (U of British Columbia and U of Toronto) :p More seriously though, I have an advanced degree in Math and seldom needed it for development work, even when I was working in more quantitative roles. And whenever I did need the knowledge I would just look up and learn again. Glad you're doing well without a traditional background.
- cmrdporcupine 6y agoIf I were to pick flagship schools for Canada for computer science and engineering, it wouldn't be those two... it'd be U Waterloo and U Alberta. Well, ok, U of Toronto, yes, but UBC doesn't come to mind. But in Canada generally we don't have the same level of status game around school reputations that Americans seem to have. Certainly grads from U Waterloo do very well, but they may have as much to do with their excellent intern program than anything else.
- Decabytes 6y agoI think the answer really just depends on the domain you are working in. Web dev, not much, Data Science, mostly stats, the physics engine in a custom game engine, well a lot of calc, geometry and such
- BXLE_1-1-BitIs1 6y agoThere are certain problem domains where university level math is required. In my five decade career in commercial applications, including actuarial and yield computations, you just plugged in the formula the actuary or math graduate gave you. As far as operating systems,database and hardware control were concerned, elementary school arithmetic was more than sufficient. Recently linear algebra has come to the fore for AI.
- karaterobot 6y agoFor most professional programming jobs, you do need some math. For example, you need to know to subtract one in zero indexed languages, and you need to know how what numbers are bigger than other numbers, so you can pick the StackOverflow answer with the most upvotes.
- beezle 6y agoMany yarns ago I completed a CS minor. I had been coding since early high school so aced the programming courses. The last requirement was 200 level Math dept. "Algebra" or 300 level ECE 'Discrete Math.' Ruined my 4.0 in the minor and to this day I still can't fathom why such a class was a requirement (though CS was in the math dept at the time). As I recall, the emphasis was primarily on graph theory with no applications. Maybe its nice to have for a undergrad CS major but even there I wonder what percentage will go on to actually need/use such material? I suspect it is fairly niche.