Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Education Science

What Math do You Use? 102

e_lehman asks: "I've been associated with MIT's introductory 'Mathematics for Computer Science' course for a number of years. The course has emphasized different topics in different years: logical foundations, proofs, probability, combinatorics, etc. But this is at the whim of instructors. What mathematical topics should we be teaching to budding computer scientists? What mathematics do you actually use or need, working in the computer industry? Here are some candidates: boolean logic, graphs, number theory, combinatorics, proofs, set theory, relations and functions, approximation methods, solving recurrences, generating functions, analysis of state machines, asymptotic analysis, and addition of small integers."
This discussion has been archived. No new comments can be posted.

What Math do You Use?

Comments Filter:
  • Useful (Score:2, Insightful)

    by rastachops ( 543268 )
    A solid grounding in maths is always good. When pushed far enough it caus you to develop different thinking patterns that address problems in new ways. Which are always useful for any problems.

    • by Glonoinha ( 587375 ) on Saturday February 15, 2003 @01:36PM (#5308988) Journal
      A long time ago, in a galaxy far, far away ... I was admitted to the CS/SE honors program at the Univ of Houston. Had some of it paid for, but finances were not the issue - all Freshman honors students had a mandatory 6 hour 'kick your ass' English / History class designed to weed out the wannabes.

      It worked. Neither English nor History were my strong suits and I wasn't about to subject myself to that kind of hammering when I felt that as a software engineer I should be focusing on other things. I didn't enroll at UofH and went to another University in Texas on a full ride scholarship. No 'freshman destroying' 6 hour English class required.

      Perhaps all the math (more hours of math than the math major, as I recall) wasn't about -knowing- diff'eq, four semesters of Calculus, eight discrete maths, three semesters of statistics, etc ... but it was about -learning- those maths. Face it, Differential Equations, the higher layers of Statistics, the higher thought planes of Calculus - those are all some friggin'eh difficult concepts to grasp. DiffEQ is the Star Trek of math - all I remember about that was taking a very evil math equation and saying 'Ok, we morph this through the time-space continuum and in an alternate universe we use their math to solve an equivalent equation and then we bring it back to our universe by applying the Heisenburg principle ... voila - Solved!'

      Think about it - in the event you actually do work for NASA or the NSA or whatever, do you want your group of peers made up of 6 week wonders with just enough MFC training to develop C code on Windows, or do you want a guy that can learn four chapters of advanced calculus in three weeks? Well I generally learned it overnight because I neglected the 'daily attendance' part of a few courses, but you catch my drift.

      Right knowing that somebody got through college with their BS/CS under the Department of Engineering tells me that they do not know FEA (finite element analysis) but it also tells me that they can learn it in a few weeks. Ditto pretty much any language, or OS, or platform. It tells me that they can optimize a boolean expression in their head and if they don't know the answer to something they know where to find out.

      Hard math in college is good - push em until they break. Then push em some more.
  • Analysis (Score:4, Interesting)

    by prisonernumber7 ( 540579 ) on Saturday February 15, 2003 @09:04AM (#5308258) Homepage
    If a CS student is to ever make something useful out of his maths, you should be teaching him analysis:

    - Logic
    - How to set up proofs
    - Full induction
    - Rows (pardon me if this is not the correct english word, something like Sum[v=0,eternity] of 1/v!).
    - Functions (differential, integral)
    - Differential Equations
    - Function theory

    ... and so on.

    Basically anything that will teach them what maths is really about and give them the ability to get along with maths in a scientific way on their own.
    • Re:Analysis (Score:2, Informative)

      by KDan ( 90353 )
      - Rows (pardon me if this is not the correct english word, something like Sum[v=0,eternity] of 1/v!).

      Series (and summation of series)?

      Daniel
    • Re:Analysis (Score:2, Insightful)

      by Anonymous Coward
      Are you, perchance, a mathematician? Your answer seems to contain the classical mathematical assumption that analysis is the elixir of the gods from whence all other mathematics sprang forth.

      Granted, in most university undergraduate programs we choose real analysis as the place to start teaching "real mathematics" (instead of: insert integral/matrix/etc., turn crank, get output)... but this does not, to me, make analysis intrinsically fundamental. Of course, if you're going to go on to learn things like general topology... then it *is* important... but I do not believe topology is a field of principal importance for computer scientists (yet...).

      The fundamental problem with your assertion is that analysis deals with real numbers. Theoretical computer science is all about *discrete* sets. In fact, if you give me a computer with just a single register that can hold a real number... I can easily show that computer to be capable of computing non-computable (in the sense of the Church-Turing thesis) functions.

      Studying real numbers simply doesn't make sense for computer scientists (at least to start) when the domain in which they will be working is inherently discrete.

      I *heartily* agree that they should see:- Logic, How to set up proofs and Full induction. These are absolutely fundamental.

      However, why teach them about real-valued functions? No computer, nor any reasonable model of computation, can work with real numbers... why take time to develop an inapplicable theory? What would be much more relevant would be to teach the theory of recursive functions... primitive recursion, total and partial recursive functions... *these* are directly applicable to the world of computation.

      Personally, I see fundamental mathematics for computer scientists as being: set theory (preferably axiomatic), logic, combinatorics, some abstract algebra, recursive function theory, formal language theory, automata theory and formal semantics. I think those alone would overburden a modern cirriculum... but then I am of the mind that computer *science* is mathematics... as opposed to the vast majority of my colleauges who seem hell-bent on turning CS into a tradeschool for Visual Basic programmers.

      Still, to be fair to you, I would be overjoyed to see Computer Science programs start requiring a course in analysis. Not so much for the content, but for the exposure to mathematical rigour... something which is sadly in extremely short supply in modern CS cirricula.
    • I think that by "eternity" you mean "infinity." [wolfram.com]

      As others have pointed out "rows" are probably "series." [wolfram.com]

      It is said that mathematics is the universal language. It is still damn hard to have a conversation about it if both parties don't speak the same language.


    • - Logic

      - How to set up proofs

      -full induction

      -Rows (pardon me if this is not the correct english word, something like Sum[v=0,eternity] of 1/v!).

      -Functions (differential, integral)

      - Differential Equations

      - Function theory

      Sheevus, I hope this guy is kidding. I had all that crap - minimal spannign trees, Dijkstra's algorithm, proofs - and I have NEVER used any of it. What I could REALLY have used was a far better grounding in linear algebra and such - fast matrix inverting schemes, etc. A class in pattern classification would be GREAT and would be a perfect lead-in to AI.

      The best arguments I have heard is that these classes serve as good weed-out classes to get the idiots out of a CS program ASAP. OK, they work to that end, but wouldn't a hard but USEFUL class be better? Or just teach assembly for CS 101 (hell, if we're doing things chronologically, that should be first anyway...assuming we don't teach low-level machine language).

      • I had all that crap - minimal spannign trees, Dijkstra's algorithm, proofs - and I have NEVER used any of it.

        So you've never worked in compiler implementation, in deductive databases, in network routing, in operations research and so on?

        It's okay that you haven't found a use for these things (yet). You would be well advised not to diss hammers just because you've never seen a nail.

    • Re:Analysis (Score:2, Insightful)

      by Ruie ( 30480 )
      I would suggest "Foundations of mathematics and logic".

      This has several goals/reasons:
      • teach students the notion of proofs and how to make them. This is very useful for writing correct code ;)

      • expose students to manual computation - this has a different flavor from automated computation and thus you avoid the problem of students being accustomed to some methods so much that they don't stop to think why certain things are done one way and not the other.

      • teach students logic, Godel's theorem is a nice place to discuss difference between human and computer approach to solving problems

      • prepare students for courses on compiler construction, etc..

      • show how to make integers out of sets, rationals out of integers, etc.

      • this course is self contained and thus bypasses the issue of woefully unadequate background of most US students
  • Well, a great question sir, I have been studying 2 computer science courses last semester (erm computer science math). These courses talked about most of the things addressed in the question, and I doubt I'll ever need some stuff there in my real computer science life.

    Well, we still studied some interesting stuff with applications in computer science, however, isn't it more useful to make the course more concentrated in stuff we will use all the time in the future!

    I hope there are not much such courses in my university career anyway!

  • by Anonymous Coward
    ...I've studied relatively little theoretical computer science to date (but am meaning to work through Art one of these days -- maybe when volume 4 (?) comes out), but there are two things that I have found extremely useful to me:
    -- Formal logic, so that I'm more used to judging e.g. that a function always returns, and properly, or
    -- O( calculation, so I know how slow my worst-case scenarios are.
    Hope this helps.
  • by Scarblac ( 122480 ) <slashdot@gerlich.nl> on Saturday February 15, 2003 @09:29AM (#5308304) Homepage

    I believe that Computer Science != Software Engineering. The job I actually ended up in is a programming job, which means that not all the CS I had is relevant. But that is good - they aren't meant to be the same thing.

    For instance, in CS, to calculate the time efficiency of some algorithm, some really hairy analysis may be needed to decide it's actually O(n log log n). This is important as a part of CS. What is important for CS is not defined by what is important for getting a programming job. The science is important for its own sake, as a branch of math.

    That said, logic, sets, graphs, relations, discrete algebra - the "discrete stuff" so to say, is both what I like best and what I think is central to CS.

    • While the theoretical core of CS is not typically of day-to-day value in most industry jobs, a solid background in the fundamentals is part of what makes you a professional and more than a hacker finding things out by trial and error. You don't have to be able to prove things about computability with Turing machines, but you'd better understand the implications of this stuff in terms of what can be computed in a reasonable time (or at all). The bottom line is, it depends on the specifics of your work (job); if you stick to programming and development vs. doing more systems and network engineering jobs, you are going to use a different knowledge set. Of course, the broader your foundation knowledge, the better you will be at the "big picture" stuff, and the more you will be able to function as a system designer and architect.

      So, yes, all the "discrete stuff", as you say, but I view these more as the basic tool box for a programmer, and most people who are cut out for this work will pick up what they need in this area without a lot of formal training. The main reason to go deeper with this area is for a better understanding of cryptology and related stuff, and if you are getting into the "guts" of runtimes and garbage collectors, a more formal understanding of these ideas will be important, but I would say that the "Formal Languages" sutff is more important to programming work.

      We create new "languages" all the time in the course of our work, so knowing what can be recognized and parsed with regular expressions (and the equiv. finite state automatons) vs. context free grammers helps when trying to specify something that is consistent and unambiguous.

      I would also say that the math core (18.01-03 in my day, calculus through differential equations) isn't really essential to much, but probablity and statistics is a lot more important. I would also say that I didn't get much in my formal training that covered the topics important to analysing systems performance. I'm talking about the areas relating to latency vs bandwidth and throughput.

      In retrospect, the "Computational Structures" course (6.032 in my day, which became 6.003 after I took it but before I graduated) lost it's relevance very quickly, or maybe I just forgot what I learned in this course. This was before the emergence of RISC architectures, and there has been enormous change in these areas since then, and I expect this to continue and maybe even intesify in the near future, so I would put more emphasis on these areas. IMHO, one of the main reasons that a lot of interesting new architectures fail (e.g. the connection machine) is that we don't have the basic mental and programming tools to deal with non-vonneuman architectures. Well, this really goes way beyond anything you can address with a course of study, but it would help.

    • That said, logic, sets, graphs, relations, discrete algebra - the "discrete stuff" so to say, is both what I like best and what I think is central to CS

      Algebra, set theory (including relational algebra and relational calculus), Boolean algebra, statistics, matrix operations, linear programming.

      I've never had to use PDEs, Tensor stuff or even induction since graduating. Of course it depends what sort of programming you want to do. Systems programmers don't it, but an applications programmer in the engineering industry might well do.
  • Too far! (Score:2, Funny)

    by Anonymous Coward
    addition of small integers

    I know it is supposed to be an academic study, but this is just going to be too demanding. Where could you even find people qualified to teach such exotic stuff?

    • Yah, I'm working on Addition of small integers after I finnish Pre-cal.

      One thing, though I think EVERYONE should learn is trig. If someone can't program an anolog clock that plots lines from 0,0 to X,Y at a standard rate they arn't geeks. (y=r*sin(theda), x=r*cos(theda), theda = (secs/60)*2*pi)
      • Two problems with that.

        A) try calling it Theta [reference.com].

        B) your trig assumes that you've got a square screen. Most computer displays use non-square pixels.
  • What mathematical topics should we be teaching to budding computer scientists?

    Algorithm. I wondered why you asked this question. The CS degree courses around the world rely on MIT's textbook [amazon.com]. :)

    While you here, would you ask them why this book is freaking thick? We can complete no more than half of it before examination. :)
    • Excellent book though, a bit hard to understand at some points, it includes quite the algorithm library in it. If you didn't use this book in your course, you should definitely get it as a reference. It is full of all sorts of recipes for cookin' some nice code!!!!
  • Many problems of efficiency and throughput can be modeled using probability and queuing theory. Also, probability is useful for lots of other things, like spam filtering and such.
  • by Some Woman ( 250267 ) on Saturday February 15, 2003 @10:19AM (#5308384) Journal
    I think it's less about how much math you will use and more about how math changes the way you approach problems. Exposure to math teaches people to approach problems systematically and logically. You may think that you're never going to use matrices and eigenvalues in The Real World, but math classes are worth more than mere knowledge.
    • I second this! I've got Bachelor's and Master's degrees in CompSci and PureMath, and I've worked as a software consultant and doing research in mathematical finance. The specific mathematical techniques taught in school are sometimes useful later on and sometimes not (depending on what you do). The training in rigorous thought that PureMath gives is always enormously valuable.

    • > I think it's less about how much math you will use and more about how math changes the way you approach problems.

      I agree (mostly), and would go further to say that it changes the way you approach problems because it changes the way you think about the world.

      I added the "mostly" qualification because IMO we'll soon reach the point where society wants us to concentrate more on getting our products right than getting them out the door, and at that point "programming" will be forced to become a math-based engineering discipline, and we'll start using our maths very explicitly.

      As for the "Ask Slashdot" question, the math needed for programmers to understand what they're doing is all the 'discrete' stuff people are mentioning: logic, sets, relations, functions, graphs, basic proofs, etc. You may never use these things explicitly during your programming career, but they will inform your intellectual life and have a big impact on the way you write programs. (Hopefully, in a way that causes you to produce fewer wrong algorithms.)

      IMO the other good stuff so many people are mentioning, such as linear algebra, trigonometry, calculus, differential equations, numerical methods, statistics, etc., are not fundamental to computer science, but rather are important to specific types of application. Thus they should be moved out of the core CS curriculum in order to make room for as much of the discrete stuff as possible. (Or maybe leave in a "pick one" advanced math requirement.)

      Still, I would encourage students to study these "non fundamental" mathematical topics if time allows, because some of them really will fundamentally change the way you look at the world. It would be nice for a CS degree to include them all, but the typical CS program is already so packed that most students can't finish in 4 years.

      As an aside, IMO one of the most important courses a CS student should take is an algorithms course. (It's a killer hard course, so you may want to take it on a pass/fail basis.) The course will include a mathematical treatment, and you'll have to thoroughly master all the 'discrete' math stuff before you attempt it, but it will really open your eyes to the possibilities of what you can do algorithmically.

  • Maths I Use? (Score:5, Informative)

    by nathanh ( 1214 ) on Saturday February 15, 2003 @10:53AM (#5308456) Homepage
    Statistics. I strongly wish I had a deeper grasp of statistics in almost everything I do. Finite state automata and directed acyclic graphs may be all the rage in compsci, but if I compreheneded confidence intervals and probability distributions I'd do much better work than I currently do.
  • by muonzoo ( 106581 ) on Saturday February 15, 2003 @10:58AM (#5308480)
    The three things that have been powerful and useful to be in almost every application have been:
    • Finite State Machines
      Their analysis, NFA to DFA transformation and the applicability of FSMs to most stateful problems
      (protocols, lexical analysis, communications, etc.)
    • Graph Theory
      Use of graph representations for the analysis of many of the same problems mentioned above
    • Numerical Analysis
      Methods for modeling continuous phenomena discretly.
      (Euler Integration, FEA, Meshing, etc.)

    All these thing consistently make my job easier, more interesting and, continue to provide a level of insight to tricky problems (especially the first two) that exceeds simple 'programming'.

    The two most under appreciated courses of all time in Computer Science education have to be the Theory of Computation (FSMs etc) and the Discrete Mathematics (Graphs, Numerical Analysis, etc). An alarming number of new graduates cannot phathom how to apply this stuff. It's powerful and once you start using it, you'll always see things a little bit more ''completely''.
    • I'm not sure that I agree with you Muonzoo. I've worked in two very different industries since graduating, and with the exception of general numerical analysis, I haven't used anything that you mention.

      I worked at a large defense contractor and we developed OCR and hand writing recognition software. We used many ideas from controls systems, including FFTs and many image processing algorithms. Finally we placed our own customized (and patented) neural network over the top to categorize the images based on the results of the other algorithms. 99% of the math that I used for this job was either AI related (Neural networks, Support Vector Machines, Simulated annealing) or image/controls related (scale reduction, FFT, filtering, etc).

      Currently, I work in quantitative finance and I study quantitative finance at NYU. Although the program is *very* mathematical, my computer programming has been limited to solving partial differential equations using Finite Differences and Monte Carlo simulations. Although neither of these seems like a very sophisticated numerical method (compared with FEA and Galerkin methods), there is much math involved in tuning the finer points of both methods.

      Finally, I consider Numerical methods something different from understanding the mathematics of computer science. The numerical methods are something that should not be taught in a Mathematics of CS course. The mathematics would be to understand the underlying PDEs that need to be solved or understanding exactly what each image processing algorithm is telling us.

      I believe that finite state macines and graph theory are useful in computer science from the professor's viewpoint, but when it comes to a practitioner, modeling/PDEs are most widely used.


    • * Finite State Machines
      * Graph Theory
      * Numerical Analysis


      Hey! I've never had to do that sort of thinking with Windows Visual Basic .NET. Obvioulsy, you should spend a little and get the right tool for the job - VB.NET makes everything easy! VB.NET handles all the hard stuff for you - like strings and arrays. You can even do 3 dimentional arrays! That's power and ease for you!

      Why just the other day, I was getting stuck declaring a variable, and was just sitting there pondering, and all of a sudden this really smart paper-clip comes up and says "It looks like you're defining a variable!" - He was really helpfull!

      Try VB.NET and you be a much more productive prorammer with only 5% of all that difficult thinking!

      • * Finite State Machines
        * Graph Theory
        * Numerical Analysis


        Hey! I've never had to do that sort of thinking with Windows Visual Basic .NET. Obvioulsy, you should spend a little and get the right tool for the job - VB.NET makes everything easy! VB.NET handles all the hard stuff for you - like strings and arrays. You can even do 3 dimentional arrays! That's power and ease for you!

        Why just the other day, I was getting stuck declaring a variable, and was just sitting there pondering, and all of a sudden this really smart paper-clip comes up and says "It looks like you're defining a variable!" - He was really helpfull!

        Try VB.NET and you be a much more productive prorammer with only 5% of all that difficult thinking!

        (I reposted this because some stupid modaraotor flagged my original as flamebait - it's supposed to be a joke. Maby a poor joke, but that's another issue)
  • I am a student at the University of Minnesota. I have been working with faculity from the physics and computer science departments on and off over the last 4 years. Most of the math we have been taught is not really used in computer science. You have some analysis of run times and memory requirements, but so far nothing that required higher mathmatics. Differental equations have been the most useful to me. They are used in all kinds of different science and analysis of situations (fiscal models are big on them). From what I have seen undergrad CS is an alright intro to the topic, but you do not get to any of the really interesting stuff(iw you need higher level math) until you hit grad school or start working with researchers. Then it is really dependent on who you are working with. I am currently taking a grad course titled "Intro to Parallel Computing" and the most mathmatics we have used so far is stats to look at an omega network... not really exciting or informative.Good class and learning lots of stuff, but not quite there yet. I really think that most of the mathmatics that the students should learn are dependent on the topics they are being taught. Discrete math is very important, but was not very challenging to most of the students that took it. Mostly the mathmatics that are needed for a paticular topic should be taught in the class the topics are presented in. Think along the lines of self contained courses. I know diversity of ones education is important, but sitting through discrete math was a wasted semester. Sets, unions, intersections, and the pigion hole principel are not that hard to understand... and I can not remember when "proving" something was correct was actually useful. (I read a story about how this researcher proved this very short peice of code correct. Three other researchers found MANY errors for how small the code was.) Proving code may have its place but it is not something 99.9% of us are going to be doing with any frequency. What I would have rather seen is software enginering concepts introduced eailer and the chance to actually USE and explore the ideas presented there. /me is still bitter about the poorly run software eng course he took. It was so bad they are totally changing the course. Anyways: -diff eqs are good -software eng good -discrete math good but we DONT need a whole semester -get involved with your profs it is one of the best thing you can do! -The UMN is a great cs school. They listen to their students, have great instructors (we have many that have worked in industry and know their stuff) and is generaly a good place to be (ignoring the code, you are cuddled up next to your sparc station right?) Ben
  • by BadBrainDay ( 597533 ) on Saturday February 15, 2003 @12:01PM (#5308669)
    Set theory is extremely important in "the real world", especially for developers who write in any kind of query language (and really, what developer hasn't had to do that at some point, think SQL, EJB-QL, etc).

    If every developer had a formal background in set theory, I wouldn't see quite so many bad SELECT statements, misuse of joins, etc. Bad queries can be a huge bottleneck in a DB drive application.

    If I had to pick something else, how about a brief (but mathematical) introduction to cryptography? Public key schemes are easy to learn, and very interesting to the average computer science student. We covered this in one of my first math courses in University, and it interested me enough that I went back to take the dedicated crypto course in later years. The knowledge I gained there has been very useful in settig up servers, evaluating products with crypto, etc.
  • by Anonymous Coward
    After 40 years using math for EVERYTHING in my day to day life, including my professional life, I'm amazed at what is most useful.

    The fact is that, after all this time, the most useful and frequently used math isn't algebra, or geometry or calculous, or statistics. The amazing thing is that most of the math is on my fingers.
  • Control theory (Score:4, Interesting)

    by Anonymous Coward on Saturday February 15, 2003 @12:08PM (#5308697)
    My experiences from work...

    There are all kinds of embedded applications that require a lot more knowledge about resonances, loop gain, bode diagrams, filters, etc. than I got in CS.

    Any sort of feedback loop can oscillate or ring if it's designed improperly, and there's a whole science to designing them properly that I wish I'd studied.

    Any sort of modem (includeing cable, DSL, and radio) requires FFTs and filters. Cepstral analysis seems to be incredibly cool given how often it comes up when breaking audio watermarking schemes, but I don't know much about it.

    Group theory comes up a lot in error-correcting codes.

    3-D graphics requires a solid grounding in linear algebra and trigonometry. (And games these days involves feedback loops of NPCs responding to players and each other - see above.)
    • "Any sort of feedback loop can oscillate or ring if it's designed improperly..."

      Aren't some of them supposed to do that?

      And aren't those things you didn't get enough knowledge about in Computer Science the kinds of things that one studies electronics to learn about? Or are we getting into an unresolvable discussion about exactly what Computer Science is?

      • One of my electronics lecturers used to have a rule:

        'Amplifiers oscillate, and oscillators don't'

        You never quite realise how true this is.
  • My university offers exactly what you described should be taught in two lower level, required courses. MACM 101 (approximately the first half of your list) and MACM 201(what is left). MACM is a Math/Computing Science course. Other required math courses are the first year calculus courses and numerical analysis (another MACM course).
  • Don't forget trig! (Score:4, Interesting)

    by TheSHAD0W ( 258774 ) on Saturday February 15, 2003 @01:29PM (#5308964) Homepage
    Trigonometry, and its applications to linear equations, are important to anyone doing 3D graphics work. It's surprising how many people can't visualize sine, cosine and tangent functions nowadays.

    In grade school I had one CS teacher want me to help a fellow student animate a sprite-based ferris wheel on the screen; I used a simple loop from 0 to pi/2 in small steps, with sin and cos functions to place 4 cars on the wheel. The teacher was amazed at how smoothly the wheel ran, and didn't seem to understand how it all worked...
    • Gee, that's useful. If the students don't know trig, they're fucked long before they get to this course.
      • You'd be surprised. I mentioned that teacher, who was in mathematics. I'm sure she knew the functions, and basically what they could do, but just couldn't visualize how they worked with the unit circle and their applications.

        Really, the only way to teach this is to go on to either calculus or linear algebra, and then go BACK and redo trig.
  • This is indeed an excellent question, and I will answer it from my perspective: as a computing phycisist.

    The phycist's approach has changed over the last few decades with the improvements of the personal computer. While there used to be "the theorists" and "the experimentalists", there is now a new group: "the computationalists".

    Phycisists are usually well trained in applied mathematics, calculus, applied PDE's, group theory, linear algebra... you name it, but that's not OUR main problem: we suffer from not being great coders. As a computationalist, I can tell you that many a phycisist will apply brute force and rely on the power of computers to get them the answer by the end of the week, rather than writing elegant, efficient code that might give you the answer in an hour! I suppose this is a little off-topic, but keep on focusing on execution time and algorithms, and spread the good word of computer science to other branches of science. Physics, Chemistry and many of the physical sciences rely on computation, and make huge Beowulf clusters and MPI to do their calculations for them. Perhaps they could save a buck or two, OR get results faster by learning a healthy dose of solid computer science.

    Secondly, I just heard a quote from an unknown source: "There's the right answer and the wrong answer. In modelling, there's the third option: the irrelevant answer". Focus on teaching people what is relevant, and what should be solved by other means than sitting behind a computer.

    • An excellent question and a compelling answer...

      As a computational chemist, I can sympathize with your plight. My undergraduate training in chemistry exposed me to some of the more practical higher maths, and my graduate work armed me with a thorough understanding of Clebsch-Gordon coefficients and the Grand Orthogonality Theorem; yet All I Ever Knew About Computer Science I Learned From Commodore 64 BASIC! Unfortunately, "know" and "want to know" are two different things.

      Nevertheless, I _do_ program and I consider myself a programmer. My meager self-made computer skills provide me with a good intuition about the most straightforward, bare-bones process to solve most computational chemistry problems, since many are inherently serial (equation 1 begat equation 2, etc.). When the problem is more complicated than that, I find my algorithms skills are not quite up to the task. That's not too surprising, since eventually everyone comes across a problem they can't intuit away. What I find most surprising -- and disheartening, too -- is the utter lack of primers to teach scientific programmers the computer science they need. Sure, the basic books on modern programming languages are legion, but go searching for good examples and you'll find little help among the game, database, and web guides. Not everybody is trying to build an accounting system!

      A request to "applied" computer scientists out there: could you please share your mad optimization and algorithm skillz with the hard science types who lack your fine touch? We've been using C/FORTRAN like a sledgehammer because we don't know how to use a chisel.
    • More than that, I'm always amazed at terrible coding pain non-CS people frequently subject themselves to by not using abstraction, source control, simple comments, or even descriptive names for variables and functions. This is in spite of the fact that many of these people do nothing but write code all day long.
  • Quantum Mechanics (Score:3, Insightful)

    by JohnFluxx ( 413620 ) on Saturday February 15, 2003 @02:15PM (#5309136)
    The most interesting course I've ever done is Quantum Computing.

    A very interesting but very difficult course.
  • Linear Algebra, transformations, mechanics, the physics of rigid bodies are all great and very enjoyable when put into the context of computer software.

    Something else that seems to capture my imagination (at least) is the physics of raytracing--materials, specularity, translucency, refractive indices, caustics, radiosity. It's all great stuff to learn in conjunction with OpenGL and DirextX. But what's state-of-the-art? What's the most advanced technique? Teach them some cutting-edge stuff pulled directly out of recently published papers.

    Other things that are tremendously interesting are media compression types--wavelets, fourier transforms, etc.

    Well I think so anyway. :)
  • PROBLEM SOLVING. Generally ordinary math classes don't teach it very well. You learn how to solve a certain type of problem usually, applied to artificial situations (direct questions like find dy/dx of x^2). This is good for learning the basic math, but it is not good for application to the real world until you get a science class such as physics where you get the general problem solving. In a class like physics every problem is stated in words based on a real world situation and you have to extract what it is saying from the real world situation, then use the appropriate equations. In physics math is just a tool to be used to help solve problems. I say physics because that is the science course I took. Additionally problem solving is important because most standard tests (GRE, SAT, company hiring tests) are packed full of problem solving questions. Standard math is not enough to get through them with perfect scores. Additionally after enough math classes and a science classes you pay attention to detail and apply mathematical thought to extract the meaning of a problem.

    Mathematical tools used in CS sometimes:
    - Probability [used in simulations to some degree and algorithm analysis however for most algorithms made by programmers it isn't necessary, and usually if an algorithm complicated enough to need it for analysis is used, it is a standard algorithm with the analysis available in a book. For simulations many times the equations/numbers needed are taken by simple formulas based on frequencies]
    - Combinatorics [used in statistics/probability but can often look up solutions required. Used in algorithm analysis, but usually simple either addition principle or multiplication principle for nested loops. Most combinatorics algorithms are well known though and can be modelled based on a standard algorithm]
    - Induction [most programmers I know run with input instead of using induction to prove correctness]
    - Calculus [ mostly unused by programmers..any transformation on a calc equation is often done by the business users of a system. However differentiation is simple but libs/maple can do it for you. Integration, mostly you use numerical methods since the majority of real world problems can't be integrated...tons of libraries for that. Maple or Mathematica can handle any transformation you can't]
    - Linear Algebra [ tons of good libs to solve equations. and trying to solve it on your own can result in incorrectness ]
    - Numerical Analysis [ most algorithms taught in that class are available in psuedo code from a good algorithm book]
    - Differential Equations [ equations we can solve in class for real are limited. Mostly it comes down to numerical approximation methods see Numerical Analysis]
    - Algebra [Widely used but can get along with out. Comprehension of variables is VERY helpful in learning computer language though so recommended]
    - Logic [ Mostly I found logic obvious, but it is important. Obvious and means both or none, or means either or both, xor and so fourth. Some of demoir's theorems come in handy. For hardware though k-maps and other logic simplification devices are very valuable.]
    - Relations/Sets/Relational Database Theory [I recommend this because relational databases are important and a lot of people working on them still don't understand what a join does or why their query generates a cartesian product and so forth. It is possible to learn relational databases without it, I did just fine. However the math theory would help many misconceptions about it]
    - Number Theory [much of cryptography is based on this. But the typical user doesn't care. Aka RSA used number theory and came up with a recipe Z = (p)(q) and all the rest of the equations. You can look up the mini algorithms used in an algorithm book ( find prime, solve modulo equation, etc. ). However most users would just use a cryptography library anyway so the point is mute ]

    In conclusion I see math as unimportant to a computer programmer in the sense that you can't program without math. However taken as just another tool in a programmer's vast toolbox, math is useful. And knowledge of algebra definitely makes programming go faster than looking up equations or using maple for them. However the mathematical form of thinking is valuable. And problem solving skills are gold. That is the key for being a programmer. So I recommend you all take physics!!! For theoretical work a mathematical background is useful though. For hardware work, mathematics are vital to simplifying the hardware. Knowledge of the standard algorithms and definitely O notation and at least enough algebra to know O(E^x) much much much much much worse than O(n*ln[x]) is good for the good programmer. However most programming work is just logic and looping based on business rules. But there are fun jobs which require more complicated techniques. Most problems can be modeled as a standard algorithmic problem, but it helps to understand the measures of efficiency to know which one to use. it also helps to understand the weaknesses of each algorithm. Don't end up like Rando the demon on Yu Yu Hakusho, he lost the battle for not understanding the weakness of his own stolen technique! Also keep in mind that most higher math is done by specialists and the equations are given to programmers. As one example, statistics work and equations are quite often done by a statistician who has a graduate degree in math/statistics. Accounting equations are often done by an accountant. So for general programming you don't need to know most higher math. But if you are looking to work on theory then yes you should know as much higher math as possible. Then go solve an NP complete problem with a polynomial algorithm so you can make yourself famous!!!!


    And that's the bottom line, because cervo said so...
  • I use Trig everyday, those 3D CAD programs are a pain! ;-)
  • statistics. Useful stuff.

    Accounting. My checkbook. Nuff said.

    My wife also uses Bistromathics.

  • I would include the following: 1) Understanding the logic of programs. You need to be able to understand and state what is true about your program and its intermediate states. I think we should probably teach more program verification, not because automated verification will work in general, but just to get programmers to think about their program is doing. 2) Analysis of algorithms. Read and understand the Cormen book. 3) Numerical analysis/discrete simulation. You want this to understand how mathematics connect the real world to programs.
  • Ignore the specific topics for the time being: let's teach students better problem solving skills or better communication skills.

    Problem solving skills lets you work better independently and makes you an asset to a team.

    Communication skills ensures that you're not wasting team time when you have to ask for help.

    Or how about teaching students how to learn (outside of a class)? New technologies emerge all the time. You are going to have to continue to develop your knowledge once you leave the school. School seems to focus on teaching the current technologies, what about future stuff?

    Not knowing what purpose the DOM serves isn't going to make you bomb your job interview, but not communicating well certainly will! School should teach employable skills.

  • After more than 20 years in the industry I've found Computer Science to be an excellent general preperation for future specialization in a particular field. Computer Science is a major, not a career. As such, the roll of a CompSci track is to give as broad a range of knowledge to the graduate as possible.

    The reality of the situation though is that (unless you are a professional student on the professorial track) once you graduate and get into the "real world" you will immediately specialize. This almost always means taking more classes which specifically apply to the area your in. A System Administrator may program (I do often) but the mathematics I use is entirely different than someone who writes compilers or crypto, etc. In my career I've had the opportunity to have many "specialties" over time.

    When I was programming for a company that integrated shop-floor equipment with their job-scheduling software I had to learn a lot about different algorithms for scheduling complex jobs in and industrial environment. Later, I was involved in writing custom accounting software that required a lot of knowledge in fund accounting. Well, back to school I went... I am currently employed as a Systems Administator and have to use math every day. Some of it I had never learned fully, or had forgotten. However, I do have a good solid background which makes learning "new" math skills much easier.

    I guess what this is all leading up to is that any good CS program should teach a good solid mix of basic mathematics courses and then offer specialized high-level courses that apply to specific "tracks" in the technology world that the student feels drawn toward. I think most CS programs do this. And, although I feel math is extremely important in the computer field, I don't think, for most people, the higher level mathematics courses will be critical to success in a future career. If they have a solid general background they will be able to take specific courses later on to cover areas they may need for specific situations. Contrary to many graduates beliefs, graduation isn't the end of learning, it's the beginning.

    That being said, if I had to pick 2 courses that were MOST consistently usefull to me over time though, I'd have to say logic (boolean algebra, et al), and statistics (all flavors). I don't think anyone can have too many statistics classes as it is so usefull in all areas of analysis, prediction and whatnot.

    Just my $.02
  • It really depends what you're doing. In my limited experience:
    Graphics -> Probability
    Hardware -> Boolean Logic
    Software Engineering -> Graph Theory
    Basically Everything -> Discrete Math

    But the most important skill you'll learn in a CS Math course is to look at a problem and know intuitively if it's possible, and whether it's going to be easy or hard. Exponential search space, but we can limit it to 24-bit integers? Easy. Requires 100-bit precision? Probably doable, but hard if I don't have good libraries. Optimize an 8-input boolean function? A bitch by hand. A bitch to code. Numbers don't matter, we have the best tools of any profession, including mathematicians, for dealing with numbers. It's feeling these values and knowing how to deal with them that is the valuable skill. And, really, a one-semester course can give students a feel for basically anything... if it were my course, I'd skip probability and such, and make them take a specialized class there, and then try to cover boolean loggic, discrete math, and set and graph theory, probably along with some estimation techniques in a non-rigorous fashion.
  • The mathematics that I believe should be taught as the very first thing would be linear algebra - in all its formal glory.

    This may not go over particularly well, but a mathematician that I respect a great deal offered this comment:" Most of mathematics deals with linear things; since linear mathematics applies to a lot of mathematics itself, this should be the very first thing taught. The formal proofs and other mechanics of mathematics are included in the price of admission. And, it has immediate practical relevance. The concepts are simpler then real analysis." ( the basis of the calculus)

    In my work, I found this to be the case. Electrical Engineering is now full of group theory ( abstract algebra of galois fields for error correction, coding, spread spectrum stuff, etc, and it all runs on micros - which is within CS)

    At a guess, I would have to settle for what Knuth considers to be important, or courses which make the reading of the Art of Computer Progamming easier. Not because Knuth is Knuth, but he does have a very practical view of algorithms and their design.

    Other posters have fairly extensive lists as to what they found useful - reading them ( and modding them up) would be a nice gesture!

  • I'm all for the teaching of discrete maths. However, I am against only one type of math. Calculus is great. Business calc is great. Calculus mixed with Trig is something so totally alien, that few students can relate to it, and even fewer will end up with a real-world use for it. That's stuff an engineer might want. The second derivitive of COS^2/SIN means absolutely nothing.
    • The second derivitive of COS^2/SIN means absolutely nothing.

      Actually, it means sin*(csc^2-1)(2csc(csc*cot))... or something... I don't know, and since I'm not in first semester calc anymore, I don't care. Well, I guess trying to be a smartass just backfired. Anyway, all I care about right now are series and parametric equations, the current topic in third semester calculus. Will THAT be used, I wonder?
    • Calculus mixed with trig is fundamental to many kinds of numerical simulation problem. Admittedly, you generally solve such problems numerically rather than symbolically, but still.

  • fwiw, i'm a cs student with a solid background in math (waterloo contest medallist)

    discrete math, boolean algebra, linear algebra, and differential eq's.

    discrete math for creating the habit of asking, "does it work for _all_ cases, or could there be an exception i've overlooked?" i ask myself that way more often than i ask, "is there a way to simplify this conditional test?" and i'm so glad i paid attention to deMorgan's laws. i've never had to use differential equations, or linear algebra, in any of my programming classes so far yet, they have been good training - linear algebra for recognizing that there are _ranges_ of solutions, not just one, and differential equations for recognizing that there's usually a simple pattern buried somewhere in the big ugly mess.
    my favourite example of this: if you write out the formal definition of e^x, wtih x set to pi*i, you'll see (if you step back a bit and squint) two overlapping patterns: one is the cosine of pi, the other is the sine of pi. it's a thing of beauty.
  • It depend...... (Score:2, Interesting)

    by mpechner ( 637217 )

    I've been a generalist for the last 21 years. I've worked multiple indiustries, been everything from architect to team lead, grunt, QA and CM Nazi.

    Most of what I use is boolean algabra. Actually a logic class in the philosophy dept was a killer and helped a lot.

    Anything with word problems. The old junior HS if a train going east.... Or the first semester Calc differential equasions. Anything where a problem is stated and a solution has to be found. anything where you have to get from point A to Point B and show how you got there.

    Set theory is needed.

    The Math learned from "The Dragon" book on compilers was good.

    Being able to do hex/octal/binary math is required with debugging sessions and TCP/IP programming.

    Where a lack of math failed me:

    1. Not knowing graph theory caused me to write a name space browser for Corba naming services the hard way.
    2. Not having the understanding of basic calculus caused me to have some slow learning when I was working with RF engineers in the Cellular industry. Took days to get though certain research papers. I'm one of those CS grads that almost didn't make it becuase of that damn'd second semester of Integrals.
    3. Cartography and the math behind map representations slowed me down at a job.
  • If you get into embedded systems programming, which has a component of electronic engineering, you'll use calculus, including differential equations, to understand how electronics work.

    BTW, when I'm talking about 'embedded' here, I'm talking about the traditional embedded industry: industrial control, security systems, fuel injectors, medical instruments, satellites, etc. There's another so-called embedded industry that's all about set-top boxes and PDAs, but it's a lot less electronics-oriented and less hard-core. Most of the time, when people talk on Slashdot about 'embedded', they refer to the second form. However, if you go buy a magazine about embedded systems (Circuit Cellar, Embedded Systems Programming), it will deal mostly with the first one.

  • A request to "applied" computer scientists out there: could you please share your mad optimization and algorithm skillz with the hard science types who lack your fine touch? We've been using C/FORTRAN like a sledgehammer because we don't know how to use a chisel.

    I already answered to this /. question, but here I go again: The suggestion of the fellow above is a good one. It would be nice if there was a website that would post, store, distribute, collect code, algorithms, mathematical tricks, hints on what approach to take to a given problem. Example: about a year ago I wanted to solve a set of coupled, nonlinear, stiff algebraic differential equations. I found LSODA and other excellent code from Lawrence Livermore Labs, written in Fortran, but after fiddling with the code and entering my problem, the original code didn't seem to want to solve the system for more than ~10 coupled equations, and I needed to solve it for ~1000. I happened to find out about Matlab's implementation of DAE solving, which incidentally uses LSODA, but the implementation was optimized such that it solved my 1000 equation computational problem in a matter of seconds, compared to minutes for the 10 equation problem with the original Fortran code.

    Long story, but my point is this: it would be great if I could go to "www.applied-math-and-cs.com" (that's the name of the site that we should make!) and find out about this instead of spending weeks on the wrong solution and then finding the better way to do it by fluke! I asked many physics and cs-people along the way, but noone could give me this simple advice of using Matlab's interpretation of LSODA.

    Many computational problems are common in the physical sciences. People get introduced to Monte Carlo simulations through the simple explanations of their grad-school professors ("you calculate the probability of the next move based on an Arrhenius behaviour, and move your atom if a random number is less than this probability..."). Sounds easy, but of course you're wasting many many loops when this condition isn't met. Then, you learn about kinetic Monte Carlo which uses every loop... etc.

    It would be nice to have a "resource center" for this kind of problems. Anybody interested in starting this? Or perhaps it already exists? I know about "MUG" (the Maple User Group, out of U. of Waterloo, I think), and this group is good, but too Maple-centric and heavy on the pure Mathematics, but so focused on the applied side.

    • a) There Exists the MIT text book which is excellent and full of algorithms, it is taught to most CS majors in algorithm class. "Introduction to Algorithms" by Carmen et. all. It has been posted in at least 4 other posted in the discussion, including one with a direct link to amazon.com...a recommend the second edition though

      B) Another GREAT book is called "The Algorithm Design Manual" by Steven S. Skiena. It focuses more on the algorithms than a mathematical analysis of them. It teaches you how to model problems. The second part of the book is just a catalogue of algorithms. The revevant part to your discussion is here [sunysb.edu]. It is the algorithm repository. It contains many implementations of algorithms in each langauge. Some implementations have weird licenses but aside from that it is a great site.
  • ...just about every area of mathematics that a typical CS undergrad learns is going to come in handy some day.

    Take, for example, predicate logic. Most of the time, you don't need it. Until, that is, you have complicated business rules to enforce in your program, at which point the best solution is often to encode the rules as axioms and write a theorem prover (or write this part in a logic language, such as Prolog or Mercury, but you still need a grounding in predicate logic in order to use a logic language). Theorem proving also turns up a lot in compilers, in type analysers and optimisation passes, where a transformation may only be valid if some property of the code holds; so you have to prove the property correct before you proceed.

    In the end, though, I think the most important skill for a software engineer is to be able to choose between tradeoffs. Determining what the possible tradeoffs are is something that only comes with experience. (If I give an experienced software engineer a problem, they should be able to see at least three potential solutions to it.) However, the training comes in when it comes to evaluating the possible solutions. Which has better algorithmic complexity? Which has better constant factors? Which uses less memory? Which has better cache locality? Which has better lock contention? And, once you've answered those questions: Under what circumstances are the previous issues important?

    Evaluating possible solutions may in general require all sorts of mathematical skills from the analysis of algorithms, to graph theory, to statistics, to approximation theory, to asymptotics and so on. If there was one skill which isn't currently taught that I'd nominate as vital, it's the ability to estimate (i.e. to perform informed back-of-the-envelope calculations).

    • In my experience, almost none of the formal math training that a typical CS undergrad learns is ever going to come in handy for computer programming. 90% of all software effort is bug fixing, where you don't design a system to implement business rules, you don't in fact design anything. In the remaining 10%, the design is usually handed to you. In the 1% case where you have any kind of designing to do, most of the time it's a simple problem in worst case complexity analysis (Big O) [gamedev.net].

      Anything more is a waste of time for most programmers, at the very least since if they can't learn it as needed then they won't be able to remember it from their college years either.

  • Math is evil. A requirement of math is what kept me out of college in the first place, and I'm sure it's prevented me from getting a technical job, even though I have the skills to do that kind of work better than the glorified sock monkeys that are doing so many of them now.

    Math BAD!
  • Though many types of math are important in programming, the most commonly used is probably boolean logic. if then else.... :)
  • OK, here's my list:
    • Discrete maths (combinatorics, graph theory, etc.) - this maps directly onto many data structures.
    • Linear algebra - used in error-correcting codes
    • Algebra - gives you some more context for understanding linear algebra and error-correcting codes
    • Probability theory - generally useful
    • Analysis - can be used to get good upper/lower bounds - see The art of Computer Programming by Knuth for examples.
    • Formal logic - need I say more?


  • If your just talking about what is used on the job as programmer/software engineer, then logic, as taught in an upper-level math class. It doesn't apply to any problem in particular; but it has taught me how to frame my thoughts accurately and efficiently. Math applied directly to the job would fall in the category of combinatorics, graph theory, and finite state machines.
  • is a great book by Douglas Hofstadter [indiana.edu], primarily about Godel's Incompleteness Theorem and it's applications (or implications?) to AI, and to Logic and math in general.

    This isn't exactly what I'd call `practical' computer math, but I would by all means try to expose people to it. I first heard of it when our Computer Science teacher (12th grade; language was Pascal, to give an idea when this was) read some of it to us, to try and illustrate the concept of recursion and recursive algorithms...

    Reading this book, years ago, first gave me the inkling that mathematics and computer programming could be interesting and cool in and of themselves, and eventually this grew into the impetus to learn more.

    Of course, when you tell people that you really became interested in Computer Science because you were interested in Godel's Theorem, they think you're pretty strange. But, from a learning standpoint, it's easier to learn if you have a genuine interest in something; and for me, it's these strange, paradoxical-seeming branches of math that don't necessarily seem to have any practical applications (like Godel's Theorem, or Cantor's countable and uncountable infinities, or Quine's Paradox) that made the rest of math come alive.

    I'm sure this is a little off topic, because I'm speaking of make I like, not math I use. I just couldn't resist plugging the book that got me interested in math in the first place... A good review can be found here [genie.co.uk], Google will find a lot more. Oh, what the heck, I'll save you a few keystrokes: here [google.com].

To program is to be.

Working...