Sei sulla pagina 1di 32

Matematika Diskrit

3 SKS

Buku Teks :
Discrete Mathematics and Its Applications, Kenneth H Rosen, McGraw-Hill, 6th edition

Penilaian :
tugas tes 1 tes 2 uas : : : : 20% 25% 25% 30%

discrete mathematics
The foundations : Logic and Proofs 2. Basic Structures: sets, functions, sequences, sums 3. The Fundamentals: algorithms, the integers, matrices 4. Induction and Recursion 5. Counting 6. Discrete Probability 7. Advanced Counting Techniques 8. Relations 9. Graphs 10. Trees
1.

discrete mathematics
Boolean Algebra 12. Modeling Computation 13. Appendices
11.

Chapter 1
The Foundations: Logic and Proofs
1.1. Propositional Logic 1.2. Propositional Equivalences 1.3. Predicates and Quantifiers 1.4. Nested Quantifiers 1.5. Rules of Inference 1.6. Introduction to Proofs 1.7. Proof Methods and Strategy End-of-Chapter Material

Propositional Logic
Chapter 1.1.

Proposition

A propositional variable is denoted by the letters p, q, r, It is either true or false, but not both Its true value is called true (1) or false (0) Propositional variables are denoted by the letters p, q, etc. Examples : today is Tuesday 1+1=2 2+2=3 Not a proposition: what time is it ? you may be seated

Compound Propositions
compound statements

Let p, q, r be simple propositions

A compound proposition is obtained by connecting p, q, r using logical operators (or connectives) Example: we are studying and it is raining Surabaya is a city or Malang is an ocean

connectives

NOT (negation) Symbol AND (conjunction) Symbol Inclusive OR (disjunction) Symbol EXclusive OR (XOR) Symbol Conditional statement Symbol (implication) Biconditional Symbol

Level of Precedence
NEGATION (NOT)

CONJUNCTION
DISJUNCTION CONDITIONAL BICONDITIONAL

(AND)
(OR, XOR)

examples

compound propositions examples:

(p q) r p (q r) (p) (q) (p q) (r)

Truth Table
Negation
p 0 1 p 1 0

example:

p = today is Tuesday p = today is not Tuesday (today is Monday)

Truth Table conjunction


p 0 0 1 1
example:

q 0 1 0 1

pq 0 0 0 1

p = today is Tuesday
q = it is raining

p q = today is Tuesday and it is raining

Truth table
disjunction (inclusive or)
p 0 q 0 pvq 0

0 1 1

1 0 1

1 1 1

example: p = John is a student


q = Mia is a lawyer p v q = John is a student or Mia is a lawyer

Truth table
exclusive or
p 0 0 1 1 q 0 1 0 1 pq 0 1 1 0

example: p = John is a student q = Mia is a lawyer p v q = either John is a student or Mia is a lawyer

Truth Table (p r)q


p 0 0 q 0 0 r 0 1 (p r)q (0 1) 0 = 0 (0 0) 0 = 0

0
0 1

1
1 0

0
1 0

(0 1) 1 = 1
(0 0 1 = 1 (1 1) 0 = 1

1 1
1

0 1
1

1 0
1

(1 0) 0 = 0 (1 1) 1 = 1
(1 0) 1 = 1

Truth Table p r q
p 0 0 q 0 0 r 0 1 p (r q)

0
0 1

1
1 0

0
1 0

1 1
1

0 1
1

1 0
1

Example 18 p. 13 a logic puzzle by Smullyan


An island has two kinds of inhabitants, knights, who always tell the truth, and their opposites, knaves, who always lie. You encounter two people A and B. What are A and B ? if A says B is a knight and B says The two of us are opposite types

Truth Table
implication
p 0 q 0 pq 1

0
1 1

1
0 1

1
0 1

Implication

Notation : p q Examples : 1. if 2 + 2 = 4 then x := x + 1 2. if m > 0 then y := 2 * y 3. if it is raining then we will not go

Let s denote 2 + 2 = 4 and a denote x := x + 1 The symbolic notation for example 1 : s a

Hypothesis & Conclusion


In the implication p q p is called the antecedent, hypothesis, premise q is called the consequence, conclusion

Ways to express p q
jika p maka q jika p, q q jika p p hanya jika q p mengimplikasikan q if p then q if p, q q if p p only if q p implies q
see page 6

Necessary & Sufficient conditions


pq
is necessary for p

is a sufficient condition for q

Conversion & Inversion


The conversion of p q is q p The inversion of p q is p q p q is not equivalent to q p p q is not equivalent to p q

p 0

q 0

pq 1

qp 1

p q 1

0 1 1

1 0 1

1 0 1

0 1 1

0 1 1

contrapositive
The contrapositive of p q is q p. p q and q p are equivalent

pq

qp

0
0 1 1

0
1 0 1

1
1 0 1

1
1 0 1

Biconditional
p if and only if q
pq
p 0 0 1 1 q 0 1 0 1 pq 1 0 0 1 (p q) (q p) 1 0 0 1

Propositional Equivalence

Chapter 1.2.

Tautology
A proposition that is always true example: p p v q
p
0 0 1 1

q
0 1 0 1

ppvq
1 1 1 1

Contradiction
a proposition that is always false

example : p ( p )
p 0 1 p ( p) 0 0

Logical Equivalence
Notation p q ( p and q are compound propositions ) Example : p q is logically equivalent to p q

p 0 0 1 1

q 0 1 0 1

pq 1 1 0 1

pq 1 1 0 1

Logical Equivalence
See pages 24, 25 Table 6 Table 7 Table 8

De Morgans Law

(p q) ( p) ( q) (p q) ( p) ( q)

p 0 0 1 1

q 0 1 0 1

p 1 1 0 0

q 1 0 1 0

pq 0 1 1 1

(pq) 1 0 0 0

(p)(q) 1 0 0 0

Homework

Chapter 1.1. no. 35 - 38 Chapter 1.2. no. 7, 9, 16, 17

Potrebbero piacerti anche