carlriz has asked for the wisdom of the Perl Monks concerning the following question:

I have always wanted to know people's opinion on this: What math skills should you know that extremely useful/set you apart from other programmers (e.g. Calculus, linear algebra,...)? What have you guys encountered on the job?

Replies are listed 'Best First'.
Re: Most Used/Useful Math skills
by LanX (Saint) on Jul 18, 2014 at 16:13 UTC
    Algebra - especially Abstract Algebra and Discrete Mathematics - are most influential.

    Cheers Rolf

    (addicted to the Perl Programming Language)

    PS: At least they dominate the curriculum for CS studies in Germany.

    I won't start to elaborate further why, since it's off topic.

Re: Most Used/Useful Math skills
by Your Mother (Archbishop) on Jul 18, 2014 at 16:20 UTC

    Probability, maybe? Probability and statistics have enough non-intuitive surprises that understanding them affords things from reporting to security. I haven’t done calculus (manually) in 20 years and never formally had to multiply matrices or such. I haven’t found that to hinder my particular path through dev-world. I think image/graphics programming is where heavier, smarter math is necessary. When I have to do that or other math-centric stuff like encryption, I rely on pre-done algorithms and libraries and forums far more than my own knowledge.

Re: Most Used/Useful Math skills
by davido (Cardinal) on Jul 18, 2014 at 16:34 UTC

    From Wikipedia:

    Computer science is considered by some to have a much closer relationship with mathematics than many scientific disciplines, with some observers saying that computing is a mathematical science. Early computer science was strongly influenced by the work of mathematicians such as Kurt Gödel and Alan Turing, and there continues to be a useful interchange of ideas between the two fields in areas such as mathematical logic, category theory, domain theory, and algebra.

    I've found that my interest in the science of computing has motivated me to become more proficient with mathematics. They really go hand in hand.

    The public education system where I live recently made a subtle shift in high school graduation requirements. Previously, a student could take a CS elective and apply it toward his or her math requirements. Now that CS elective can be applied either toward a math requirement, or toward a science requirement. It might be seen by some that this is a step toward supporting that CS is a science. But the reality is that the change was made to encourage CS students to take more math (the implication being that if this CS elective is used to fill a science credit, there will still be a need to fill another math credit). Sort of a round-about "social engineering" approach to encouraging more math. I guess I would have preferred to see some other requirement relaxed in order to support kids who want to focus more on science, math, engineering, etc. But everyone has their own agendas, and somehow a curriculum is arrived at. ;)


    Dave

Re: Most Used/Useful Math skills
by AnomalousMonk (Archbishop) on Jul 18, 2014 at 15:43 UTC

    I've used multiplication quite a lot, and found it very helpful.

      The reason for this question was this: I found a tretris game online written in perl. I read through the code, and it was very interesting how they used transformations. It was quite clever...check out this link: http://docstore.mik.ua/orelly/perl2/advprog/examples/GUI/tetris.pl.

        In light of the consideration: "Is that a link to pirated content?"

        The code (tetris.pl) is part of the content of the book Advanced Perl Programming (Chapter 15: GUI Example: Tetris).

        O'Reilly freely provides example code from the book in both .tar.gz and .zip formats. This specific script is in examples/GUI/tetris.pl.

        Be aware this book was published in 1997. While I couldn't find a reference to a specific Perl version used for the code examples, it must be earlier than Perl v5.5 which was released in 1998 (see perlhist).

        -- Ken

Re: Most Used/Useful Math skills
by roboticus (Chancellor) on Jul 18, 2014 at 17:43 UTC

    carlriz:

    For me, the most useful math has been algebra and trigonometry. Generally for rearranging problems into a form that I can express as a program. I use it often enough that I don't normally have to look up algebra and simple trigonometry equations. In previous jobs, I've found calculus and linear algebra handy, but those were in jobs requiring modelling (milk production) and robotics. I seem to have an obsession with graphs, and frequently read articles on them, and many of my hobby projects use graph structures a good deal.

    However, that's just the practical day-to-day stuff. I wish I was better at math. I think that learning math is a lot like learning LISP--you won't necessarily use it in your programming, but it helps you think about better ways to do things. I frequently wonder how often I could solve programming problems more quickly if I were familiar with more math.

    While I don't use probability and statistics much, I think it's valuable to be conversant with it. It's not uncommon to get questions or tasks based on incorrect assumptions of how probabilities and statistics work--leading to wasted time and money. (Unfortunately, I can't think of any specific examples at the moment.)

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      I understand exactly where you are coming from. I am no expert in math but I understand concepts in calculus, discrete math, basic trigonometry, and whatever else I have learned in school. I do not use (high level) math on a daily basis at all. But, I will say all of the math learned in school really helped me program more creatively.

