News for hackers. Stuff that matters.
Re:How Did Anyone Do Math in Roman Numerals? by WalterBright on Friday July 21, 2017 @06:26AM (#14819318)
It's interesting how the notation used can encourage or retard progress. For example, Leibniz's calculus notation was vastly superior to Newton's, and calculus theory advanced much more quickly where Leibniz's notation was used.

https://en.wikipedia.org/wiki/Leibniz%27s_notation

Re:How Did Anyone Do Math in Roman Numerals? by nnq on Friday July 21, 2017 @09:18AM (#14820234)
About this particular case: why hasn't Euler's notation (https://en.wikipedia.org/wiki/Notation_for_differentiation#E...) become the clear winner?

I mean, its the only one that is both not confusing for beginners (because it doesn't trick them into the "cool, let's `simplify` the dx at the denominator with the next one" mindset) and it also translates easily to code (or other 1D encoding), like you can write "second derivative of f with respect to x" as D[f, x, 2] and "integral of a with respect to t" as "D[a, t, -1]".

My point is mainly that there is nothing rational at all in how humans choose notations... without some obscure historic events, we'd probably still be using some derivative of roman numerals or maybe even sexagesimals! (https://en.wikipedia.org/wiki/Sexagesimal)

(I imagine the reason is because "highly performing" individuals have their own "internal" language to think in, so general language is just a for communication, so a political decision... unfortunately for education :()

Re:How Did Anyone Do Math in Roman Numerals? by bonoboTP on Friday July 21, 2017 @09:36AM (#14820402)
I think a lot of my confusions when I first learned calculus would have been eliminated with a notation that clearly expressed that derivatives operate on whole functions, not on values. So the derivative of f(x) at x=0 is not some function of f(0), but it is derivative(f)(x). Also, even without derivatives, sometimes the expression f(x) refers to the whole function, sometimes just a particular value of it at a specific x.

I don't know if higher-order functions are really that tough to teach/understand but I think it would actually simplify and demistify many things.

Currently, of the widespread notations I like this one best:

f(x0) = d/dx (sin(x)*cos(x)+x^2) | x=x0 (with the last part in subscript)

I also miss variable scoping from math writing and it disturbs me that variable names often carry semantics, like p(x) and p(y) can be the probability density functions of random variables X and Y (so p is a different function depending on the name of the input variable that you substitute so it doesn't actually operate on real numbers, but (string, number) pairs). I'd prefer to explicitly mark the functions as p_X(x) and p_Y(y).

Similar things come up a lot with differential equations where you don't really know whether something (like y or u) is supposed to be a function (of x or t) or "just" a variable.

Despite the general opinion among laypeople that math notation is very precise and unambiguous, I find that it's often very sloppy and unless you already understand the context very well, it can easily be misleading. Math notation is somewhere between normal natural language and programming languages, and depending on the writer it may be closer to one or the other.

One can argue that this is necessary for compactness.

Re:How Did Anyone Do Math in Roman Numerals? by noir_lord on Friday July 21, 2017 @09:45AM (#14820466)
I've noticed that I understand what is going on much more when a function is written in code than in its mathematical form.

A lot of that is familiarity but I don't think all of it is.

Re:How Did Anyone Do Math in Roman Numerals? by vidarh on Friday July 21, 2017 @12:20PM (#14821706)
Same for me.

Part of it is the brevity, and part of it is the shortcuts. E.g. when I did my masters, one thing I quickly realised was that papers that expressed an algorithm using mathematical notation almost always lacked essential details.

My impression is that it's too obvious when there are too large leaps in code, whereas in mathematical notation everyone accepts leaps that can obscure that essential details have been left out.

E.g. you'd have papers on thresholding of images for OCR (deciding what is background and what is foreground) where it turned out the results were highly dependent on certain values represented by certain variables that were never defined, for example, putting in a situation of reconstructing parameters by trial and error if you wanted to reproduce the results.

Today I'm immediately suspicious if results are presented as maths outside of fields where the maths is essential (and sometimes even then) as I see it as having a tendency to be used to gloss over sloppy work or save space by leaving out essential details.

I'm sure this is not the case in all fields, and that people with a more extensive maths background will be able to fill in more of those leaps without much effort, and so it might very well be acceptable in some fields. But to me a notation that makes it that easy to hide missing details is a liability.

Re:How Did Anyone Do Math in Roman Numerals? by ashark on Friday July 21, 2017 @10:47AM (#14820935)
Code's easy for me (unless "mathy" in appearance like Haskell) but mathematical notation's always made me feel dyslexic.

I'd love to see this beauty or clarity or whatever that people find in mathematics, but I've never caught even a hint of it. Seems like it needs a good IDE to make up for deficiencies in its language.

Re:How Did Anyone Do Math in Roman Numerals? by noir_lord on Friday July 21, 2017 @01:15PM (#14822161)
Have you see SageMath[0]?

That allows you to use Python inside a mathematical environment and it's amazing.

Saved my bacon a few times when I need to translate maths to code and I need to poke it a bit to get an understanding of how it works.

[0]http://www.sagemath.org/

Re:How Did Anyone Do Math in Roman Numerals? by sn9 on Friday July 21, 2017 @01:18PM (#14822189)
That's because code has documented and testable semantics whereas mathematical notation is more by convention than anything. It's in between natural language and code in terms of ambiguity, but is sufficiently flexible and clear to practitioners that it remains the best way to communicate to other practitioners.
Re:How Did Anyone Do Math in Roman Numerals? by gpawl on Friday July 21, 2017 @02:59PM (#14822984)
syntax, not semantics. Mathematical semantics is quite precise.
Re:How Did Anyone Do Math in Roman Numerals? by nnq on Friday July 21, 2017 @03:44PM (#14823306)
...that's the thing actually: in programming syntax defines semantics because "syntax" is executed and in practice "it means what it does (what is executed)".

(Linguists would want to murder me for saying this, I know.)

That's why some programming languages can even be defined by implementation. (Though as a programmer I try my best to avoid these languages...)

Re:How Did Anyone Do Math in Roman Numerals? by kxyvr on Friday July 21, 2017 @01:05PM (#14822081)
I think one of the problems is that calculus teaches us the ideas that there's an construction called a derivative, but in reality there's lots of different kinds of derivatives with different semantics and types. For the vast amount of applied math and engineering work, the two we need are the total (Fréchet) derivative:

https://en.wikipedia.org/wiki/Total_derivative#The_total_der...

By the way, most of that article is terrible, but the linear map definition is the one we want. There's also the directional (Gâteaux) derivative:

https://en.wikipedia.org/wiki/Directional_derivative

Candidly, unless you really know your problem, we virtually always want the total derivative since it gives rise to things like gradients and Hessians, which are useful objects that we can store in memory.

Now, the reason that I bring these two up is that their spaces, or really their types, are different. Given a function f:X->Y, the total derivative is a linear operator from X to Y:

(total) f'(x) \in L(X,Y)

The directional derivative is an element in the space Y:

(dir) f'(x;dx) \in Y

Now, at this point, the notation is screwed up since we used Lagrange notation for both. The reason that we can get away with this is that under certain assumptions, that are mostly satisfied in the things we care about, we have that:

f'(x)dx = f'(x;dx)

Alright, so why should we care? Leibniz and Newton notation do a terrible job at capturing this information. Lagrange and Euler notation do a good job at this. For your example:

f(x0) = d/dx (sin(x)cos(x)+x^2) | x=x0

The types don't line up because sin(x)cos(x)+x^2 is value, literally a real number, not a function. Using the above, I would write this as:

(x \in R |-> sin(x)cos(x)+x^2)'(x0)

In LaTeX |-> would be \mapsto. This types correctly in the definitions above since

x \in R |-> sin(x)cos(x)+x^2 \in [R -> R]

and

(x \in R |-> sin(x)cos(x)+x^2)'(x0) \in L(R,R)

Of course, you probably wanted the value and not the function, which explains why we cheat in 1-D. So, we really should write:

(x \in R |-> sin(x)cos(x)+x^2)'(x0) 1 \in R

where we feed it the direction 1. And, yes, this is slightly more cumbersome that we may want, which is why there's a huge number of different notations. However, I do assert that the above generalizes properly all the way into infinite dimensions (Hilbert spaces) and provides a good foundation for typing out mathematical codes.

By the way, if anyone is looking for a book that does this right in my opinion, Rudin's "Principles of Mathematical Analysis" is amazing and his notation is good. For infinite dimensions, I prefer Zeidler's "Nonlinear Functional Analysis and Its Applications." Personally, what I look for is what I call properly typed notation that gives us easy access to useful tools like gradients, Taylor series, chain rule, and implicit and inverse function theorems. Again, most engineering and applied math work requires these theorems everywhere, so I find it best to keep them clean.

Re:How Did Anyone Do Math in Roman Numerals? by thetic on Friday July 21, 2017 @07:04PM (#14824387)
On the subject of annoying ambiguities in mathematical notations, I would like to point out the ridiculous convention of inverse function notation.

Is there any sensible rationale for sin^(-1)(x) meaning arcsin(x) while sin^2(x) means (sin(x))^2?

Re:How Did Anyone Do Math in Roman Numerals? by Double_Cast on Friday July 21, 2017 @04:55PM (#14823690)
Since I learned programming, my personal notes draw a distinction between "=" (defines set of coordinates) and ":=" (assignment).

cf.

  f(x) = x^2 + 1
  x := 2
  f(2) = 5
Re:How Did Anyone Do Math in Roman Numerals? by tgb on Friday July 21, 2017 @09:31AM (#14820349)
It's actually pretty common notation in a lot of fields, and mathematicians frequently switch between whichever of these notations is most convenient for a particular problem. Your point of course still stands for why isn't it the main one used in Calculus 1 courses, but it's common in differential equations courses in my experience (and PDE's often simplifies it further to just have D_x f as f_x). And many times where the "derivative" is not necessarily the "calc 1" derivative, you use notation similar to that, for example the covariant derivative [1] is sometimes written like that but with a 'nabla' instead of a 'D'. Some authors even use 'D' for covariant derivative along a path.

[1] https://en.wikipedia.org/wiki/Covariant_derivative

Re:How Did Anyone Do Math in Roman Numerals? by marcosdumay on Friday July 21, 2017 @11:07AM (#14821106)
It's not much more useful than Newton's. The greatest point of Leibniz' notation is that you can do those things such as simplifying dx, or moving dy to the other side of the equality.

It is confusing to beginners, but it's very useful once you understand it.

Re:How Did Anyone Do Math in Roman Numerals? by Maken on Friday July 21, 2017 @12:02PM (#14821561)
What I can't understand is why anybody still used Newton's notation. Also, at least for me Leibniz notation tends to make pen-and-paper symbol manipulation simpler.
Re:How Did Anyone Do Math in Roman Numerals? by slaymaker1907 on Friday July 21, 2017 @11:03AM (#14821074)
I like that the Euler notation makes it more clear that derivation is a higher order function.
Re:How Did Anyone Do Math in Roman Numerals? by CogitoCogito on Friday July 21, 2017 @07:13AM (#14819505)
Notation is extremely important. It's basically a way to organize how you abstract a problem. If your abstraction is "bad" it will be harder to solve certain problems.

It's really not much different everywhere else in society. Different programming languages/frameworks/etc. are doing essentially the same thing (if you ignore the speed of execution). All the languages are Turing complete and can do more or less the same IO. But it's still much easier for people to use certain tools for certain problems than others.

The right notation allows you to focus on what's important and forget what is not.

Re:How Did Anyone Do Math in Roman Numerals? by dmreedy on Friday July 21, 2017 @10:02AM (#14820598)
This couldn't really be stated any more clearly[1]; well put. I'll only add that this is true for any variety of abstraction, natural language included. Abstractions encode the biases of their creators[2]. The 'power' of an abstraction comes from the set of things that are easily and concisely expressible; its primitives. However, this is balanced by the truths that are no longer easily expressible, because the encoding doesn't allow for it. There's a certain intuition that semantics and abstraction are tied tightly in this sense; you don't can't really convey what something means unless it's concisely expressible in the abstraction you're using. Slang, idioms, calculus, etc.

---

[1] and yet, I guess I'll just babble on adding more words anyway...

[2] be they mathematical concepts, programming paradigms, or cultural norms and quirks.

Re:How Did Anyone Do Math in Roman Numerals? by WalterBright on Friday July 21, 2017 @03:50PM (#14823352)
I learned this in designing the D programming language. The original syntax for lambdas seemed natural from a compiler point of view, but from a user point of view it was awkward and pretty much unusable. Changing the syntax was a complete transformation in its usage.
Re:How Did Anyone Do Math in Roman Numerals? by jaymzcampbell on Friday July 21, 2017 @07:19AM (#14819523)
Another excellent example of the power of good notation to aid understanding and increase efficiency is Dirac, or Bra-Ket notation[1] used in Quantum Mechanics.

This allows you to do all sort of calculations with wave functions without constantly grinding to a halt bogged down by integrals and conjugates all over the place.

The ladder operators (aka raising & lowering), really put this notation to good use[2]. It would be tremendously tedious to manipulate such expressions repeatedly without the simplifying properties of Bra-Kets. Once you are done manipulating them you then use the rules of the bra-kets to transform it back into a plain old integral, evaluate, and you're done.

I used to think they were very mysterious until I realised they were (essentially) notational convenience.

[1]: https://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation

[2]: http://www.tcm.phy.cam.ac.uk/~bds10/aqp/lec3_compressed.pdf

Re:How Did Anyone Do Math in Roman Numerals? by criddell on Friday July 21, 2017 @12:38PM (#14821854)
Would you say the same is true for Feynman diagrams in QED?
Re:How Did Anyone Do Math in Roman Numerals? by LolWolf on Friday July 21, 2017 @01:16PM (#14822162)
The same is true in the sense that they're actively helpful in 'hiding away' a large amount of complexity in relatively innocent-looking expressions, though Feynman diagrams are less of a tool of hiding information and more of a computational aide (e.g. it gives rise to a set of operations and a nice way of organizing them).

You could see this as an actively distinct concept (Feynman diagrams are graphs which give rise to some algebraic structure, whereas Dirac's notation is an algebra in itself) or you can see them both as just a means of abstracting away many operations (e.g. in Dirac's notation, this would be multiplication by operators and inner products, both of which are integrals in some sense, as just a non-commutative type of multiplication) in really powerful notation.

Re:How Did Anyone Do Math in Roman Numerals? by ocschwar on Friday July 21, 2017 @10:13AM (#14820670)
Mohammad al Khwarizmi's treatise on Algebra (the word comes from the title of the treatise) was written in plain Arabic prose. No notation at all.

It takes a good amount of intelligence to read it, and it took an amazing genius to write it. But put it in plain notation, and it's a collection of 7th grade algebra problems.

Notation is important.

Re:How Did Anyone Do Math in Roman Numerals? by amelius on Friday July 21, 2017 @07:39AM (#14819587)
I prefer Mathematica's notation over Leibniz's, because it is not as ambiguous (dx can also mean d TIMES x, as a simple example, but also dy^2 can mean d(y^2) and (dy)^2)
Re:How Did Anyone Do Math in Roman Numerals? by jessriedel on Friday July 21, 2017 @09:48AM (#14820487)
I'd go stronger than this and say that Leibniz's notation is actively harmful. It is very useful for quickly doing certain kinds of computations, but at the expense of conceptual understanding for students. Obviously, it's fine to use whatever computational aids you want when you understanding things, but most students are taught nothing but this fragile notation.
Re:How Did Anyone Do Math in Roman Numerals? by nachexnachex on Friday July 21, 2017 @11:16AM (#14821198)
It's useful for solving (or partially solving for a set of conditions) linear differential equations, say in the fields of mechanics or electromagnetism. One can work with dx and dt as if they were just factors and move them around quite intuitively.

In the same line, it's great at shining a light on the substitution rule for integration.

Given that your point that it can be obscure at first remains valid, I'd walk the middle line of introducing students to the f'(x) notation first; and after the introduction to integrals introduce this notation to them.

Re:How Did Anyone Do Math in Roman Numerals? by jessriedel on Friday July 21, 2017 @01:19PM (#14822197)
Yea, I agree that, in addition to computational speed, the Leibniz gives some reasonable intuition for some formulas. However, it can also give bad intuition in a multi-variate setting, e.g., dxdyx/dzdw.

A good self-check is to see if you can convert from Leibniz notation to a more rigorous one at any given step in the computation and understand that step rigorously. Personally, I find that functional notation (using D as an operator on the space of functions, etc.) to be as simple to use and much more likely to alert me when I'm about to confuse myself.

Re:How Did Anyone Do Math in Roman Numerals? by ewanm89 on Friday July 21, 2017 @08:45AM (#14819953)
I would point out it is d because latin typesetters back then often didn't have a greek typeface to print with and it is the closest to the greek letter delta δ. Once one understands it's δx and δy (or Δx and Δy) and today still today most people don't know how to get delta characters on their latin keyboards, then it is easy just to not use d in algebra and use for differential calculus only. Finally (Δx)^2 and Δ(x^2) are the same thing in differential calculus.
Re:How Did Anyone Do Math in Roman Numerals? by jessriedel on Friday July 21, 2017 @09:45AM (#14820470)
> Finally (Δx)^2 and Δ(x^2) are the same thing in differential calculus.

Isn't Δ(x^2) = 2xΔx ≠ (Δx)^2 ? The object Δ(x^2) has one infinitesimals while (Δx)^2 has two, and the number of infinitesimals is conserved. (You can only get finite quantities by taking the ratio of equal numbers of infinitesimals.)

Re:How Did Anyone Do Math in Roman Numerals? by yorwba on Friday July 21, 2017 @09:42AM (#14820440)
If by (Δx)^2 you mean the finite difference (x₂-x₁)² = x₂² - 2x₂x₁ + x₁², then it isn't the same as Δ(x^2) = x₂² - x₁².

If you mean the infinitesimal difference, then Δ(x^2) = 2Δx still isn't (Δx)^2.

Re:How Did Anyone Do Math in Roman Numerals? by tpeo on Friday July 21, 2017 @08:55AM (#14820055)
It really isn't that ambiguous in cursive, though. When writing out "dx" as product in cursive, the "d" and "x" characters are written separately. When writing "dx" as an infinitesimal, the characters are connected. Never had any issue with higher degree derivatives, either.

But I see how it can be confusing with printed characters. I guess Leibniz just took ligatures for granted when he came up with his stuff.

Re:How Did Anyone Do Math in Roman Numerals? by klodolph on Friday July 21, 2017 @08:18AM (#14819767)
A similar notation is Lagrange notation, which is really useful for studying derivatives as a member of a larger class of operators.

The derivative w.r.t. x of f(x) is D_x f in Lagrange notation. It looks a bit like matrix multiplication for a good reason—a matrix is just a representation of a linear operator on a finite dimensional vector space.

Re:How Did Anyone Do Math in Roman Numerals? by blattimwind on Friday July 21, 2017 @07:38AM (#14819582)
An important facet to mathematics in general, that most are unaware of before studying it, is that the majority of proofs, especially those done in bachelor university courses, are purely notation. Other problems often become trivial to solve by using a different notation (e.g. polar form vs. points on the complex plane) as well.
Re:How Did Anyone Do Math in Roman Numerals? by Silhouette on Friday July 21, 2017 @08:46AM (#14819965)
An important facet to mathematics in general ... is that the majority of proofs ... are purely notation.

To the extent that this is true, how much do you think that is due to the notation itself, and how much is due to someone identifying the essential underlying concepts and then making those the basis for a good notation?

Re:How Did Anyone Do Math in Roman Numerals? by yomritoyj on Friday July 21, 2017 @10:19AM (#14820714)
Could you please elaborate. Just to take two elementary examples: the intermediate value theorem and the theorem that any two bases of a finite-dimensional vector space have the same number of vectors. I would have thought that both require mathematical ideas and not just notation.
Re:How Did Anyone Do Math in Roman Numerals? by gpawl on Friday July 21, 2017 @03:04PM (#14823021)
I think what you mean is that most proofs follow easily once proper definitions are chosen. Notation is a visualization of definitions.
Re:How Did Anyone Do Math in Roman Numerals? by isolli on Friday July 21, 2017 @07:40AM (#14819591)
What do you mean by that?
Re:How Did Anyone Do Math in Roman Numerals? by tnecniv on Friday July 21, 2017 @12:08PM (#14821613)
"By relieving the brain of all unnecessary work, a good notation sets it free to concentrate on more advanced problems, and in effect increases the mental power of the race."

-- Whitehead

Re:How Did Anyone Do Math in Roman Numerals? by shuntress on Friday July 21, 2017 @09:52AM (#14820526)
I think it's a bit of a stretch to say that "Better tools/process results in faster progress" is 'interesting'

I think the interesting part is perceiving language as a tool.