WhatIs.com

logical negation symbol

By Rahul Awati

What is the logical negation symbol (¬)?

The logical negation symbol is used in Boolean algebra to indicate that the truth value of the statement that follows is reversed. The symbol (¬) resembles a dash with a tail or the upper half of a rectangle. The arithmetic subtraction symbol (−) and tilde (~) are also used to indicate logical negation.

The negation symbol is a unary logical operator. It simply reverses the truth value of a given statement. Thus, if a statement is represented as A, then ¬A is the logical opposite or negation of A.

Thus, ¬A = not A
If A = true, ¬A = false
If A = false, ¬A = true
Also, ¬(¬A) = A

The symbol ¬ is often found within or preceding complex logical statements. However, its simplest use is with a single sentence.

If A: The sky is blue, then
¬A: The sky is not blue, or it is not true that the sky is blue

The rules for using the logical negation symbol become more complicated when the symbol appears in complex statements.

If A: The sky is blue, and
If B: The grass is green, then
¬(A V B): Neither the sky is blue nor is the grass green

Since the ~ and ¬ symbols can be used interchangeably, the above statement can also be represented logically as ~(A V B). The option for using either symbol depends on the user's preference or the context to denote negation.

Compound statements and the logical negation symbol

In ordinary, everyday language, statements can be conveyed by complete declarative sentences, such as the following:

However, to express the logical relationships between such statements, it becomes cumbersome to write out the entire sentence at every occurrence of each statement. Therefore, specific individual statements are represented using capital letters as statement constants.

Thus, A, B and C can be used to represent the previous statements:

Lowercase letters of the alphabet, beginning with p, are used as statement variables. Thus, one might say, "Consider any statement, p" or "Suppose that a pair of statements, p and q, are both true."

The logical negation symbol ¬ or ~ is one of the statement connectives or operators that can be used to form new compound statements from two or more statements. It simply reverses the truth value of any statement in front of which it appears. This statement can be simple or compound.

So, if the original is true, the ¬ statement is false. But if the original is false, the ¬ statement becomes true. Its meaning can be represented by this truth table:

p ¬p
True False
False True

Examples of ¬ with simple statements

p: The lion is roaring
¬p: The lion is not roaring

p: The sun is not shining
¬p: The sun is shining

Examples of ¬ with complex statements

p: The lion is roaring
q: The birds are chirping
¬(p V q): Neither the lion is roaring nor the birds are chirping

p: The lion is roaring
q: The birds are not chirping
¬(p V q): The lion is not roaring and the birds are chirping

The English expression "It is not the case that ..." serves the same function as the logical negation symbol. However, even the single word not is enough to convey negation.

In compound sentences, negation is always performed before logical AND and logical OR. Further, as in algebra -- according to the BODMAS rule, or order of operations -- all operations within parentheses are performed first.

ASCII code of the logical negation symbol

The American Standard Code for Information Interchange (ASCII) code, created in 1963, is a commonly used and universally accepted character encoding format for textual data in computing systems. Since 1969, ASCII has also been used as the standard for internet data.

The ASCII system uses unique values for 128 alphabetic (A through Z uppercase and lowercase letters), numeric and special characters and control codes. The ASCII code for the logical negation symbol is 170. It is part of the group of ASCII extended characters. The ¬ symbol is preceded by ® at 169 and followed by ½ at 171.

Typing the logical negation symbol on Windows systems

The ¬ symbol can be typed on Windows-based computers using the following keyboard shortcuts:

Logical negation symbol in Unicode

The Unicode value U+00AC corresponds to the logical negation symbol ¬. The Alt code is defined as 0172; typing 0172 while holding down the Alt key will type this symbol in a Word or other document. When the Alt key is released, the symbol gets inserted in the document.

Logical negation operator in JavaScript

In JavaScript, the logical negation operator is expressed as ! (logical NOT). Also known as logical complement, the operator takes truth to falsity and vice versa. It is usually used with logical or Boolean values.

When used with non-Boolean values, it returns false if its single operand can be converted to true. Otherwise, it returns true. If the value can be converted to true, it is called truthy, and if it can be converted to false, it is called falsy.

Since the return value can always be converted to a Boolean primitive, the ! operator is considered a Boolean operator even though it can be used with operands that are not Boolean values.

See also: Mathematical symbols

23 Aug 2022

All Rights Reserved, Copyright 1999 - 2024, TechTarget | Read our Privacy Statement