9 February 20021

Boolean Operations

A Little Propositonal Calculus This is foundational to the rules of logic. This is the algebra of booean objects. We will learn both the mathematical and Python notations.

The prefix unary operator \(\sim\) Boolean functions are defined via truth-tables, which we show here. You can prove theorems about boolean relations by using truth-tables.

This is negation.

\(P\)\(\sim P\)
TF
FT

The infix binary operator \(\vee\)

\(P\)\(Q\)\(P\vee Q\)
TTT
TFT
FTT
FFF

The infix binary operator \(\wedge\)

\(P\)\(Q\)\(P\wedge Q\)
TTT
TFF
FTF
FFF

This is implication, or if-then

\(P\)\(Q\)\(P\implies Q\)
TTT
TFF
FTF
FFF
\(P\)\(Q\)\((\sim P)\vee Q\)
TTT
TFF
FTF
FFF

An expression in boolean objects and operators is called a predicate. All predicates evaluate to true or false, depending on the truth or falsity of the boolean objects making them up.

An expression is a tautology if it is always true. Here is a tautology.

Data Structures: Sequences

Lists

Tuples