Live data from Hacker News

For mathematicians, = does not mean equality

jeremykun.com

31–40 of 206 posts

Re: For mathematicians, = does not mean equality

#31
(I assume this was inspired by https://news.ycombinator.com/item?id=16803874)

The use of ‘=’ for assignment in programming languages comes, not directly from mathematics, but indirectly from the use of mathematics in science and engineering. As an example, consider the formula for kinetic energy, commonly written

        𝑚𝑣²
    𝐾 = ───
         2
Why isn't it written 2K=mv², which expresses the same mathematical equality in a smaller, simpler form? Or any of the other equivalent rearrangements? It's because formulas have a convention, where the LHS is a single term naming the value you want, and the RHS contains the terms for values you have. That is, a formula doesn't just state an equality, it states a method for calculating something. That usage predates programming, and was explicitly copied by early programming languages like For[mula]tran[slator] that were designed for scientific & engineering calculations.

Re: For mathematicians, = does not mean equality

#32

Earlier quoted context omitted.

Sure it is, O notation denotes equivalence classes and being part of the same equivalence class is a perfectly cromulent notion of equality.

Big-theta gives you equivalence classes. Big-O only gives you partial ordering. For instance, we might say x = O(x^2) and x=O(x), but we would not say O(x^2)=O(x). Interestingly, in my experience, some people will actually say O(x)=O(x^2), but that seems a bit too abusive for my liking.

Yea, my mistake :)

Re: For mathematicians, = does not mean equality

#33
post #27

There are few more examples that come to mind, like statements about intervals (π = 3.14 ± 0.01) and the usual notation for modular arithmetic; 3 * 3 = 1 (mod 4). Oh, and the wonderful notation for integrals, ∫ 2x dx = x² + C

The usual notation for modular arithmetic uses three dashes, not two, to denote congruence.

I probably should have said "common" notation; it's certainly what I learned. I think you're right in that many authors prefer ≡ to emphasize that it is an equivalence rather than equality relation.

Source that both are in use: https://math.stackexchange.com/questions/196081/the-right-wa...

Re: For mathematicians, = does not mean equality

#34

Operators in mathematics are overloaded in a very similar way to operators in computer science (in languages that permit overloading). I think the author hints toward a good point: there is no use arguing over the meaning of "=" in a general sense, because the meaning is contextual. I think this whole discussion is merely indicative of inexperience on the part of computer scientists attempting to navigate mathematics…

CS already abuses equality all the time with big-O notation. Often you see stuff like f(n) = O(N²), when they mean that f ∈ O(N²). It's fine because everyone knows what's going on, but it's not using it in the sense of equality.

Sigh; it seems it's only programmers who think CS has a monopoly on big-O notation, or keep calling it abuse of notation and trying to use ∈, when it's really = that's the standard notation in mathematics (and for good reason).

Before Knuth popularized Big O notation in CS and started the field of analysis of algorithms, already in 1958 N. G. de Bruijn wrote an entire book on Asymptotic Methods in Analysis (not CS): see a few of its leading pages here: https://shreevatsa.wordpress.com/2014/03/13/big-o-notation-a...

