Today seems a bit slow, so I thought I'd throw out a bone to chew on.

A few days ago, someone posted a question about allocating items to buckets so that all the buckets were as close as possible to the mean value of all the items. There were a wide variety of answers, depending on how one understood the problem mathematically. Answers ranged from proposals for everything from random generation of N arbitrary solutions to dynamic programming (a technique that breaks down the problem space into mathematically distinct subsystems and then selects an algorithm suitable for each).

The problem attracted only moderate interest (if rep is a measure), but that may have been because the problem seemed too theoretical. In truth, the solution has a wide variety of practical uses. For example:

So my questions for the day are:

Best, beth

  • Comment on Maths, Analysis, and Practical Programming

Replies are listed 'Best First'.
Re: Maths, Analysis, and Practical Programming
by moritz (Cardinal) on Feb 05, 2009 at 16:10 UTC
    The problem attracted only moderate interest

    That might be the case because we had at least two somewhat lengthy discussions about two similar questions that fall into the same category of NP-complete optimization problems (during the last 6 months I think).

    when do you find yourself, if ever, drawing on both mathematical understanding and programming smarts and how do you see the two related?

    These days I'm writing simulations for electronic transport on small scales, and that certainly requires strong mathematic background, mainly in linear algebra.

    The programming itself isn't all that complicated, but still demanding, because it's very hard to obtain test cases, and because we're working at the limit of our available computing resources.

    From a design point of view they are simple, because they are "just" initialization of matrices, and then various operations on these matrices - something for which a simple procedural setup works very well.

    Does it happen more at work? more on your own personal programming projects?

    My university projects tend to require more skills in analysis and linear algebra, while some personal projects involve combinatoric problems, or require more design skills (something which I severely lack).

    What did you find yourself learning (mathematically) after school as part of your programming survival kit?

    I found some of the discrete mathematics quite interesting that Knuth teaches in his first "The Art of Computer Programming" volume. That said, I had a rather good mathematical foundation when leaving school (that covered 90% of what I needed so far for "normal" programming), so I didn't do very much in that direction.

    And finally, how does Perl as a language help or hinder you in those rare (or maybe not so rare times) when you need to think both theoretically and practically at the same time?

    Since Perl helps me to do what I want, it is very helpful - but not more helpful than in other areas, and not ideal for my numeric calculations either.

Re: Maths, Analysis, and Practical Programming
by ack (Deacon) on Feb 05, 2009 at 17:56 UTC

    I am occasionally astounded how nodes in PM align with things I have been pondering in my day-to-day life.

    This node is an excellent example of that alignment.

    Just yesterday I was discussing some of our Perl programming for our work and we were both quietly (and somewhat conspiratorially) noting that we both occasionally need to "geek out"...I tend to "geek out" with my fascination for Perl and all that it can do, he "geeks out" on learning new things that apply to our work...e.g., the mathematics behind Convolutional encoding of communication transmission.

    My background was in Math and Physics (in school); his is electrical engineering. We are close friends and continually provide mutually-reinforcing challenges to each other. It turns out that Perl is a strong backbone of that friendship. He learned Perl several years before I undertook it; I watched him using it and we talked a lot about it and I "caught the bug."

    What we both experience with Perl is that it is both powerful and easy. He tends to stick with the basics and crafts Perl into some outstanding applications and tools. I am attracted to its intrace twists and twirls and craft applications and tools.

    What we have both found is that inspite of programming experience with quite a few other languages, Perl has never ceased to provide all the power and capability that we need. We use if for testing and exploring the behavior and performance of spacecraft and for a lot of space mission supporting activities (e.g., simulating navigation, guidance and control schemes, testing new ideas or exercising existing ideas in a variety of space mission challenges, and simulating both environmental influences on spacecraft and the spacecrafts' reaction to various influences.

    The nature of our work results in a non-stop need to grow and learn...especially mathematically. So, between the two of us, we are almost always in positive-feedback loop of mathematical interests and testing our knowledge of what we understand and have learned.

    Perl is such a powerful catalyst for our learning and growth...both in terms of providing such a rich environment for trying ideas and testing our understanding and as a medium in which we can translate the knowledge into real-world applications and tools.

    I think that, at least for me, I had a strong mathematical background coming out of college; but I have also found that rarely did any of the organization of mathematics and mathematical knowledge in college, prepare me well for how to find the mathematics we often need to accomplish work. I had a lot of theory and the organization of the "learning" in college was topically motivated rather than "you've got a problem, how do you find the math to solve it". This is especially notable in my work where almost every problem is not redicible to a single mathematical solution...it requires blending, meshing, and sometimes abstracting to bring the right mathematics to bear.

    So I would have to say that, in my case, the mathematics I was taught in college prepared me well in the sense of having seen and understood the theory, but ill-prepared me for how to wade through the morass of theory to find solutions to my day-to-day problems.

    I don't have a formal CS background, so there isn't much I can add in terms of your interesting inquiries. When I went to graduate school they did not have (at least at my college) an formal courses in *any* aspects of CS. The closest was to study electrical engineering where we at least got to see, build, design, and work with computers. So, over the years, I have to try to self-educate myself on topics that for most of today's graduates I would presume is almost second nature. Of course now I've truly place myself into the dinosaur era! ;-)

    My friend and I, yesterday, were musing over almost the exact topic that you inquired about. Deja Vu all over again (as some brilliant person once noted)!

    ack Albuquerque, NM
Re: Maths, Analysis, and Practical Programming
by dHarry (Abbot) on Feb 06, 2009 at 11:17 UTC

    * when do you find yourself, if ever, drawing on both mathematical understanding and programming smarts and how do you see the two related?

    The last few years I use both a lot but I don't see a strong relationship. IMO they are two different things.

    * Does it happen more at work? more on your own personal programming projects?

    It is my work:-) I don't have too many private projects, prefer to spend my time on exploring Spain/Madrid and play chess.

    * What did you find yourself learning (mathematically) after school as part of your programming survival kit?

    For me it was the other way around. I am a mathematician and picked up programming along the way. Many courses/workshops/etc. but the best way of learning is experience. Nothing beats experience IMO. When I do run into a difficult Math problem the Internet and colleagues help me out.

    * If you did a CS degree, did they get the mix of theory right? Or was there theory that should have taught and wasn't?

    I have looked at Master programs in CS and found the math component always a bit weak (compared to a math Master program). But that's not a problem at all. We all have our different expertise. My Physics knowledge is weak so I ask others. You cannot expect to master everything, that's why we work together. If you run into a tricky Math problem ask a mathematician!

    * And finally, how does Perl as a language help or hinder you in those rare (or maybe not so rare times) when you need to think both theoretically and practically at the same time?

    I started relatively late with Perl. For me Perl is a great aid. I can pretty much do everything in it I need and it is the perfect glue, e.g. combine Fortran, C and other stuff into one working app. It's also very good for prototyping. I work on problems related to Physics, Math and CS and so far so good.