Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. How much knowing math well helps programmer?!

How much knowing math well helps programmer?!

Scheduled Pinned Locked Moved The Lounge
questiondiscussion
88 Posts 49 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Picozzi

    In my opinion, math is nothing more than the study of logic. And, as everyone seems to agree, programming requires logic ... I think that there is a big misunderstanding of what mathematics really are. People focus on math being complex equation and strange symbols: this is not math, this is the language we chose to explore (cartesian) logic. Would you reduce medicine to its wording, or coding to C++? I am very surprised to read that many programmers think that they do not need math to do their job. Look at any code: "function", "class" (=equivalence class), "variable", "array" (=vector), "+", "*", "%", ... understanding how these objects interact is the aim of mathematics! Even at a more fundamental level, a code essentially consists of 2 things: Logical tests (!) and loops (=matrix multiplication). Math is everywhere in a code, even if you don't see it! There is no doubt for me that math helps programmers. I would even say that there is no programer without mathematical knowledge (understanding what are functions or classes is a mathematical knowledge in itself, even if you did not learn it in your math class! ). Coders use maths at every line of their code without thinking about it. The language used to express things is slightly different, but the core is the same. Finally, when considering very complex computations, one quickly realizes that the mathematical language allows faster and better analysis of the problem than any programing language: It was developed in this scope!

    J Offline
    J Offline
    johnrhdev
    wrote on last edited by
    #74

    I don't think you need to be a mathematician to program, but if you have a good understanding of mathematical theorems than you have the advantage. All of the great algorithms used in computing are mathematically based. They begin as mathematical constructs that are transformed into a program. Just as someone can write without fully understanding grammar, people can program without fully understanding mathematics, but can you create something as beautiful as an encryption algorithm? Watch some of the series like the history of Mathematics and you'll see why math is so important and ingrained in software. Without it we would not have computers.

    1 Reply Last reply
    0
    • H hakz code

      Recently I had a fun discussion with my colleague(he works on algorithms) on this topic, thought you guys would give some insight.

      Y Offline
      Y Offline
      YvesDaoust
      wrote on last edited by
      #75

      Any decent programmer must master Boole algebra, calculus of propositions and elementary integer arithmetic. A good programmer should have some education on the semantics of programming languages and be able to use program correctness verification techniques (invariants). Also good notions of algorithm efficiency. Understanding of "The Foundations of Computer Science" by Aho and Ullman is by no means a sin. All the rest is more a matter of the application area.

      1 Reply Last reply
      0
      • H hakz code

        Recently I had a fun discussion with my colleague(he works on algorithms) on this topic, thought you guys would give some insight.

        S Offline
        S Offline
        Stephen Lloyd
        wrote on last edited by
        #76

        Math is not just arithmetic. Arithmetic is a subset of math. There are a lot of subsets. Linear math, non-linear math, logic, sets, (as the King of Siam was fond of saying) etc, etc. We got exposed to lots of the subsets in public school.* Most of the program logic on our desktops doesn't go beyond obvious math subsets. Neither does most of the code we develop.* Keep in mind our programs have to talk to some fairly ignorant hardware.* Some of the programming we do translates very high level math concepts (think Wolfram, ...) into programs that our ignorant hardware will understand. Some of it is a lot simpler. All of it depends on at least the logic subset of math. * Rant opportunity

        1 Reply Last reply
        0
        • S Slacker007

          Fair enough.

          ChrisElston wrote:

          You have something, it has a value, what happens depends on what that value is in relation to some other value or values.

          I don't really think of that as math, even though it technically is. My reason, it's second nature to us. I think of math as complex equations and/or mathematical algorithms. To me that is math in programming.

          ----------------------------- Just along for the ride. -----------------------------

          M Offline
          M Offline
          MiddleTommy
          wrote on last edited by
          #77

          I agree. I would classify basic programming as Algebra which I dont consider "math" anymore. Its second nature. What I consider math in programming is Calculus and above. All those really complex things that not many people enjoy.

          1 Reply Last reply
          0
          • H hakz code

            Recently I had a fun discussion with my colleague(he works on algorithms) on this topic, thought you guys would give some insight.

            G Offline
            G Offline
            Gary Huck
            wrote on last edited by
            #78

            Well, you certainly haven't received much in the way of constructive remarks on this, yet :) IMHO math is a great foundation for programming [I have a BS in math] - math is "brain pushups". If you can solve difficult problems in math, then you're off to a great start as a programmer. The difference, I've learned over the [many] years, is the science part of computer science. One must study things like oop and other non-math material.

            H 1 Reply Last reply
            0
            • H hakz code

              Recently I had a fun discussion with my colleague(he works on algorithms) on this topic, thought you guys would give some insight.

              P Offline
              P Offline
              patbob
              wrote on last edited by
              #79

              Boolean logic and algebra are necessities. If you can't invert a compound boolean expression in your sleep, you have no business being a SW developer. If you can't rearrange an algebraic expression to solve for the variable, you have no business being a SW developer. Converting betwween binary/hex/octal/decimal is a required skill. Understanding 2's complement math should be a required basic skill, but many people get by just fine with a "its just magic" level of understanding. As for higher math, it depends on what you program. For my current job, trig and spherical geometry are requirements, and at least enough calculus to be able to read the writeups from our math whiz (fortunately, I don't need to figure out the stuff he writes up :) ). In other jobs I've had, the math needs ended at algebra and boolean logic. It isn't strictly math, but if you're writing numerical computation algorithms, understanding error propagation with floating point numbers is a requirement. Unfortunately, it usually isn't. So few people understand it that they are unequiped to realize that its beyond just being important but an actual requirement. Learning thist stuff if dry and boring, but should actually be a requirement for a CS degree from any institution. It was in mine, and I've fixed numerous errors in simple algebraic expresisons that were caused by a lack of understanding of this. If you don't know what I'm taking about, go read What Every Computer Scientist Should Know About Floating-Point Arithmetic -- there should be nothing (well, not much, anyway) new in there to any of us SW developers.

              patbob

              1 Reply Last reply
              0
              • S Slacker007

                ChrisElston wrote:

                In my opinion programing is maths.

                Other than basic math, if that, how much of your programming involves math(s)? Just curious. :)

                ----------------------------- Just along for the ride. -----------------------------

                M Offline
                M Offline
                MacSpudster
                wrote on last edited by
                #80

                I dunno, I didn't study in that area of math.... ;P :laugh:

                ~ [Don't] Visual[ize the] Basic[s], C#[ly instead] ~ ASPX: Apple Simply Performs eXcellently

                1 Reply Last reply
                0
                • H hakz code

                  Recently I had a fun discussion with my colleague(he works on algorithms) on this topic, thought you guys would give some insight.

                  A Offline
                  A Offline
                  austin hamman
                  wrote on last edited by
                  #81

                  in my experience for most coding you dont need to be good at most math (im actually quite poor at arithmetic but surprisingly good as algebra...some algebra...) you just need to understand basic logic and everything else follows (no pun intended) programming for the most part is more like english(or your native language) or foreign languages, its mostly about syntax and vocabulary. until you get into graphical programming, then its matrix transforms and calculus. all your logic wont help you rotate that image along the x axis or perspective scale it without a library. but aside from that you may occasionally use math concepts without thinking of them AS math (for instance i dont think of modulus as the remainder from a division, i think of it as x%y makes something repeat y times for a steadily increasing x. i dont often think about the underlying bits and the operations they are doing when i make a bitmask, i just know that you make the numbers as significant numbers in base 2 and then you can join em together with | and you can see if they have been joined together with &. ive had a whole one time where i needed to convert to an arbitrary base(converting numbers to base 26 using letters a-z but no numbers for a list (because li didnt make them right and it had to match the book)) and ive never needed to do much more complicated math than that.

                  1 Reply Last reply
                  0
                  • K Keith Barrow

                    The shortest route to flipping burgers :)

                    Sort of a cross between Lawrence of Arabia and Dilbert.[^]
                    -Or-
                    A Dead ringer for Kate Winslett[^]

                    C Offline
                    C Offline
                    chrisseanhayes
                    wrote on last edited by
                    #82

                    reminds me of the old joke: The graduate with a Science degree asks, "Why does it work?" The graduate with an Engineering degree asks, "How does it work?" The graduate with an Accounting degree asks, "How much will it cost?" The graduate with a Liberal Arts degree asks, "Do you want mustard with that?"

                    1 Reply Last reply
                    0
                    • H hakz code

                      Recently I had a fun discussion with my colleague(he works on algorithms) on this topic, thought you guys would give some insight.

                      B Offline
                      B Offline
                      BrainiacV
                      wrote on last edited by
                      #83

                      I've always disappointed people by doing the math, and I'm not talking higher math, just simple addition and multiplication, to demonstrate what they want to do or want to buy won't work. Back in the 80's, right after WarGames came out and all the kiddies ran home to write a program to dial every number to look for computers, there was a big push on to make it illegal to do so. People were spouting nonsense about how the computers could dial thousands of numbers a minute and the potential cacophony of all the phones ringing one after another in the neighborhood, I felt I had to jump in and shut these people down with numbers. I timed how long it took to dial a number (which could be tweaked to be faster, but the biggest time was), the time it took for three rings, and how many exchanges there were. I computed even if there were 800 kiddies running their programs at once 24x7, the person raising hell about this, would only get one call per month. Not a nuisance, you'd normally get that many wrong numbers a month. And also your neighbor doesn't have the number one more than yours, so the neighborhood would not have all the phones ringing one after another. And did you really want to give the government the right to be examining your phone bill looking for this kind of activity? On the BBS discussion boards of the time, they used to leave one word responses just so they could push my message with the math off the BBS'es limited message queue. I loved the message boards, these were people who would try to shout you down in person, but on the BBS you could state your case without interruption. That was democracy. Another time I calculated that an early "network" made of 6821 parallel interface cards, would choke after four users accessing the common database, when the sellers claimed it could support hundreds. Saved our company big time, but the president had been real hot to buy them to rebrand and sell. I've found higher math is not necessarily necessary, but it is important to at least do the math instead of run on opinion. I once saw a company go down because the software manager told the hardware guys the computer could handle any interrupt speed. They then proceeded to make the hardware with an interrupt rate twice what the computer could deal with. I had once worked with that manager and knew he never did the math. It was a real shame, several of my friends had gone to work for the company and were then out of a job because this idiot couldn't pull out a calculator. But then, I always

                      1 Reply Last reply
                      0
                      • H hakz code

                        Recently I had a fun discussion with my colleague(he works on algorithms) on this topic, thought you guys would give some insight.

                        Y Offline
                        Y Offline
                        Yortw
                        wrote on last edited by
                        #84

                        Maths certainly helps, although it depends somewhat on the specific work you're doing, but in general I'm a much better programmer than a mathematician. So maths might be useful, but not strictly necessary (at least beyond the basics, and the PC will do the actual grunt work for you). A lot of what I do is either string manipulation, database access, UI, multi-threading, network comms etc. and has very little to do with maths. The maths I use everyday in the accounting, retail back office and point of sales systems I work on is generally restricted to addition, subtraction, division, and multiplication. We don't use trig, logarithms, quadratic equations or any other 'advanced' mathematical concepts. I commonly work with percentages and prorate figures across multiple 'items' - that's about as complex as the daily work gets, although certainly we sometimes do more advanced algorithims for stock regrouping and that sort of thing - but it's generally rare. Most of those are also based on some kind of percentage and prorating mechanism. Very, very, occasionally I do some kind of binary work (bit masking, bit shifting etc). So, how helpful is knowing maths well ? Depends on whether you're a computer scientist or applications programmer (or something else). You can write a lot of code (and probably even some of it good) without knowing maths. Knowing maths won't guarantee your code is better (faster, more readable, more extensible etc) than someone elses. On the other hand, it can't hurt either and for some jobs it might be required. That's just my 2 cents worth though.

                        1 Reply Last reply
                        0
                        • H hakz code

                          Recently I had a fun discussion with my colleague(he works on algorithms) on this topic, thought you guys would give some insight.

                          J Offline
                          J Offline
                          James W Taylor
                          wrote on last edited by
                          #85

                          My best short definitions, in order of generality: Mathematicsis the discipline and language of precisely defining and proving assertions. Computer Science (sic) is the art and mathematics of the linguistic description of problems and processes. Computer Engineering is the art and engineering of programming languages and machines which "execute" those languages as instructions Programming is the skill involved in creating syntactically correct statements in a programming language. Arithmetic, algebras, "higher mathematics", etc. are all exercises in mathematics, and are the first steps in exercising something that a mathematician might call mathematics. Mathematics in general, expresses the clear a complete definition of a problem, and rigorously proves that a particular answer is true and complete. Exercising discipline and insight is a good start in solving problems at any level in the computer world. More necessary than mathematics in most engineering is the willingness to analyze a problem; box it in, put bounds on it, do the back of the envelope calculation. This is also a separate pseudo-mathematical skill, which should be applied constantly in all projects. Understanding the limits is one of the more important activities that will distinguish any engineer. For example, see: http://www.cs.bell-labs.com/cm/cs/pearls/bote.html[^] http://www.codinghorror.com/blog/2005/07/gigabit-ethernet-and-back-of-the-envelope-calculations.html[^]

                          modified on Tuesday, July 19, 2011 7:57 PM

                          H 1 Reply Last reply
                          0
                          • J James W Taylor

                            My best short definitions, in order of generality: Mathematicsis the discipline and language of precisely defining and proving assertions. Computer Science (sic) is the art and mathematics of the linguistic description of problems and processes. Computer Engineering is the art and engineering of programming languages and machines which "execute" those languages as instructions Programming is the skill involved in creating syntactically correct statements in a programming language. Arithmetic, algebras, "higher mathematics", etc. are all exercises in mathematics, and are the first steps in exercising something that a mathematician might call mathematics. Mathematics in general, expresses the clear a complete definition of a problem, and rigorously proves that a particular answer is true and complete. Exercising discipline and insight is a good start in solving problems at any level in the computer world. More necessary than mathematics in most engineering is the willingness to analyze a problem; box it in, put bounds on it, do the back of the envelope calculation. This is also a separate pseudo-mathematical skill, which should be applied constantly in all projects. Understanding the limits is one of the more important activities that will distinguish any engineer. For example, see: http://www.cs.bell-labs.com/cm/cs/pearls/bote.html[^] http://www.codinghorror.com/blog/2005/07/gigabit-ethernet-and-back-of-the-envelope-calculations.html[^]

                            modified on Tuesday, July 19, 2011 7:57 PM

                            H Offline
                            H Offline
                            hakz code
                            wrote on last edited by
                            #86

                            Ya..your definitions look more precise,thank you for the links

                            1 Reply Last reply
                            0
                            • G Gary Huck

                              Well, you certainly haven't received much in the way of constructive remarks on this, yet :) IMHO math is a great foundation for programming [I have a BS in math] - math is "brain pushups". If you can solve difficult problems in math, then you're off to a great start as a programmer. The difference, I've learned over the [many] years, is the science part of computer science. One must study things like oop and other non-math material.

                              H Offline
                              H Offline
                              hakz code
                              wrote on last edited by
                              #87

                              ya :) if math is brain pushups then i need to improve my fitness level

                              1 Reply Last reply
                              0
                              • L Lost User

                                I think that all of it is. You have something, it has a value, what happens depends on what that value is in relation to some other value or values. I think that is maths.

                                Every man can tell how many goats or sheep he possesses, but not how many friends.

                                E Offline
                                E Offline
                                Elrond
                                wrote on last edited by
                                #88

                                There are different types of maths. Some are (or become) very natural with practice. Programming require a fair bit of logic, which is one type of math. Also, if programming seems natural to me (unlike a lot of things in math) it is not to every body. And even complex math can seem natural to a few people. I don't feel programming has much to do with math, but may be it does, much more than I thought.

                                1 Reply Last reply
                                0
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • World
                                • Users
                                • Groups