CC103 Sit LNT 001 Intro&Logic
CC103 Sit LNT 001 Intro&Logic
Overview
Definition of a Proposition
(However, you might not know the actual truth value, and it might be situation-
dependent.)
[Later we will study probability theory, in which we assign degrees of certainty to
propositions. But for now: think True/False only!]
1
Examples of Propositions
Operators / Connectives
Unary operators take 1 operand (e.g., 3); binary operators take 2 operands (eg 3 4).
2
The Negation Operator
The unary negation operator (NOT) transforms a prop. into its logical negation.
T : True; F : False
: means is defined as
The binary conjunction operator (AND) combines two propositions to form their
logical conjunction.
E.g. If p=I will have rice for lunch. and q=I will have noodles for dinner., then
Also: and operations together are sufficient to express any Boolean truth
table!
3
The Disjunction Operator
The binary disjunction operator (OR) combines two propositions to form their
logical disjunction.
A Simple Exercise
4
r p =
rpq=
The binary exclusive-or operator (XOR) combines two propositions to form their
logical exclusive or (exjunction?).
p q = I will either earn an A for this course, or I will drop it (but not both!)
I.e., If p is true, then q is true; but if p is not true, then q could be either true or false.
5
Implication Truth Table
Examples of Implications
If this lecture ends, then the sun will rise tomorrow. True or False?
If the moon is made of green cheese, then I am richer than Bill Gates. True or
False?
In logic, we consider the sentence True so long as either I dont wear a red shirt,
or the US attacks.
But in normal English conversation, if I were to make this claim, you would think
I was lying.
Why this discrepancy between logic & language?
6
Resolving the Discrepancy
This sentence is logically False in our example, because for me to wear a red shirt
and the U.S. not to attack Iraq is a possible (even if not actual) situation.
Natural language and logic then agree with each other.
7
One of these three has the same meaning (same truth table) as p q. Can you
figure out which?
p q q p pq q p
F F T T T T
F T F T T T
T F T F F F
T T F F T T
p q = You can take the flight if and only if you buy a ticket.
p q = You can take the flight if and only if you buy a ticket.
8
p q does not imply p and q are true, or cause each other.
We have seen 1 unary operator (out of the 4 possible) and 5 binary operators (out
of the 16 possible). Their truth tables are below.
p q p pq pq pq pq pq
F F T F F F T T
F T T F T T T F
T F F F T T F F
T T F T T F T T
Boolean algebra is like ordinary algebra except that variables stand for bits, +
means or, and multiplication means and.
See chapter 10 for more details.
Bit Strings
9
By convention, bit strings are written left to right: e.g. the first bit of
1001101010 is 1.
When a bit string represents a base-2 number, by convention the first bit is the
most significant bit. Ex. 11012=8+4+1=13.
Bitwise Operations
Boolean operations can be extended to operate on bit strings as well as single bits.
E.g.:
01 1011 0110
11 0001 1101
End of 1.1
You have learned about:
Propositions: What they are.
Propositional logic operators
Symbolic notations.
English equivalents.
Logical meaning.
Truth tables.
Atomic vs. compound propositions.
Alternative notations.
Bits and bit-strings.
Next section: 1.2
Propositional equivalences.
How to prove them.
10