Boolean Operations


Truth Tables

We can show the results of the boolean operators using truth tables. Assume that A and B are boolean expressions:

A ! A
FALSE TRUE
TRUE FALSE
A B A && B
FALSE FALSE FALSE
FALSE TRUE FALSE
TRUE FALSE FALSE
TRUE TRUE TRUE
A B A || B
FALSE FALSE FALSE
FALSE TRUE TRUE
TRUE FALSE TRUE
TRUE TRUE TRUE

We can also show the results of more complex expressions using truth tables. For example, assume that A, B, and C are boolean expressions:

A B C A || B (A || B) && C
FALSE FALSE FALSE FALSE FALSE
FALSE FALSE TRUE FALSE FALSE
FALSE TRUE FALSE TRUE FALSE
FALSE TRUE TRUE TRUE TRUE
TRUE FALSE FALSE TRUE FALSE
TRUE FALSE TRUE TRUE TRUE
TRUE TRUE FALSE TRUE FALSE
TRUE TRUE TRUE TRUE TRUE

Alyce Brady, Kalamazoo College