What's a proposition?
a statement or assertion that expresses a judgment or opinion. (Google.com)
a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both.
- George is a lecturer
- Honolulu is the capital of Hawaii
- The temperature outside is 90 degrees
What isn't a proposition?
- Watch this screencast
- How much time is left in this screencast?
- x > 5
- This statement is false
- We typically use the letters p, q, r, s ...
- Each value can either be true or false (T/F)
- We'll see what this has to do with computers later
- Each of the letters are "atoms"
- Make more "interesting" propositions with atoms and logical operators.
If p is a proposition, then ¬p is the opposite of the truth value of p.
Let p and q be propositions. The disjunction p v q is equivalent to logical OR. The disjunction is false if both p and q are false and true otherwise.
Let p and q be propositions. The conjunction p Λ q is equivalent to logical AND. The conjunction is true if both p and q are true and false otherwise.
Let p and q be propositions. The Exclusive Or of p and q is p ⊕ q and is equivalent to logical XOR. Exclusive or is true if either p or q are true but not both.
Let p and q be propositions. The conditional statement p → q is the proposition "if p then q". The conditional is false when p is true and q is false and true otherwise.
Let p and q be propositions. The converse of the proposition p → q is q → p.
Let p and q be propositions. The inverse of the proposition p → q is ¬p → ¬q.
Let p and q be propositions. The contrapositive of the proposition p → q is ¬q → ¬p.
A conditional statement is equivalent to its contrapositive. The converse of a conditional statement is equivalent to the inverse.
Let p and q be propositions. The biconditional statement p ↔ q is the proposition "p if and only if q". The conditional is true when p and q have the same truth value and false otherwise.
// One Truth Variable p -- T F // Two truth variables p | q ----- T | T T | F F | T F | F // Three variables p | q | r --------- T | T | T T | T | F T | F | T T | F | F F | T | T F | T | F F | F | T F | F | F
The number of rows is 2^n
Logic and Bit Operations
Computers use binary
- 1's and 0's (T and F)
- A chain of 1's and 0's are a bitstring
- Bitstrings are typically split into groups of 4 (Hexadecimal)
- Read 1.2 to see some applications
By George Lee