And the notation was already being used by Bachmann in 1894 and Landau by 1909 in analytic number theory, well before computers. It was perfectly commonplace to use big-O notation with the equals sign very quickly: see e.g. this paper by Hardy and Littlewood (https://projecteuclid.org/download/pdf_1/euclid.acta/1485887...) from 1914, well before even Turing machines or lambda calculus were formulated, let alone actual computers or analysis of algorithms.

Re: For mathematicians, = does not mean equality

#35
post #28

Earlier quoted context omitted.

Mathamaticians also abuse big-O in a simmilar way. For instance we might say: sin(x) = x -x^3/6 + x^5/120 + O(x^7) To indicate that the terms we did not write are in O(x^7). Also note that, in this case, we are actually looking at big-O as x->0.

The statement about sine above is not something mathematicians would write. It makes little sense to use big-O notation in this context, as it doesn't say anything useful here: the O(x^7) element absolutely dominates the remaining explicit elements of lower order, so including them tells us absolutely nothing. In fact, sin(x) = O(1). However, mathematicians do indeed use similar notation in this context, that is, lit…

https://en.wikipedia.org/wiki/Taylor_series#First_example

https://www.wolframalpha.com/input/?i=taylor+series+sin+x

Notice that in your example, you have o(x^5) and an explicit x^5 term. In my example I have O(x^7), but no explicit x^7 term. It is true that I cannot think of a circumstance where you want to do this abuse of notation and would care if you were forced to use little-o or big-O instead of the other.

In my experience, it happens to be more common to use big-O.

Re: For mathematicians, = does not mean equality

#36
post #28

Earlier quoted context omitted.

Mathamaticians also abuse big-O in a simmilar way. For instance we might say: sin(x) = x -x^3/6 + x^5/120 + O(x^7) To indicate that the terms we did not write are in O(x^7). Also note that, in this case, we are actually looking at big-O as x->0.

The statement about sine above is not something mathematicians would write. It makes little sense to use big-O notation in this context, as it doesn't say anything useful here: the O(x^7) element absolutely dominates the remaining explicit elements of lower order, so including them tells us absolutely nothing. In fact, sin(x) = O(1). However, mathematicians do indeed use similar notation in this context, that is, lit…

I have definitely used big-O as the parent described. I think many mathematicians would write it in that way.

Re: For mathematicians, = does not mean equality

#37
post #28

Earlier quoted context omitted.

Mathamaticians also abuse big-O in a simmilar way. For instance we might say: sin(x) = x -x^3/6 + x^5/120 + O(x^7) To indicate that the terms we did not write are in O(x^7). Also note that, in this case, we are actually looking at big-O as x->0.

The statement about sine above is not something mathematicians would write. It makes little sense to use big-O notation in this context, as it doesn't say anything useful here: the O(x^7) element absolutely dominates the remaining explicit elements of lower order, so including them tells us absolutely nothing. In fact, sin(x) = O(1). However, mathematicians do indeed use similar notation in this context, that is, lit…

Have you considered that higher orders of x are in fact smaller when x is near 0?

The parent comment was right and you are wrong, around zero x^5 absolutely dominates x^7 and the big-O notation is used. See for example here [1]

[1] https://en.wikipedia.org/wiki/Taylor_series#First_example

Re: For mathematicians, = does not mean equality

#38
post #26
post #19

I agree with the thoughts on the = sign but I'm not so sure about mutations. > If mutation is so great, why do mathematicians use recursion so much? Huh? Huh? > Well, I’ve got two counterpoints. The first is that the goal here is to reason about the sequence, not to describe it in a way that can be efficiently carried out by a computer. Most high level languages try to avoid making the programmer describe the most ef…

>> If mutation is so great, why do mathematicians use recursion so much? > Huh? Huh? The deal here is surely that induction and other recursive approaches are conducive to being reasoned about in traditional mathematical contexts (e.g. taking a walk). Mutation is impossible to keep track of, mentally. Though others' mileage will vary on that.

For the record the "Huh? Huh?" is a quote from the article.

Re: For mathematicians, = does not mean equality

#39
When you say 'i=0', what you mean is that that is the base case, and the sigma specifies a bunch of other cases.

i_1 =/= i_2.

As xg15 noted, it's perfectly fine to say (x=2) => (x + 3 = 5). The problem the first example really addresses is that in mathematics, the namespaces are loosely defined, but in programming they aren't. 'i' can mean several things at once, and it doesn't really matter because those things never really interact in the same context. In programming, you need to specify the name 'i' every time you want to reference it, so it's important that you have a stricter namespace rule.

Re: For mathematicians, = does not mean equality

#40
post #27

There are few more examples that come to mind, like statements about intervals (π = 3.14 ± 0.01) and the usual notation for modular arithmetic; 3 * 3 = 1 (mod 4). Oh, and the wonderful notation for integrals, ∫ 2x dx = x² + C

The usual notation for modular arithmetic uses three dashes, not two, to denote congruence.

At least in my university, in one of the first Algebra courses about integers, factorization and congruence the usual notation is

  3 * 3 ≡ 1 (mod 4)
but in the next year Algebra course about groups and crazy algebraic structures the notation in the group Z_4 is just

  3 * 3 = 1
and everyone understand that you are working in Z_4 (and the * and = symbols are "overloaded" (but no one call them "overloaded")).
Post reply on HN