When devising a program in order to “solve” or analyse a particular mathematical theorom, how can you determine how much computer memory or speed is required?
Or what about on an extraordinarily large or complicated calculation? Who decides (and how) what the specifications of the hardware will be?
I know (from a previous thread I started) that many applied and pure mathematicians must learn how to code as part of thier job(s).
But how much do they have to learn about the hardware?
As I understand it, the software is several layers of abstraction away from the hardware. So therefore on basic terms, you don’t really have to know the in-depth details of the hardware in order to code.
But then for calculations of such a large size, who determines the type/construct of the computer hardware that will be used?
Does the situation ever arise where the specs of the machine are not up to scratch as originally thought? What happens then? Or is it all planned out and runs perfectly smoothly every time?
And generally, how much do mathematicians know about the hardware of computer systems?
Generally things like paging from memory are handled by the OS and it may not be neccesary to be intimate with the hardware to write an application. Some elements such as precision of integers and floating point numbers is tied to hardware. In this case it’s possible for a C program to get a different result on different hardware due to rounding differences.
There are techniques for analyzing software that predict the number of calculations and the amount of storage space necessary for doing the calculations, based upon the size of the input. Usually you can’t get an exact value, but you can get an upper or a lower bound. You look at the hardware available to you – and at what cost – and see if it’s suitable for what you need. Sometimes you need to alter your algorithm in order to make it work on the resources you have.
Mathematical programmers are very likely to need to be aware of floating point error and the related issues. But knowing how much memory is required doesn’t require knowing anything about how memory works.
I’d guess that in a lot of cases the programmer simply assumes that “If my program compiles successfully, it’ll run.” If there’s a problem during execution (e.g. insufficient memory) it may indicate the need for better hardware.
IOW, most such problems can be dealt with as encountered, and need not be anticipated.
I would venture to say that it’s more important for applied mathematicians who are crunching massive numerical analyses through computer programs to have a working grasp of how to use memory, rather than how memory works. After all they’re not in chip design.
For example, in C++ it is very easy to write code which is implicitly doing a lot of “deep copying” of structures in lists and arrays, and use of deeply recursive code to implement an algorithm will also be constrained by memory in a way that an iterative solution would not be. Similarly, the decision to use a list instead of a vector (or vice versa) can have a significant impact on the execution speed of the program.
For any programmer who works with large-scale data collections, this is far more relevant a topic than choosing between SDRAM and DDRAM.
Mathematicians who program (and there are a lot, as recently discussed on this board) generally think of things at a very high level of abstraction, much like a lot of programmers do. The effort to absolutely optimize routines for specific hardware really isn’t worth it. Also, a lot of this programming goes on in predefined tool suites like Maple, Mathematica, or Matlab, and the programmers of those have already done most of the optimization of the stock routines.
As for how much they know about computer hardware, it constantly confuses me that people think mathematicians don’t know anything but mathematics. Did you ever sit and think that a fair number of us may have taken a few high-level computer science courses in our studies? Maybe even minored or majored in that discipline?
Indeed. It is, after all, the handmaiden to the Sciences.
(My wife is a mathematician and I like to irritate her with this phrase… endearing, isn’t it?)
Seriously – even in her field of pure (not applied) math, which is Riemannian Geometry, there is considerable overlap with Physics and most people in her field have at least the equivalent of a Master’s in (theoretical) physics. If there were any sort of application for her field it would be in developing the Warp Drive.
And in the field of applied mathematics, many doctoral candidates come into their programs with undergraduate degrees in engineering or a science (physics, comp sci) rather than Mathematics.
I have no idea what the motivation behind the OP’s question was. (And would be interested to read it if the OP would care to elaborate.)
Most mathematical programming would probably be run on the machine that happens to be sitting on the mathematicians desk at the time. The mathematican probably doesn’t particularly care about the specifics of it.
Mathematics programs tend to be written in a domain specific language such as Maple, Matlab or Mathematica which aren’t especially noted for being fast.
You know how when you know very little about something, the effect is exaggerated?
Like if you see a very large wave coming towards you, and you don’t know its exact dimensions, you percieve it to be as big as the earth? I think a little of that is going on here.
Being a newbie to both subjects (math & computer science) I’m pretty much amazed at just how in-depth some of the technical explanations can be. What seems more amazing is that I know many of you (or at least, many of the math people I’ve come into contact with) will have learnt this information in the matter of a few years.
So I’m constantly thinking, how the heck do they learn all this stuff? Especially given the time frame most of them do it in. It seems like they’re having to connect a very wide range of fields together (at least from the point of view of a non-technical observer). So yeah, I guess it seems a little mystical to me.
But after a while, you get bored of being in awe and feel like asking questions. I know some of my awe will come from the simple fact that I don’t know much at all about the topic being discussed (like the cave man viewing a set of equations on a blackboard) - so I guess part of the trip is to educate myself. And for me, the first point of call is to ask WHAT it is exactly, that these guys know. Coz you can’t know everything (assuming :)).
So it’s sort of like filtering out those elements that are necessary to a mathematicians daily work - or thinking strategically about my queries, if you will.
Anyhoo, I think this covers robardin’s Q’s on the matter as well.
There’s an old joke that the math department is the second cheapest department to fund at the university because all they need is pencils, paper, and wastebaskets. The cheapest department to fund by far is the philosophy department, as they don’t even need the wastebaskets.
From my time at school, it seemed the most important asset to a research mathematician is a large collection of books, presumably so they can look stuff up and not have to memorize it. Add to that a blackboard and lots of scrap paper, and maybe a programming environment, although some were dead-set against it.
Indeed, a lot of mathematical programming is done in those specialized languages, which, though slow, are really suitable to the purpose, but sometimes you want to be able to write faster code. Right now, I’m working on code written in C++, and most of my work is trying to optimize my algorithms to make the code go faster. Of course, this doesn’t require knowing anything about the hardware, rather, it requires to be able to find the most costly operations and minimize the number of times I have to do them.
However, sometimes I have to take into account hardware considerations when writing code. For example, in the particular case of my current work, if I use a direct method to solve my linear equations, it will take less time, but it will also take much more memory, and the computer won’t be able to handle computations in three dimensions. So I have to figure out a good iterative method, which will not be too much slower but will take much less memory. Of course, again, this doesn’t require to actually know how memory works. (And in my case, since we use a commercial code to solve our systems of equations, it simplifies my work even further.)
On the other hand, I’d like to know what is the OP’s experience with mathematics and computer science. He says that he’s new to those subjects and is impressed with how much stuff we know. Yes, I’m also impressed with how much stuff my supervisor knows, and I don’t see how I’ll ever be able to learn all of this. (The fact that my supervisor is an applied mathematician and thus is a specialist of math but also knows a lot of things about physics, engineering and biology/physiology doesn’t help.) But what is the OP’s precise experience? Did he just recently start working with research mathematicians and is he amazed in the same way that I am? Or is it something else?
OK, lots of good questions. I’m trained and I work as an applied mathematician. I’ve also taken my share of comp sci courses and have worked as a systems analyst/programmer early in my career. Nowadays, I do write code, but not the production code that is sold to customers. I come up with the math and algorithms, and write code (sometimes just pseudo code) to test everything. When I’m doing all this, I really don’t give much consideration to the ultimate hardware in which the math will be implemented. After all, the ultimate users can have a wide range of hardware configurations. I do, however, design the algorithms to work as efficiently as possible, factoring in how I expect the data to be stored and retrieved. There are times when the engineers (the people who get paid to write code) have asked if changes can be made in the algorithms in order to reduce resources (mainly cpu cycles), and I have made adjustments accordingly. The trick has always been to make such changes without materially impacting the desired mathematical results. And I should point out that the engineers have good math backgrounds, although they don’t have the deeper knowledge in the application space or in the mathematical optimization techniques that I have. But they have greater expertise in hardware and software development. So it’s a good working relationship.
Myself? More than most people in the world, but far from expert. There really is no “average” pure mathematician, since differences in field and approach lead to wild variations.
When I do use a computer (not often) it’s strictly algebra. I really have no need for numerical analysis at all. On the other hand, if the need does arise, I know where to go to find out exactly what I need.