Sie sind auf Seite 1von 6

Proposition

A proposition is a statement that is either


Propositional Logic true or false, but not both.
•  Clemson will defeat Georgia in football
this fall.
CPSC 2070 Discrete Structures
•  1+1 = 2
Rosen (6th Ed.) 1.1, 1.2
•  3+1 = 5
•  What will be my grade in CPSC 2070?

LOGICAL
Definition 1. Negation of p
Let p be a proposition.
We can define operations on propositions! The statement “It is
Table 1.
not the case that p” is The Truth Table for the
also a proposition, Negation of a Proposition

called the “negation of


p ¬p
p” or ¬p (read “not p”)
p = The sky is blue. T F
F T
¬p = It is not the case that
the sky is blue.
¬p = The sky is not blue.

Definition 2. Conjunction of p Definition 3. Disjunction of p


and q and q
Let p and q be Table 2. The Truth Table for Table 3. The Truth Table for
Let p and q be
propositions. The the Conjunction of two the Disjunction of two propositions. The
propositions propositions
proposition “p and q,” proposition “p or q,”
denoted by p∧q is true p q p∧q denoted by p∨q, is the
p q p∨q
when both p and q are proposition that is false
true and is false T T T T T T when p and q are both
otherwise. This is T F F T F T false and true otherwise.
called the conjunction F T F F T T
of p and q. F F F F F F

1
Definition 4. Exclusive or of p
Definition 5. Implication p→q
and q
Let p and q be Let p and q be propositions. Table 5. The Truth Table for
Table 4. The Truth Table for
the Exclusive OR of two propositions. The The implication p→q is the the Implication of p→q.
propositions
exclusive or of p and q, proposition that is false when
denoted by p⊕q, is the p is true and q is false, and
p q p⊕q p q p→q
proposition that is true true otherwise. In this
when exactly one of p implication p is called the T T T
T T F
T F T and q is true and is hypothesis (or antecedent or T F F
F T T false otherwise. premise) and q is called the F T T
F F F conclusion (or consequence). F F T
Politician Example

Implications Related Implications


•  If p, then q •  Not the same as the Converse Contrapositive
•  p implies q if-then construct of p → q of p → q
•  if p,q used in is the proposition is the proposition
programming q→p ¬q → ¬p
•  p is sufficient for q languages such as
•  q if p If p then S Inverse
•  q whenever p of p → q
•  q is necessary for p is the proposition
¬p → ¬q

Definition 6. Biconditional Compound Propositions


We can also combine operations to create
Let p and q be compound propositions such as:
Table 6. The Truth Table for propositions. The Don’t try to do it
the biconditional p↔q.
biconditional p↔q is the Test all possible ¬(p ∨ q) ∧ q all in your head!
combinations of T/
proposition that is true F
p q p↔q
when p and q have the p q (p ∨ q) ¬(p ∨ q) ¬(p ∨ q) ∧ q
T T T same truth values and is T T T F F
T F F false otherwise. “p if and
T F T F F
F T F only if q, p is necessary
F F T and sufficient for q” F T T F F
F F F T F

2
Special Types of Compound
Practice with English Sentences
Propositions p: You learn the simple things well.
q: The difficult things become easy.
•  Contradiction: Compound proposition
that is always false regardless of the •  You do not learn the •  The difficult things
simple things well. become easy but you
truth values of the propositions in it. did not learn the simple
•  If you learn the simple
p ∧ ¬p is a contradiction things well.
things well then the
difficult things become •  You learn the simple
•  Tautology: compound proposition that things well but the
easy.
is always true regardless of the truth difficult things did not
•  If you do not learn the
values of the propositions in it. simple things well, then
become easy.
p ∨ ¬p is a tautology the difficult things will
not become easy.

Practice with English Sentences


p: You learn the simple things well.
q: The difficult things become easy.
•  You do not learn the •  The difficult things
simple things well. ¬p become easy but you Some Applications of
did not learn the simple
•  If you learn the simple
things well then the things well. q ∧ ¬p Propositional Logic
difficult things become •  You learn the simple
easy. p→q things well but the
•  If you do not learn the difficult things did not
become easy.
simple things well, then
the difficult things will p ∧ ¬q
not become easy.
¬p → ¬q

p : Janice is paid the most. If Janice is not the lowest


q: Maggie is paid the most. If Fred is not the
paid, then Maggie is paid
Truth Table Puzzle r: Fred is paid the most.
highest paid of the
the most.
three, then Janice is.
Steve would like to determine the relative s: Janice is paid the least.

salaries of three coworkers using two p q r s ¬r→p ¬s →q (¬r→p)∧ (¬s→q)


facts: T F F F T F F
F T F T F T F
•  If Fred is not the highest paid of the F F T T T T T
three, then Janice is. F T F F F T F
•  If Janice is not the lowest paid, then F F T F T F F

Maggie is paid the most.


Who is paid the most and who is paid the Fred, Maggie, Janice

least?

3
Knights and Knaves Puzzles Let a be the statement that “A is a Knight” and b be the statement that
“B is a Knight.”
A says “B and I are both Knights.” If A is a Knight then a is true and the
statement (a∧b) is true. If A is a Knave, then a is false and the
On a remote island there live Knights and statement is false. These are the two cases that are “true” in that
they are possible solutions to the puzzle. We can code this with the
Knaves. Knights always tell the truth biconditional operator ↔. (Recall that p↔q is true when both
and Knaves always lie. propositions are true or both propositions are false.)

