Deny exactly what was claimed
The negation of a statement P, written not P, is the statement that is true exactly when P is false. It must hold in every case where P fails, and in no case where P holds.
Take P: x > 5. P fails at every number that is not above 5, and those are the numbers below 5 together with 5 itself. So not P is . Every number satisfies exactly one of x > 5 and : 7 satisfies the first, and 5 and 2 satisfy the second.
P: x > 5, every number to the right of 5, with a hollow circle at 5 because 5 itself is not above 5.
not P: , every number to the left of 5 and 5 itself, filled in. Together the two pictures cover the whole line, and they share no point.
Flipping the sign denies too much
It is tempting to negate x > 5 by turning the sign round, to x < 5. Test it at x = 5. There P is false, since 5 is not above 5, so the negation must be true. But 5 < 5 is false. At x = 5 both statements are false, so x < 5 is not the negation of x > 5: it claims more than “not above 5”, because it rules out 5 as well.
In the same way, is not the negation either: at x = 6 both x > 5 and are true. A candidate negation fails as soon as there is one case where it and the original are both true, or both false.
The negation of “n is even”, for a whole number n, is “n is odd”, since every whole number is one or the other and not both. “n is negative” is not its negation: −4 is negative and still even.
x < 5 has a hole at 5. The number 5 is not above 5 and not below it, so it belongs to neither x > 5 nor x < 5.
Not (P and Q)
The statement “P and Q” claims that both parts hold. It fails as soon as one part fails, so its negation says only that at least one part fails: not (P and Q) is the same as (not P) or (not Q).
The negation of “the shape is a square and it is blue” is “it is not a square, or it is not blue”. A red square, a blue circle and a red circle all make the original false, and each satisfies this negation. “It is not a square and not blue” is too strong: it leaves out the red square and the blue circle, which also deny the original. “It is a rectangle and not blue” names one particular way to fail and rules out every other.
Shapes, with one circle for the squares and one for the blue shapes. “Square and blue” holds only in the shaded overlap. Its negation holds in all three other regions: squares that are not blue, blue shapes that are not squares, and shapes that are neither. Those are exactly the places where it is not a square or not blue.
Each row label gives P, then Q. The two columns agree in all four rows, so not (P and Q) and (not P) or (not Q) are the same statement.
Not (P or Q)
The statement “P or Q” claims that at least one part holds. It fails only when both parts fail, so its negation must deny both: not (P or Q) is the same as (not P) and (not Q). Under a negation, or becomes and.
The negation of “the number is prime or even” is “it is neither prime nor even”, that is, “it is not prime and it is not even”. 9 is an example. “It is not prime, or not even” is too weak: it lets 4 through, since 4 is not prime, yet 4 is even and so satisfies the original. “It is odd and prime” is no negation at all: 7 is odd and prime, and 7 satisfies the original.
Whole numbers above 1, with a circle for the primes and one for the even numbers, and a sample in each region: 2 is both, 7 only prime, 4 only even, 9 neither. “Prime or even” holds inside the circles; its negation holds only in the shaded region outside both, where 9 is.
Each row label gives P, then Q. Both columns are true in the last row only, where P and Q are both false.
De Morgan’s laws
Together, not (P and Q) = (not P) or (not Q) and not (P or Q) = (not P) and (not Q) are De Morgan’s laws. As a negation passes into a bracket, each part is negated and each and becomes or, each or becomes and.
They apply one bracket at a time. A website grants access when P and (K or C): the password is correct, and the device is recognized or the one-time code is correct. The outer and becomes or: (not P) or not (K or C). The inner or becomes and: (not P) or ((not K) and (not C)). Access is denied when the password is wrong, or when the device is unknown and the code is wrong.
The usual mistakes
Turning x > 5 into x < 5. The case x = 5 is lost; the negation is .
Negating each part and keeping the connective. not (P and Q) is not (not P) and (not Q): that is true in one row only, where the negation is true in three.
Naming one way to fail. “It is a rectangle and not blue” is one of several ways to deny “a square and blue”; the negation must include them all.
Changing the subject. The negation of “n is even” is about evenness, so it is “n is odd”, not a claim about sign or size.
A login rule
In the application below, a website’s access rule is negated with De Morgan’s laws to give the condition for denying access, and a developer’s deny test, which negated every letter and kept every connective, is compared with it over all eight combinations.
Worked example: A Website's Login Rule, and a Developer's Test for Denying Access
Question A website grants access when the password is correct and at least one of these holds: the device is recognized, or the one-time code is correct. Otherwise access is denied. Let P be "the password is correct", K be "the device is recognized" and C be "the one-time code is correct". (a) Write the condition for access to be denied without "not" in front of a bracket. (b) A developer writes the deny test as "(not P) and (not K) and (not C)" and grants access whenever that test is false. In how many of the 8 combinations of P, K and C does this code grant access that the rule denies?
1.Write the rule: access is granted exactly when P and (K or C).
Access needs P, and at least one of K and C. 2.Negate the outer "and": (not P) or not (K or C). Then negate the inner "or": not (K or C) is (not K) and (not C).
The negation of an "and" is an "or" of the negations. 3.(a) Access is denied when the password is wrong, or when the device is not recognized and the one-time code is wrong: (not P) or ((not K) and (not C)).
(a) Denied when (not P) or ((not K) and (not C)). 4.The correct deny test is true in the 4 combinations with P false, and in 1 more with P true and K and C both false: 5 in all. The developer's test is true only when all three are false, which is 1 combination, and that one is among the 5.
The rule denies 5 rows; the developer's test is true in 1 of them. 5.(b) The developer's code grants access in the other 5 − 1 = 4 combinations that the rule denies. One of them is a wrong password on a recognized device with a correct one-time code. Check: the developer's test is true only where the correct one is, so it never denies access the rule grants.
(b) The developer's code lets in 4 rows that the rule denies, row 5 among them.
Answer: (a) Denied when (not P) or ((not K) and (not C)): the password is wrong, or the device is not recognized and the one-time code is wrong. (b) 4 combinations
Common mistakes
- Negating every letter and keeping every connective, as the developer did. De Morgan's laws also swap "and" with "or", so the negation of P and (K or C) has an "or" on the outside.
- Counting 7 denied combinations, as if the rule were P and K and C. The rule needs only one of K and C, so the correct deny test is true in 5 combinations.
More mathematical statements problems, worked step by step →