Sie sind auf Seite 1von 37

MATEMATIKA DISKRIT

Dr. Ir. Nyimas Dewi Sartika, DEA

Universitas Multimedia Nusantara


2016
1

LoGICS & PROOFS

Propositional Logic

Logic: to give precise meaning to mathematical statements

Proposition: a declarative sentence that is either true or


false, but not both

Propositional variables: p, q, r, s

Truth value: true (T) or false (F)

Examples:

Jakarta is the capital of Indonesia (proposition)

1 + 1 = 2 (proposition)

2 + 2 = 5 (propositian)

What time is it? (not proposition)

Read this carefully (not proposition)


3

Compound Propositions
Compound propositions: news propositions formed from
existing propositions using logical operators
Definition 1: Let p be a proposition. The negation of p, denoted
by p (orp), is the statement It is not the case that p.
Definition 2: Let p and q be propositions. The conjunction of p
and q, denoted by p q, is the proposition p and q.
Definition 3: Let p and q be propositions. The disjunction of p
and q, denoted by p q, is the proposition p or q.
Definition 4: Let p and q be propositions. The exclusive or of p
and q, denoted by p q, is the proposition that is true when
exactly one of p and q is true and is false otherwise.
4

Compound Propositions
Definition 5: Let p and q be propositions. The conditional
statement p q is the proposition if p, then q.
p: hypothesis (or antecedent or premise)
q: conclusion (or consequence)

Implication: p implies q
Definition 6: Let p and q be propositions. The biconditional
statement p q is the proposition p if and only if q.

p is necessary and sufficient for q


Biimplication: p iff q

Compound Propositions
By convention
Logical Operator

Precedence

1
2
3
4
5

Examples:

pq r

is equivalent to

(( p) q) r

pq rs

is equivalent to

p (q (r s))
6

Logic and Bit Operations


A bit is a binary digit: 0 or 1.
Bits are usually used to represent truth values.
By convention: 0 represents false; 1 represents true.

Bit operations correspond to logical operators, replacing


false by 0 and true by 1
x

xy

xy

x y

xy

xy

1
7

Propositional Equivalences
A tautology is a proposition that is always true.
p

p p

A contradiction is a proposition that is always false.


p

pp

A contingency is a proposition that is neither a tautology


nor a contradiction.
p

pp

T
8

Logical Equivalences

If p and q are propositions, then p is logically


equivalent to q if their truth tables are the same.
p is equivalent to q is denoted by p q

p, q are logically equivalent if their biconditional


p q is a tautology.

Logical Equivalences
Use known logical equivalences to prove that
two propositions are logically equivalent.
Example:

( p q) p q
( p q) ( (p q)) (De Morgans)
pq

(Double negation)

10

Logical Equivalences
Identity

pT p
pF p

Domination

pTT
pFF

Idempotence

ppp
ppp

Double negation

pp

Commutativity

pqqp
pqqp

Associativity

(pq)r p(qr)
(pq)r p(qr)

Distributivity

p(qr)(pq)(pr)
p(qr)(pq)(pr)

De Morgans

( p q ) p q (De Morgans I)
( p q ) p q (De Morgans II)

Excluded Middle

p p T

Uniqueness

p p F

Useful LE

p q p q

11

Implication, Converse, Contrapositive, Inverse

Implication: p q
Converse: q p
Contrapositive: q p
Inverse: p q
Two compound propositions are equivalent if
they always have the same truth value
The contrapositive is equivalent to the implication
The converse is equivalent to the inverse

Predicate Logic
Predicate: a property that the subject of the statement
can have
Example: x > 3
x : variable
> 3 : predicate
P(x) : x > 3 (the value of the propositional function P at x)
Predicates can be quantified using

Universal quantification: a predicate is true for every


element
Existential quantification: there is one or more element
for which a predicate is true
13

Universal Quantifier
Suppose that P(x) is a predicate on some universe of discourse.

The universal quantification of P(x) is the proposition:


P(x) is true for all x in the universe of discourse.

x P(x) reads for all x, P(x) is True


x P(x) is TRUE means P(x) is true for all x in UD(x).

x P(x) is FALSE means there is an x in UD(x) for which P(x) is false.

14

Existential Quantifier
Suppose P(x) is a predicate on some universe of discourse.
The existential quantification of P(x) is the proposition:
There exists at least one x in the universe of discourse
such that P(x) is true.
x P(x) reads for some x, P(x)

or
There exists x, P(x) is True
x P(x) is TRUE

means there is an x in UD(x) for which P(x) is true.

x P(x) is FALSE means for all x in UD(x) is P(x) false


15

Quantifier Negation
x P(x) means P(x) is true for every x.
What about x P(x) ?
It is not the case that [P(x) is true for every x.]
There exists an x for which P(x) is not true.
x P(x)
Universal negation:
x P(x) x P(x).
16

Proofs

Proof: valid arguments that establish