B says “A is a Knave.” Using the same logic add b ↔ ¬a to the table.


You meet two people on the island—A
and B. A says: “B and I are both a (A is a Knight) b (B is a Knight) (a∧b) a ↔ (a∧b) b ↔ ¬a
Knights.” B says: “A is a Knave.” T T T T F
Determine, if possible, which group A and T F F F T
B belong to. F T F T T
F F F T F

A says “At least one of us is a Knave” and B The Hat Puzzle


says nothing.
Three students who made an “A” in CPSC 2070 are told to
a (A is a b (B is a ¬a ∨ ¬b a ↔ (¬a ∨ ¬b) stand in a straight line, one in front of the other. A hat is put on
Knight) Knight) each of their heads. They are told that each of these hats was
selected from a group of five hats: two black hats and three white
T T F F hats. The first student, standing at the front of the line, can’t see
either of the students behind her or their hats. The second
T F T T student, in the middle, can see only the first student and her hat.
F T T F The last student, at the rear, can see both other students and
their hats.
F F T F
None of them can see the hat on their own head. They are asked
to deduce its color. The last student in line is asked if he knows
the color of his hat and says he cannot be sure. The second
student in line is asked if he knows the color of his hat and says
he cannot be sure. The student at the front of the line then says:
“My hat is white.”

She is correct. How did she come to this conclusion?

Bit Operations
A computer bit has two possible values: 0 (false) and 1
(true). A variable is called a Boolean variable is its value is
either true or false.
Last Second First
W W W Bit operations correspond to the logical connectives:
W W B ∨ OR
∧ AND
W B W
⊕ XOR
W B B
B W W Information can be represented by bit strings, which are
B W B sequences of zeroes and ones, and manipulated by
operations on the bit strings.
B B W

4
Truth tables for the bit
Binary Math Review
operations OR, AND, and XOR
Decimal has digits 0-9
∨ 0 1
⊕ 0 1 0
___ 0
___ 1
___ 3
___
0 0 1 10 10 10 100
3 2 1
0 0 1
1 1 0 0+1 = 1
1 1 1
∧ 0 1 Binary has digits 0-1 1+0 = 1
1
___ 1
___ 0
___ 1
___ 1+1 = 10
0 0 0
2 3 2 2 2 1 20 10 + 1 = 11
1 0 1 11 + 1 = 100

Program to add 3 binary digits


p q r Output Output Logically Equivalent
1 2
0 0 0 0 0
•  Compound propositions P and Q are
0 0 1 0 1
0 1 0 0 1
logically equivalent if P↔Q is a
0 1 1 1 0 tautology. In other words, P and Q
1 0 0 0 1 have the same truth values for all
1 0 1 1 0 combinations of truth values of simple
1 1 0 1 0
1 1 1 1 1
propositions.
Output 1 = (p∧q) ∨ (p∧r) ∨ (q∧r) Output 2 = p ⊕ q ⊕ r •  This is denoted: P⇔Q
Full Adder: Computers contain switches (logic gates) corresponding
to our logic operations

Example: DeMorgans Example: Distribution


Prove that: p ∨ (q ∧ r) ⇔ (p ∨ q) ∧ (p ∨ r)
•  Prove that ¬(p∨q) ⇔ (¬p ∧ ¬q)
p q r q∧r p∨(q∧r) p∨q p∨r (p∨q)∧(p∨r)
p q (p∨q) ¬(p∨q) ¬p ¬q (¬p ∧ ¬q)
T T T T T T T T
TT T F F F F T T F F T T T T
TF T F F T F T F T F T T T T
FT T F F F T T T T
T F T F F
F T T T T T T T
FF F T T T T F T F F F T F F
F F T F F F T F
F F F F F F F F

5
Prove: p↔q⇔(p→q) ∧ (q→p) List of Logical Equivalences
Table 6 in Section 1.2
p∧T ⇔ p; p∨F ⇔ p Identity Laws
pq p↔q p→q q→p (p→q)∧(q→p)
p∨T ⇔ T; p∧F ⇔ F Domination Laws
TT T T T T
TF F F T F p∨p ⇔ p; p∧p ⇔ p Idempotent Laws

FT F T F F ¬(¬p) ⇔ p Double Negation Law


FF T T T T
p∨q ⇔ q∨p; p∧q ⇔ q∧p Commutative Laws

We call this biconditional equivalence. (p∨q)∨ r ⇔ p∨ (q∨r); (p∧q) ∧ r ⇔ p ∧ (q∧r)


Associative Laws

List of Equivalences
p∨(q∧r) ⇔ (p∨q)∧(p∨r) Distributive Laws
p∧(q∨r) ⇔ (p∧q)∨(p∧r)
¬(p∨q)⇔(¬p ∧ ¬q) De Morgan’s Laws
¬(p∧q)⇔(¬p ∨ ¬q)
p ∨ (p∧q) ⇔ p Absorption Laws
p ∧ (p∨q) ⇔ p

p ∨ ¬p ⇔ T Negation Laws
p ∧ ¬p ⇔ F Or Tautology; And Contradiction

(p→q) ⇔ (¬p ∨ q) Implication Equivalence

Das könnte Ihnen auch gefallen