3
$\begingroup$

My understanding of operators is it works on elements of a set and produces another element of the same set.

I don't see how or why the "$>,≥,<,≤$" would be referred to as "operators" on some pages as it doesn't map to another element. (I think I've also seen it on Wikipedia as well)

I've always thought of it as a "relation" though. Can anyone shed some light?

$\endgroup$
7
  • 1
    $\begingroup$ "My understanding of operators is it works on elements of a set and produces another element of the same set." That is not correct. Neither your highlighted "another" nor "the same set". An operator is a map. That's all. It performs an operation. $\endgroup$
    – amsmath
    Aug 26, 2018 at 12:16
  • 1
    $\begingroup$ You could say that it maps to $\{\text{true}, \text{false}\}$, I guess. $\endgroup$
    – Eff
    Aug 26, 2018 at 12:17
  • 1
    $\begingroup$ @amsmath en.m.wikipedia.org/wiki/Operator_(mathematics) I think Wikipedia kinda agrees with me. Let's say I agree with you for a sec, but then what does it map to if it's a mapping? $\endgroup$
    – William
    Aug 26, 2018 at 12:18
  • 1
    $\begingroup$ @William Then Wikipedia is definitely wrong. In, e.g., functional analysis, a linear operator maps between vector spaces which might well be distinct. $\endgroup$
    – amsmath
    Aug 26, 2018 at 12:20
  • $\begingroup$ Mathematically, the symbols are usually relations: a < b says "$a$ is less than $b$". However, sometimes the symbols are operators that return a yes or no answer: a < b asks "Is $a$ less than $b$?" The latter is the usage in computer code. Occasionally (rarely?), mathematicians also incorporate these kinds of "logical operators" into formulas (in particular, in summations, where terms are added (or excluded) according to whether they satisfy certain criteria). $\endgroup$
    – Blue
    Aug 26, 2018 at 12:22

2 Answers 2

8
$\begingroup$

In mathematics, you generally won't see inequality signs referred to as "operators" at all.

In programming languages, "operator" means generally any syntactic construct that can be used to build expressions from other simpler expressions. In most programming languages, inequality signs count as operators, because they are used to build expressions with Boolean values.

Note that most programming languages do not follow the tradition in mathematical logic of distinguishing syntactically between terms (which denote mathematical objects) and formulas (which have truth values). They're all just expressions, and whatever primitives they're built with are operators.

$\endgroup$
10
  • $\begingroup$ So I was right? They aren't operators. At least in Math. Cool Idk programming tho. $\endgroup$
    – William
    Aug 26, 2018 at 12:24
  • $\begingroup$ @William: It's not so much that "they aren't operators" in math, as "they almost-always aren't operators". It's not unheard-of for someone to use a relation as a "true/false (or zero/one) operator" in a formula; however, it's probably safe to say that, when that happens, the author takes a moment to explain such usage to readers, who are likely to be unfamiliar with it. $\endgroup$
    – Blue
    Aug 26, 2018 at 12:38
  • 1
    $\begingroup$ @HenningMakholm: I vaguely recall that a famous-ish combinatorist liked using "logical operators" in summations. For instance, choosing to write $$\sum_{k=1}^{100} \frac{1}{k^2} \cdot \left(\text{$k$ is prime}\right)$$ (where "$k$ is prime" is an operator that returns $0$ or $1$) instead of something like this $$\sum_{k=0\\ \text{$k$ is prime}}^{100}\frac{1}{k^2}$$ (which I can't even seem to typeset properly! :), not so much out of programming-jargon influence as from a desire to de-clutter the summation symbol itself and to highlight the inclusion criterion. $\endgroup$
    – Blue
    Aug 26, 2018 at 12:57
  • 1
    $\begingroup$ @Blue: The Iverson bracket is a thing that some people are using in mathematical notation. That does not have much to do with whether your "famous combinatorist" uses the word "operator" to refer to inequality symbols, however. $\endgroup$ Aug 26, 2018 at 13:08
  • 1
    $\begingroup$ @HenningMakholm: I didn't mean to start an argument, what with the end of civilization being imminent and all ... I'll stop typing now. Best regards ... $\endgroup$
    – Blue
    Aug 26, 2018 at 13:24
2
$\begingroup$

This is just a case of infix notation: $$ a < b \quad = \quad <(a, b) $$

$\endgroup$

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.