TOPICS
Search

OR


ORGate

OR is a connective in logic which yields true if any one of a sequence of conditions is true, and false if all conditions are false. In formal logic, the term disjunction (or, more specifically, inclusive disjunction) is commonly used to describe the OR operator. A OR B is denoted A v B (Mendelson 1997, p. 13), A|B, A+B (Simpson 1987, p. 539), or A union B (Simpson 1987, p. 539). The circuit diagram symbol for an OR gate is illustrated above.

The symbol  v is often associated with the Latin word "vel," meaning "or," but this association is not a well-supported account of its origin. Elkind and Zach (2023) identify early uses for disjunction in Whitehead's manuscript "The Logic of Propositional Functions" (Whitehead 1903) and Russell's manuscripts "Classes" and "Frege on the Contradiction" (Russell 1994ab), dating from around 1903. The relative priority of these manuscripts is uncertain. The expression A v B is voiced either "A or B" or "A vel B." The way to distinguish the similar symbols  ^ (AND) and  v (OR) is to note that the symbol for AND is oriented in the same direction as the capital letter 'A."

The OR operation is implemented in the Wolfram Language as Or[A, B, ...].

The OR operation can be written in terms of NOT and AND as

 A v B=!(!A ^ !B)

(Mendelson 1997, p. 26).

The binary OR operator has the following truth table (Carnap 1958, p. 10; Simpson 1987, p. 542; Mendelson 1997, p. 13).

ABA v B
TTT
TFT
FTT
FFF

A product of ORs is called a disjunction and is denoted

  v _(k=1)^nA_k.

For example, the truth table for the ternary OR operator is shown below (Simpson 1987, p. 543).

ABCA v B v C
TTTT
TTFT
TFTT
TFFT
FTTT
FTFT
FFTT
FFFF
BitOr

A bitwise version of OR can also be defined that performs a bitwise OR on the binary digits of two numbers x and y and then converts the resulting binary number back to decimal. Bitwise OR is sometimes denoted A∥B and is implemented in the Wolfram Language as BitOr[n1, n2, ...]. The illustration above plots the bitwise OR of the array of numbers from -31 to 31 (Wolfram 2002, p. 871).


See also

AND, Binary Operator, Connective, Disjunction, Exclusive Disjunction, Inclusive Disjunction, Logic, NAND, NOR, NOT, Truth Table, Union, Vee, XNOR, XOR

Explore with Wolfram|Alpha

References

Carnap, R. Introduction to Symbolic Logic and Its Applications. New York: Dover, pp. 7 and 10, 1958.Elkind, L. D. C. and Zach, R. "The Genealogy of ' v '." Rev. Symbolic Logic 16, 862-899, 2023. https://doi.org/10.1017/S1755020321000587.Mendelson, E. Introduction to Mathematical Logic, 4th ed. London, England: Chapman & Hall, p. 13, 1997.Russell, B. "Classes." Manuscript, 1903. Reprinted in Foundations of Logic, 1903-05 (Ed. A. Urquhart). London and New York: Routledge, pp. 3-37, 1994a.Russell, B. "Frege on the Contradiction." Manuscript, 1903. Reprinted in Foundations of Logic, 1903-05 (Ed. A. Urquhart). London and New York: Routledge, pp. 607-619, 1994b.Simpson, R. E. "The OR Gate." §12.5.1 in Introductory Electronics for Scientists and Engineers, 2nd ed. Boston, MA: Allyn and Bacon, pp. 542-544, 1987.Whitehead, A. N. "The Logic of Propositional Functions." Manuscript, ca. 1903. RA 710.057490, Bertrand Russell Archives, McMaster University.Wolfram, S. A New Kind of Science. Champaign, IL: Wolfram Media, 871, 2002.

Referenced on Wolfram|Alpha

OR

Cite this as:

Weisstein, Eric W. "OR." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/OR.html

Subject classifications