Boolean logic takes its name from British mathematician George Boole (1815-1864), who wrote about a system of logic designed to produce better search results by formulating precise queries. He called it the "calculus of thought."
Boolean Logic is heavily used in computer search algorithms. Any search engine for the web, PubMed, the ENTREZ databases at NCBI, PDB and EMBL are all dependent upon it. Boolean Logic is used to select a data set by including some elements and excluding others.
Before we proceed further we need to consider a few elementary cases. You have almost certainly encountered Boolean Logic in two forms already. One is Venn Diagrams which are a staple of Jr. High math courses. A practical application is in internet searches, where various keywords are strung together in appropriate ways to focus and narrow the search.
Three words "AND", "OR", "NOT" are sufficient for many searches.
The way they are used to specify any sub-set of a larger data set is illustrated
below with Venn Diagrams.
Click
on the images for an explanation and full size view.
![]() |
||||||
no intersections
no unions |
intersections and unions | AND | AND / NOT | OR | OR / NOT | AND / OR |
Here we have three "sets". One set of things has properties which are depicted in the red area. A second set of things has a different set of properties as depicted in the blue area. A third set of things has still another set of properties as depicted in the yellow area. | |
Here we have the case where each of the 3 sets
overlaps the others. This gives rise to unions and intersections.
|
|
![]() |
An intersection
is the region where 2 sets overlap.
There is a purple area at the intersection of red and blue. There
is a gold area at the intersection of red and yellow. The gray area
in the center represents the intersection of all 3 entities.
In the written symbology of Boolean logic which is used by computer algorithms, intersections can be defined using the word "AND" |
In the written symbology
of Boolean logic which is used by computer algorithms, the word "NOT"
can
be used to exclude regions, or their intersections, or their
unions.
In the diagram to the left, the regions which were white in the image above (because they were not intersections!) have been colored again, and identified. Look at the region labeled "NOT yellow OR blue". Why is it incorrect to label it "red"? |
|
A union is the
region where 2 sets combine. This area
includes intersections in addition to areas where there are no intersections.
The union of red and yellow includes
all areas encompassed by red and yellow including their intersections
with each other (gold and grey) plus their intersections
with blue (purple and light blue) plus the areas of both
red and yellow which do not overlap with anything.
In the written symbology of Boolean logic which is used by computer algorithms, intersections can be defined using the word "OR". |
|
As above, the word
"NOT"
can
be used to exclude regions, or their intersections, or their
unions.
In the image to the left, we see the union of red and yellow (which includes their intersection), but excludes their intersections with blue. What would be the correct boolean expression for the area in white? |
|
In this case we see the intersection of yellow and red (gold), as well as the intersection of yellow and blue (light blue). This expression selects either intersection. |
Go to the top of the page.