Software Engineering
Home Planning Requirements Writing Hazard Analysis Requirement Analysis Config Control Software Design Software Testing Software Standards Basic Logic

Basic Logic - Paradox

(Not the database!)

Aristotle developed the initial concepts behind formal logic and hypothesis testing. Unfortunately, Aristotle was wrong about much that he wrote! Aristotle’s Law of the Excluded Middle states that that something must be either True or False – but never both. He permits only a binary response of True or Not True (it is either A OR NOT A).

2000 years later, mathematician Bertrand Russell challenged Aristotle with a barber paradox:

There is only one barber in town.
The barber cuts the hair of everyone who does not cut their own hair.
Does the barber cut his own hair (Yes or No)?
 
IF the barber cuts his own hair, then it creates a contradiction – he cuts his own hair, yet his hair is also cut by the barber, who only cuts the hair of people who do not cut their own hair (A AND NOT A). However, if he does not cut his own hair, then he must go to the barber (himself) and thus cuts his own hair (NOT A AND A). Either way, it is a paradox!

Aristotle, being dead by then, was unable to defend himself.

Binary logic is useful in computers, which has hardware that ensures that each bit is either a 1 or a 0 – never both. However, in real life, binary logic can produce paradoxes. The correct answer to the barber question lies in multi-valued logic (the birthplace of "fuzzy" logic):

The statement “the barber cuts his or her own hair” is 50% true.

So, how does that apply to testing? Consider a simple test to see if an apple is red. In multi-valued logic, the proposition might be:

Q: Given an apple that is ¾ red and ¼ green, is it a red apple or a green apple?
A: The statement “This is a red apple” is 75% true and 25% false.

However, hypothesis testing requires a binary result. To accommodate this, we must set a threshold value.

A: It is a red apple if 75% or more of the surface area is red; or reworded: IF 75% or more of the area is red THEN it is a red apple. This test condition produces a binary result.