65
$\begingroup$

What does := mean?

$\endgroup$
4
  • 27
    $\begingroup$ Generally it means "is defined to be equal to." $\endgroup$ Mar 5, 2011 at 22:32
  • 4
    $\begingroup$ 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. $\endgroup$
    – cardinal
    Mar 5, 2011 at 22:33
  • 7
    $\begingroup$ For future reference, the table of mathematical symbols at wikipedia is fairly extensive and has a number of further references. $\endgroup$ Mar 6, 2011 at 2:11
  • 1
    $\begingroup$ careful. the fist two comments seem to say that := says that the equality holds by definition. that would be wrong, the statement is not an equality at all, but it IS a definition. $\endgroup$
    – peter
    Nov 22, 2021 at 2:23

2 Answers 2

74
$\begingroup$

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.)

$\endgroup$
21
  • 8
    $\begingroup$ 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 $:=$. $\endgroup$
    – Raphael
    Mar 5, 2011 at 23:24
  • 8
    $\begingroup$ FORTRAN used = for assignment and .EQ. for comparison. ALGOL used := for assignment and = for comparison. I'm showing my age. $\endgroup$ Mar 6, 2011 at 3:27
  • 1
    $\begingroup$ @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. $\endgroup$ Mar 6, 2011 at 5:02
  • 4
    $\begingroup$ 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. $\endgroup$
    – anon
    Mar 6, 2011 at 5:02
  • 3
    $\begingroup$ 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. $\endgroup$
    – Raphael
    Mar 6, 2011 at 15:36
5
$\begingroup$

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

$\endgroup$
11
  • 1
    $\begingroup$ 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.) $\endgroup$
    – Blue
    Mar 19, 2011 at 0:36
  • 3
    $\begingroup$ $\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. $\endgroup$ Oct 25, 2011 at 19:16
  • $\begingroup$ @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. :) $\endgroup$
    – Blue
    Oct 25, 2011 at 21:28
  • 1
    $\begingroup$ 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? $\endgroup$
    – Blue
    Oct 25, 2011 at 21:38
  • 1
    $\begingroup$ @Blue I think != was chosen because it somehow resembled $\ne$ where ! "strikes through" =. $\endgroup$
    – Ruslan
    Nov 18, 2014 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.