21
$\begingroup$

What does := mean?

  • 15
    Generally it means "is defined to be equal to."2011-03-05
  • 3
    It's one common notation for stating that the left-hand side is *defined as* (in contrast to *equal to*) the expression on the right-hand side.2011-03-05
  • 7
    For future reference, the [table of mathematical symbols](http://en.wikipedia.org/wiki/Table_of_mathematical_symbols) at wikipedia is fairly extensive and has a number of further references.2011-03-06

2 Answers 2

33

It is borrowed from computer programming: it means that the item on the left hand side is being defined to be what is on the right hand side. For example, $$y := 7x+2$$ means that $y$ is defined to be $7x+2$.

This is different from, say, writing $$1 = \sin^2(\theta) + \cos^2(\theta)$$ where we are saying that the two sides are equal, but we are not defining "1" to be the expression "$\sin^2(\theta) + \cos^2(\theta)$".

Basically, some people think that there should be notational difference between saying "I define blah to be equal to blankety" and saying "blah is equal to blankety". So they use := for the first and = for the latter. Usually, it is clear from context which of the two uses of the equal sign is intended (often because of signal words like "Let", "We define", etc.)

  • 5
    Are you sure it comes from CS? I study CS and see $:=$ mainly in maths/theory contexts. Programming languages use `=` and `==` nowadays. I have also seen $\leftarrow$ in the context of formal semantics, but hardly ever $:=$.2011-03-05
  • 0
    @Raphael The `:=` is used in pseudocode.2011-03-05
  • 0
    Some remarks: (a) usage of := is not universally accepted in mathematics (b) it's best to avoid the use of e.g.: "Define y:=7x+2", where the "define" appears twice.2011-03-06
  • 0
    @Raphael: The use of `=` and `==` dates back only as far as C, which was the first to use `=` for assignation and `==` for comparison. `:=` was used in Pascal, among others.2011-03-06
  • 5
    FORTRAN used = for assignment and .EQ. for comparison. ALGOL used := for assignment and = for comparison. I'm showing my age.2011-03-06
  • 0
    PL/SQL (Oracle) also uses := for assignment.2011-03-06
  • 0
    := is used in Mathcad to mean " equals by definition.2011-03-06
  • 0
    Seconding Douglas's comment, $:=$ is nowhere near a universal convention (I assume this is what he means by "accepted"; many people "accept" it but do not themselves use it). As the OP's experience shows, it is good practice to explain what it means, once, before using it in writing. I have no idea of its history but my impression is that it does not predate computer programming. (It seems more popular with younger people and people who use computers than with others.)2011-03-06
  • 1
    @Raphael: Perhaps "computer programming" is a better description for what I had in mind, so I have changed it as such. As far as I am aware, it was indeed derived from certain computer languages that used `:=` for assignment.2011-03-06
  • 4
    Other symbols I have seen used for "is defined to be equal to" are three horizontal lines instead of two, and $=$ with either a triangle or "def" written directly above it. I have seen variants of these used by people who predate widespread knowledge of computer programming. It would be interesting to know the earliest uses of a special symbol for this (and what symbols were chosen). An advantage of $:=$ is that it has a partner, $=:$, allowing it to distinguish *which side* is equal to the other by definition. Nine times out of ten it is the left, but the flexibility is nice.2011-03-06
  • 0
    In my experience, most mathematicians prefer to reserve $\equiv$ for equivalence relations (as in $x \equiv 3 \pmod{4}$).2011-03-06
  • 1
    "The Comprehensive $\LaTeX$ Symbol List" (http://www.ctan.org/tex-archive/info/symbols/comprehensive/symbols-a4.pdf) says: "discussions on comp.text.tex have revealed that there are a variety of ways to indicate the mathematical notion of “is defined as”. Common candidates include “$\triangleq$” (\triangleq), “$\equiv$” (\equiv), “$:=$” (various), and “$\stackrel{\text{def}}{=}$” (\stackrel{\text{\tiny def}}{=})."2011-03-06
  • 3
    I was aware of Pascal using `:=`, but not the others. I think it is possible that the language designers of that time where influenced by maths (as has happened a number of times), but `:=` is so far the only easily typable symbol mentioned here, so it is perfectly reasonable to assume it stems from programming languages in the first place. For completeness, I have seen an older TCS-prof (former mathematician) use $=_{df}$ consistently. There might have been an e in there, but not legible.2011-03-06
  • 0
    Mathematica also uses := for creating dynamically evaluated functions. f[x_]:=x^2 evaluates independently every time f[2] is requested, while g[x_]=x^2 evaluates only once and stores the value to be recalled upon request. If g is changed in the future, the original value that was requested is returned. Individual needs determine which one wins the time vs. space efficiency battle.2011-03-18
  • 0
    I think it comes from `Pascal` as mentioned above, but I am trying to think of any examples of languages proceeding pascal with the same notation. I cannot think of any.2011-03-18
  • 0
    I have also seen following$\triangleq$, $\equiv$, $\cong$, $\doteq $ \: perhaps it means equal in value, congruential, or numerically equal but not numerically identical events, or equal as a comparability relation (congruence) or in order theory,. Something short of '=', which in a total order which means identity Inumeriacl identity of the events)a2017-10-12
  • 0
    lthough entities can have the same number and be numerically equal in value but not numerically identical, identical (so its a little confusing as to what '=' means in a total order, particular if multi-imensional. where both orders are numerical,particularly when \equiv which is defined as the identity symbol is often used for the weaker 'equal in value' between two events whose values in the domain rank are numerically equal yet are not numerically identical events (and particularly given that $\equiv $ is often defined as 'identity'as above not just equivalence or congruence2017-10-12
2

I think the Bourbaki used it first.. not sure.. I know physicists use $\equiv$

  • 1
    I use $:=$ for definitions and $\equiv$ for identities. In the latter case, I think of the symbol as being $=$ with emphatic underline. :) (If it matters, I'm not a physicist.)2011-03-19
  • 1
    $\equiv$ is indeed used by physicists as "is defined as". In modulo arithmetic it is also used as "is equivalent mod (integer subscript of $\equiv$)". For example, writing $8 \equiv_{3} 2$ means "8 is equivalent to 2 mod 3". It is also used to signify more general conruence relations. I would recommend that you not use $\equiv$ as an emphatic identity, @DayLateDon, to avoid confusion when sharing your work with others.2011-10-25
  • 0
    @karmic_mishap: I picked up the "$\equiv$ for identity" thing from somewhere I can no longer remember. "Emphatic equals" is just how I explain it to myself. :)2011-10-25
  • 0
    Come to think of confusion ... I recall years ago as a teacher writing "?" above the equals sign of a to-be-proven identity, and then post-proof, replacing "?" with "!". ("Are they equal? Indeed!") I'd seen this elsewhere, too. Of course, that's a particularly bad idea nowadays, with "!=" the modern shorthand for "not-equals". It's curious --and unfortunate-- that the symbol for emphasis became the symbol for negation. Granted, ASCII isn't the richest glyph set, and coders needed *something*, but why settle on the symbol that means in prose the exact *opposite* of what it means in code? Irony?2011-10-25
  • 0
    @Blue I think `!=` was chosen because it somehow resembled $\ne$ where `!` "strikes through" `=`.2014-11-18
  • 0
    @Ruslan: My question was *mostly* rhetorical and/or comical, as I believe you are correct that `!=` is meant to resemble "$\neq$". Of course, non-coding uses of `~`, `@`, `#`, `%`, `^`, etc, differ considerably from their coding counterparts; even so, re-purposing "percent" as "modulo" seems somehow less disconcerting than *completely inverting* the (for lack of a better word) "intrinsic" meaning of `!`. I wonder what the language designers thought of this; did they just shrug it off? did they relish the irony even a little?2014-11-18
  • 0
    @Ruslan Interestingly, Apple's new Swift programming language uses `?` to represent optional (possibly-nil) values, and `!` to indicate non-optional (definitely-not-nil!) values. So, there, `!` is the symbol for negation *and* emphasis!(!)2014-11-18