Re: Most Used/Useful Math skills
by tobyink (Canon) on Jul 18, 2014 at 21:49 UTC

    Propositional calculus / boolean algebra (De Morgan's laws and all that jazz), and set theory.

Re: Most Used/Useful Math skills
by BillKSmith (Monsignor) on Jul 18, 2014 at 19:44 UTC

    I suspect that we all find use for the skills we have. We often do not have a clue that some other branch of math could help us.

    I have used vector and matrix algebra more than anything else.

    I was often required to write probability code that I knew made little or no sense. Perhaps if I had had the skill to explain what was wrong...

    A solid understanding of floating point numbers is far more important than it seems.
    Bill
Re: Most Used/Useful Math skills
by perlfan (Parson) on Jul 18, 2014 at 20:13 UTC
    My list: sets, graph theory, combinatorics, linear algebra.

    Differential equations and calculus don't help much other than conceptually; for example, if you're writing a computer simulation that models partial differential equations, then you're not going to solve it the way they teach in general diff eq as an undergrad.

    Finite automata and cellular automata are also very useful to know.

Re: Most Used/Useful Math skills
by neilwatson (Priest) on Jul 18, 2014 at 18:03 UTC

    While not often related to computer work, everyone should have a good understanding of compound interest.

    Neil Watson
    watson-wilson.ca

Re: Most Used/Useful Math skills
by BrowserUk (Patriarch) on Jul 18, 2014 at 19:15 UTC
    What math skills should you know that extremely useful/set you apart from other programmers

    The ability to skip read through the goals, methodologies, philosophies, proofs, formulaic notation and bibliographies and other similar BS in 'formal' papers in order to extract the 5% of content that actually useful.

    Its taken me 30+ years to get half good at it; and I still wish I was better, but I'm getting there. (I'll just have got really good and I'll kick the bucket; but that's ... er ... maybe not :)


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: Most Used/Useful Math skills
by AppleFritter (Vicar) on Jul 18, 2014 at 16:10 UTC
    Beyond the basics? I'd say treating functions (etc.) as first-class objects; beyond the obvious applications in functional programming, getting acquainted with functions being objects like any other teaches you to take a step back and abstract/generalize, and that's often very useful no matter what you're doing.
Re: Most Used/Useful Math skills
by Laurent_R (Canon) on Jul 18, 2014 at 22:24 UTC
    Hmm, I have a relatively decent level in maths, but nothing exceptional (some might say even quite low level if you think about all the branches involved). But I am really not a mathematician. There was an (half-serious, I would say) article, a couple of months ago, in the French Linux Magazine, stating that nobody needed math in CS. The "best" argument was that, even if you need complicated math for a given complicated task, some other people probably already wrote a package to do what you need. To me, this is appalling.

    Yes, CS is definitely part of math (a small part of math, though). After all, remember that Dijkstra was a professor of applied mathematics at the University of Texas (Austin).

Re: Most Used/Useful Math skills
by wrog (Friar) on Jul 19, 2014 at 18:58 UTC
    For sheer brain-stretching there's nothing quite like group theory and number theory, which have relatively few prerequisites and the latter of which comes up surprisingly often in programming (anything where you're using %/mod).

    The theory of generating functions (known in the math world as Formal Power Series) is just insanely useful.

    Galois theory (field extensions, finite fields) comes up in coding theory and cryptography.

    If you learn about p-adic numbers and p-adic analysis then you'll understand why 2s-complement arithmetic works (and then kvetch about the lack of a proper 2-adic division instruction in hardware :-)

    If you're doing graphics programming then linear algebra and trigonometry matter matter a lot. Spherical trigonometry matters if you're doing anything with cartography, or GPS/navigation. Hyperbolic trigonometry would be more brain-stretching. Projective geometry (if you want to understand why those 2x3 matrices come up all over the place when talking about scaling/rotating/translating)

    Calculus, on the other hand, comes up surprisingly non-often unless you're doing work in physics or statistics. (I always thought the high school math curriculum should go straight into group theory and number theory from plane geometry rather than the comparative dead-end of calculus, but hell will probably freeze over first)

Re: Most Used/Useful Math skills
by zentara (Cardinal) on Jul 19, 2014 at 19:13 UTC
    I have to say vector spaces. Most real world calculations usually end up being modelled in vector spaces.

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
Re: Most Used/Useful Math skills
by QM (Parson) on Jul 21, 2014 at 22:27 UTC
    Complexity theory: If you can't tell the difference between an exponential and polynomial algorithm, you'll be waiting for the job to finish while someone else codes up a faster program and goes home early.

    Basic statistics and number theory come up sometimes.

    Recursion -- lots of definitions involve recursion, or are more simply stated recursively. Functional programming fits in here, though most languages have some form of recursion available.

    There are many nuggets in TAOCP, but it seems you have to know where to look, or guess that your topic has been mentioned. I often find pointers there from other searches.

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of