the truth of mathematical statements

17

Valid Argument
Argument: a sequence of propositions that end with
a conclusion
Premises or hypotheses of the problem (p1,,pn)
Conclusion: the final proposition (q)
Argument form: a sequence of compound propositions
involving propositional variables

An argument is valid
if p1 p2 pn q is true when p1,,pn are true.
An argument is valid if whenever all the premises are true
then the conclusion is true.
18

19

Modus Ponens
p = I have a total score over 96
q = I get an A for the class
I have a total score over 96
If I have a total score over 96, then I get an A for the class
Therefore, I get an A for this class

p
pq
q

Tautology:
(p (p q)) q

20

Modus Tollens
p = The power supply fails

q = The lights go out


If the power supply fails then the lights go out
The lights are on
Therefore, the power supply has not failed

pq
q

Tautology:
( (p q) q) p

p
21

Hypothetical Syllogism
p = I get a total score over 96

q = I get an A in the course


r = I have a 4.0 semester average
If I get a total score over 96, I will get an A in the course

If I get an A in the course, I will have a 4.0 semester average

If I get a total score over 96 then I will have a 4.0 semester average.

pq

qr
pr

Tautology:
((p q) (q r)) (p r)
22

Disjunctive Syllogism
p = I am a student
q = I am a soccer player
I am a student or I am a soccer player
I am a not soccer player
Therefore, I am a student

pq
q

Tautology:

((p q) q) p

p
23

Addition
p = I am a student

q = I am a soccer player
I am a student

Therefore, I am a student or I am a soccer player

pq

Tautology:

p (p q)

24

Simplification
p = I am a student

q = I am a soccer player
I am a student and I am a soccer player

Therefore, I am a student
pq

Tautology:

(p q) p

25

Conjunction
p = I am a student.
q = I am a soccer player.
I am a student
I am a soccer player

Therefore, I am a student and I am a soccer player


p
q

Tautology:
((p) (q)) p q

pq
26

Resolution
p = I am taking discrete mathematics
q = I am taking calculus
r = I am taking linear algebra
I am taking discrete mathematics or I am taking calculus
I am not taking discrete mathematics or I am taking linear algebra
Therefore, I am taking calculus or I am taking linear algebra

pq
pr

qr

Tautology:
((p q ) ( p r)) (q r)

27

Example 1:
p = I am taking discrete mathematics
q = I am taking calculus
r = I am taking linear algebra

I am taking discrete mathematics or I am taking calculus

If I am taking discrete mathematics then I am taking linear algebra

If I am taking calculus then I am taking linear algebra

Therefore, I am taking linear algebra

pq
pr
qr
r

Tautology:
((p q ) (p r) (q r)) r
28

Example 2:
It is not sunny this afternoon and it is colder than
yesterday
We will go swimming only if it is sunny
If we do not go swimming, then we will take a canoe trip

If we take a canoe trip, then we will be home by sunset


Conclusion: We will be home by sunset

29

Inference Rules for Quantified Statements


x P(x)
P(c)
P(c)___
x P(x)
x P(x)
P(c)
P(c)__
x P(x)

Universal Instantiation
(for an arbitrary object c from UoD)

Universal Generalization
(for any arbitrary element c from UoD)

Existential Instantiation
(for some specific object c from UoD)

Existential Generalization
(for some object c from UoD)
30

Direct Proofs
Start with premises and deduce the conclusion:
Assume that the premises are true
Apply rules of inferences and theorems

31

Vacuous Proofs
p q is vacuously true if p is false
In this case, p q is a vacuous proof
Example:
p : 0 > 1 (false)
q : Mars is an asteroid
p q is true
32

Trivial Proofs
p q is trivially true if q is true,
In this case, we have a trivial proof
Example:
p:x>1
q : 1 = 1 (true)
p q is true
33

Indirect Proofs
To prove p q,
we prove its contrapositive: q p
Example:
if n2 is even then n is even is equivalent to
if n is odd then n2 is odd
We can prove If n2 is even then n is even
by proving If n is odd then n2 is odd
34

Proof by Contradiction
To prove p, we assume p and derive a contradiction.

Based on the tautology:

(pF) p

if the negation of p implies a contradiction then p must be true


Example:
If I win $1,000,000, I will buy a sailboat.
If I buy a sailboat, I will go sailing every summer.
This summer, I will take one vacation.
I plan to go biking this summer.
Prove that I have not yet won $1,000,000.
35

Proof Techniques-Quantifiers
x P(x): provide a proof, not just examples.
Example:
Prove that the product of any two odd integers
is odd.
Prove that if n is an integer and n2 is odd, then n is odd.
Prove that the sum of two rational numbers is rational.

36

Proof Techniques-Quantifiers
Disproving x P(x)

Find an counterexample for x P(x)


a value k in the Universe of Discourse such

that P(k)

37

Das könnte Ihnen auch gefallen