Math and Programming

12 thoughts
last posted July 24, 2014, 5:56 a.m.
0
get stream as: markdown or atom
0

Resisted the temptation to say "maths" in the stream title in case any Americans want to join in with a combined stream :-)

But I'll probably use "maths" in the content.

0

The extent to which you think mathematics and programming are related depends on what you think mathematics is.

0

I started off my (never finished, might restart it here on TS) Poincaré Project with the following:

Thinking Like a Pure Mathematician

Before we are at a point where we can discuss the Poincare Conjecture itself, we need to learn some general topology and group theory. But before we lay that foundation, I think it is worth taking a moment to establish the mode of thinking we must enter.

Marcus Aurelius exhorts us to ask "what is the nature of the whole, and what is my nature, and how this is related to that, and what kind of a part it is of what kind of a whole?" Now Aurelius is talking about human nature (and see Hannibal Lecter's use of the quotation in Silence of the Lambs) but it encapsulates the fundamental questions asked by pure mathematicians, not of humans, but of abstract objects such as numbers and shapes.

Imagine you're looking at an apple and you notice certain characteristics it posseses. Which of those characteristics are specific to that particular apple? Which are specific to all apples of that particular variety? Of apples in general? Or of all fruit? Of food? Organic objects? Physical objects?

In mathematics in general, and in the early days of this Poincare Project in particular, we will often be asking questions like: what is the most general object that exhibits this characteristic? What is the distinguishing characteristic of this object compared with others we're dealing with?

Get your mind in a mode to ask those kind of questions and we'll be ready to introduce topology.

0

To me, that's the heart of mathematics. But I also think it's the heart of programming.

0

Incidentally, I also think it's the core of music theory (which is why I'm working on an introduction to music theory for programmers).

0

If you think of maths as arithmetic (which is what the general population often does) then there's lots of programming that doesn't seem much like maths (although that's less true the closer you get to the metal).

0

Algebra (in the high school sense) is interesting because if you just think about algebra as learning that you can manipulate, combine and understand the properties of certain things even if they are black boxes then you're kind of doing programming.

0

If you associate maths with trigonometry, it might seem a little stretch to associate with programming (although in my own case, my motivation for learning trig was to do graphics programming).

But if you think about the fact that trig comes out of an observation that you can say a lot of things about triangles knowing only the ratios of the sides rather than the actual lengths of the sides, you start getting into more programming-like skills.

0

I'll warrant calculus is a little more of a stretch but still, a fundamental part of differential calculus is this notion of an operation on one function producing another function. I actually think that's one example where a certain concept in mathematics is easier for programmers to grok.

0

You don't need to get very far in topology or abstract algebra before you're basically defining type-hierarchies and interfaces.

0

The fact you can think of a metric either as a mapping of two vectors to a scalar or as a mapping from a vector to a one-form sounds an awful lot like currying (as I've pointed out before).