Negation

From MediaWiki
Jump to navigation Jump to search

Negation

Negation is the logical operation that inverts the truth value of a proposition. If a proposition p is true, then its negation ¬p is false, and vice versa.

Symbols

  • ¬p (standard notation)
  • ~p (alternative notation)
  • NOT p (common in programming)

Definition

Negation produces the opposite truth value of its operand.

Truth Table

p ¬p
T F
F T

Examples

  • If p = "It is raining", then ¬p = "It is not raining".
  • In Python: not p
  • In Java: !p