disjunction (or)

on this page

definition

disjunction (PQP \lor Q) is the logical “or” operator that is true when at least one of its operands is true. it represents the idea of choice or inclusion of possibilities.

this can be visualized as a simple flowchart. you reach the “True” outcome if you can answer “Yes” to at least one question.

Rendering diagram...

truth conditions

disjunction follows the principle that any part being true makes the whole true:

PPQQPQP \lor Q
TTT
TFT
FTT
FFF

the disjunction is false only when both operands are false.

formal properties

commutativity

PQQPP \lor Q \equiv Q \lor P

order doesn’t matter - “sunny or warm” means the same as “warm or sunny.”

associativity

(PQ)RP(QR)(P \lor Q) \lor R \equiv P \lor (Q \lor R)

grouping doesn’t affect meaning - can write PQRP \lor Q \lor R unambiguously.

identity element

PFalsePP \lor \text{False} \equiv P

disjoining with falsehood leaves the original statement unchanged.

absorbing element

PTrueTrueP \lor \text{True} \equiv \text{True}

any disjunction with truth becomes true.

idempotence

PPPP \lor P \equiv P

repeating the same statement doesn’t change meaning.

notation variations

  • symbolic: \lor, \|, ++ (in some contexts)
  • programming: ||, or, OR
  • set theory: \cup (union)
  • boolean algebra: addition (with 1+1=11 + 1 = 1)

inclusive vs exclusive or

inclusive or (standard logical or)

  • true when at least one operand is true
  • allows both operands to be true simultaneously
  • standard interpretation in formal logic

exclusive or (xor)

  • true when exactly one operand is true
  • false when both operands are true
  • common in everyday language (“coffee or tea”)

natural language ambiguity: “would you like coffee or tea?” typically implies exclusive choice, but logical or is inclusive by default.

examples

academic requirements

statement: “you need calculus or statistics for this major”

  • CC: completed calculus
  • SS: completed statistics
  • CSC \lor S: true if you have either course (or both)

emergency conditions

system alert: “shutdown if memory low or temperature high”

def should_shutdown(system):
    return system.memory_low() or system.temperature_high()

activates when either condition occurs (or both simultaneously).

eligibility criteria

job requirement: “requires degree in computer science or equivalent experience”

  • DD: has relevant degree
  • EE: has equivalent experience
  • DED \lor E: qualified if either condition holds

search queries

database query: find users in engineering or marketing departments

SELECT * FROM users
WHERE department = 'engineering' OR department = 'marketing';

common mistakes

assuming exclusivity

incorrect: treating logical or as exclusive choice correct: inclusive or allows multiple options simultaneously

“students with math or science background” includes those with both.

misapplying de morgan’s laws

incorrect: ¬(AB)¬A¬B\neg(A \lor B) \equiv \neg A \lor \neg B correct: ¬(AB)¬A¬B\neg(A \lor B) \equiv \neg A \land \neg B

negating disjunction produces conjunction, not disjunction of negations.

confusing with implication

incorrect: interpreting ”PP or QQ” as ”PP implies QQcorrect: disjunction doesn’t establish conditional relationship

“it’s raining or the ground is wet” doesn’t mean rain causes wetness.

relationship to other constructs

with conjunction (and)

de morgan’s laws connect disjunction and conjunction:

  • ¬(PQ)¬P¬Q\neg(P \lor Q) \equiv \neg P \land \neg Q
  • disjunction and conjunction are duals

with implication

disjunction can express implication:

  • PQ¬PQP \rightarrow Q \equiv \neg P \lor Q
  • “if P then Q” means “not P or Q”

with negation

disjunction interacts with negation via de morgan’s laws:

  • “not (either P or Q)” becomes “neither P nor Q”

applications

programming logic

# error handling
if network_error() or timeout_occurred() or user_cancelled():
    abort_operation()

# validation - accept if any format works
if is_json(data) or is_xml(data) or is_csv(data):
    process_data(data)

database queries

-- flexible filtering
SELECT * FROM products
WHERE category = 'electronics'
   OR price < 50
   OR on_sale = true;

formal verification

liveness property: “system eventually responds or reports error”

ensures system doesn’t hang indefinitely.

logical arguments

premise structure: “if we have physical evidence or witness testimony, then we can proceed”

(PW)C(P \lor W) \rightarrow C

in natural language

explicit disjunction

  • “either…or…” (often exclusive in english)
  • “…or alternatively…”
  • “whether…or…“

implicit disjunction

  • “any of the following…”
  • “students may choose…”
  • alternative options in lists

ambiguous interpretations

everyday language “or” often implies exclusivity:

  • “soup or salad” (restaurant context)
  • “turn left or right” (navigation)
  • “heads or tails” (coin flip)

philosophical considerations

inclusive interpretation advantage

logical systems use inclusive or because it’s:

  • more general: exclusive or is special case
  • compositional: easier to combine with other operators
  • natural for conditions: “qualified if you meet requirement A or B”

relevance and connection

while logical disjunction doesn’t require meaningful connection, practical reasoning often assumes alternatives are relevant:

  • “it’s tuesday or grass is green” is logically valid but pragmatically strange

disjunctive reasoning

disjunction enables:

  • case analysis: consider all possibilities
  • alternative solutions: multiple paths to goal
  • robustness: system works if any component functions

computational aspects

circuit implementation

disjunction corresponds to OR gates:

  • output high when any input is high
  • complement to AND gates in digital logic

evaluation strategies

programming languages may use:

  • eager evaluation: check all operands
  • short-circuit evaluation: stop at first true operand
# short-circuit: if first is true, second isn't evaluated
if user.is_admin() or user.has_special_permission():
    allow_access()

complexity

for nn operands:

  • truth table size: 2n2^n rows
  • satisfying assignments: 2n12^n - 1 (all except all false)
  • evaluation time: O(n)O(n) for short-circuiting

addition (disjunction introduction)

from PP, we can conclude PQP \lor Q for any QQ:

PPQ\frac{P}{P \lor Q}

this might seem counterintuitive - we’re adding uncertainty by introducing QQ.

disjunctive syllogism

from PQP \lor Q and ¬P\neg P, we can conclude QQ:

PQ¬PQ\frac{P \lor Q \quad \neg P}{Q}

eliminates one option to determine the other.

practical patterns

error handling

def process_file(filename):
    if not file_exists(filename) or not file_readable(filename):
        raise FileError("Cannot process file")

defensive programming

# multiple fallback options
database = connect_primary() or connect_secondary() or connect_cache()

configuration flexibility

# config accepts multiple notification methods
notifications:
  email: user@example.com
  sms: +1234567890
  # system sends notification if ANY method configured

summary

disjunction provides logical flexibility by accepting multiple ways for statements to be true. its inclusive nature makes it particularly useful for:

  • expressing alternative conditions
  • building robust systems with fallbacks
  • creating flexible requirements
  • enabling case-by-case reasoning

understanding the inclusive nature of logical or helps avoid misinterpretations and builds more precise logical arguments.

══════════════════════════════════════════════════════════════════
on this page