Introduction
Modern mathematics is just a human language. And, like all human languages, it evolved in a very organic and haphazard way. People created new sub-languages as they were needed, borrowed expressions from other cultures, etc.
Algebra, for example, traces its roots back to the Persian Muḥammad ibn Mūsā al-Khwārizmī's work in 800AD, conveniently titled: The Compendious Book on Calculation by Completion and Balancing.
I have noticed, however, that mathematics has gotten a few things backwards. This is possibly due to the fact that a number of cultures' writing is right-to-left, instead of left-to-right.
Backwards Things
In a left-to-right culture, these things are backwards:
All Numbers!
We currently use "big-endian" numbers (largest digit on the left). "Little-endian" numbers, however, would be a lot easier for left-to-right readers.
You can see why when trying to see the sizes of files:
4694827839 Aug 25 16:12 Dr. Strangelove (1964).mkv 732790784 Oct 8 05:12 Freakonomics (2010).avi 4688461416 Oct 6 18:21 Horrible Bosses (Extended, 2011).mkv 734407330 Oct 11 10:27 Hot Coffee (2011).avi 2580414788 Oct 12 09:03 Howl's Moving Castle (2004).mkv 1565716480 Oct 25 17:42 My Name is Nobody (1973).avi
Here's an experiment -- quickly tell me how many millions this number is:
- 8194717234
Too hard? I'll make it easier:
- 8,194,717,234
Now it's easy! 8,194 million!
But how did you count it? Were you looking left-to-right, or right-to-left? I've found it much simpler to read large numbers right-to-left, since the most the most significant digit is only significant in the context of its lesser digits -- 8 isn't the most important fact about this number; the most important fact is that it's followed by 9 other digits!
So, whenever I encounter a large number in a block of text, my eyes must first skip over the number, read the number backwards, and skip over the number again and continue reading. It's a tiny interruption that breaks the flow of thought. It's a waste of eye-power.
It becomes even more annoying when reading large sets of mixed left-to-right and right-to-left language (eg: spreadsheets).
Functions
At first, functions seem quite natural: f(x) looks fine! You have the function on the left, followed by the thing it's operating on (a parameter).
However, it starts to get weird when you try to chain a number of functions together. If I wanted to find the sin of a number, then the cos of that number, I'd write cos(sin(x)). Since the function is on the left, adding another function to the chain means adding another function on the left side. When I read the expression, I see the last function first. I have to read the list of functions backwards!
Function composition has a similar problem. Take these transformations:
f: A → B and g: B → C
If you want to take something from A → B → C, you'd first apply f, then apply g to the result. However, using the composition operator, we write this as: g ∘ f ("apply g after f"). Wouldn't it make more sense to say g ∘ f ("apply f, then g")?
Those who have programmed in an object oriented language will be familiar with how much more natural it is to chain methods: x.sin.cos.floor.ceil.etc.
Advantages to this approach:
- No need for brackets (which can be annoying to balance)
- Things are ordered by the order in which they'll be executed
The thing you're operating on (x) comes first
Cognitively, this matches how humans think about computations. First you think about the object you want to compute on (eg: people), then you apply the computations in order (eg: people.sort.first). The language reflects temporal ordering.
Could Ruby blocks be improved so that terms are in the right order? eg: people.collect(&:name).max(&:size)
Subtraction and Division
The - and / operations are asymmetric: the order of the terms matters (1 - 5 gives a different answer than 5 - 1).
After using these operators for our entire lives, we don't question the order of the terms. However, after doing lots of 3D programming, the order becomes very irksome. For example, to find a vector from point A to point B, you just subtact them: B - A.
WAIT, why was A to B written as B-A? It's because subtraction is backwards!
Think about a number-line for a second:
[ -100 ----------------- 0 --------------------- 100 ]
The numbers are increasing from left to right. Here's a standard math problem: you're jogging on a path marked by signs. You started at the 4 mile mark, and now you're at the 10 mile mark. How many miles have you travelled?
On the number line, that means you started at 4 and ran until 10. So, you went from 4 to 10. What's the distance from 4 to 10? 10 - 4. See? It's backwards!
I think it's this way because of our big-endian numbers. If you put the biggest digit on the left side, you'd naturally also arrange your number line the same way: big on the left, small on the right. On this kind of number line, our current subtraction operator makes sense. But, given our language's left-to-right ordering, it's backwards.
Division is a bit more subtle, but after you've tried to interpolate lots of vectors, you start to notice it. The forward way of thinking about division is: "How many times does 5 go into 100?" The mathematical version is: 100 / 5. Backwards!
