Does logical-AND have precedence over logical-OR because of a reason or was it an arbitrary choice made sometime in the distant past?

(Perhaps it could have been the other way around: OR-terms evaluated first, then AND'ed together?)

I've Googled and can't seem to find an answer; most mathematical and computer language references state the precedence rankings of various operations but not the origins.

NOTE: I don't believe this question has anything to do with notation, but rather the order that operations are performed.

  • 1
    $\begingroup$ I don't believe this question has anything to do with notation, but rather the order that operations are performed. I don't think this is right. It's purely a notational thing. It's a rule about how to interpret the order of operations given the notation. $\endgroup$ – Ben Crowell May 10 '15 at 14:04
  • $\begingroup$ This WP article en.wikipedia.org/wiki/Logical_connective#Order_of_precedence says that the precedence you refer to isn't standardized. $\endgroup$ – Ben Crowell May 10 '15 at 14:04

"And" is often seen as the multiplication in Boole's algebra, sometime written $\times$ and "Or" is seen as the addition (and sometime written $+$, though $+$ is more often used for xor than for or), which is why they commonly inherit the precedance of their namesakes.

Note that both are distributive over the other, and it's the neutral element (0 for or, 1 for and) that gives the correspondance.

So the next question that has to be addressed is why multiplication usually has precedence over addition (note that some programming languages, notably, do not follow this convention).

It seems to have arisen from a global consensus, mainly over concerns of simplicity of writing polynomials, but wasn't formalised until the 20th century. This is because mathematicians don't care so much about precedence, but wider teaching of mathematics in textbooks, as well as the rise of IT-science, have made it compulsory to formalise these rules.

| improve this answer | |
  • 3
    $\begingroup$ +1 it goes back to Boole. Of course Boole did not use a star $*$ for and, he used the normal notations for multiplication. Say $xy+z$ meaning "($x$ and $y$) or $z$". $\endgroup$ – Gerald Edgar May 7 '15 at 15:55
  • 1
    $\begingroup$ The next question is where the multiplication/addition convention in algebra came from, there is a well sourced answer on Math Forum mathforum.org/library/drmath/view/52582.html. It "appears to have arisen naturally and without much disagreement as algebraic notation was being developed in the 1600s... This is probably because the distributive property implies a natural hierarchy in which multiplication is more powerful than addition, and makes it desirable to be able to write polynomials with as few parentheses as possible." $\endgroup$ – Conifold May 7 '15 at 19:02
  • $\begingroup$ @Conifold do you mind if I edit my answer to adress this as well? It seems relevant and interesting, but may be a bit off topic $\endgroup$ – VicAche May 8 '15 at 10:52
  • $\begingroup$ Sure, go ahead. I don't think it would be off topic, since Boole simply borrowed a convention from algebra addressing it is a natural part of the explanation. $\endgroup$ – Conifold May 10 '15 at 18:14

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.