Logika dan Proposisi I dan II
Pertemuan 1
2010
1
Tujuan Pembelajaran
• Mahasiswa mampu memahami konsep logika,
metode pembuktian, himpunan, fungsi,
induksi matematis & rekursi, relasi dan dapat
mengaplikasikannya pada permasalahan
nyata.
2
Kompetensi
•
•
•
•
•
Mahasiswa mampu menjelaskan dengan benar konsep
logika dan dapat mengambil kesimpulan yang benar,
Mahasiswa mampu mengaplikasikan metode-metode
pembuktian yang efesien,
Mahasiswa mampu menjelaskan & mengaplikasikan
konsep himpunan dan fungsi,
Mahasiswa menjelaskan induksi matematis dan rekursi
& mengaplikasikan pada permasalahan nyata
Mahasiswa menjelaskan konsep relasi &
mengaplikasikan pada permasalahan nyata.
3
Cara Belajar
• Perhatikan ketika dosen mengajar
• Kerjakan latihan seluruhnya
• Cocokkan untuk soal ganjil dengan jawaban
dibelakang buku
• Cek web site :
– www.mhhe.com/rosen
4
Buku
1. Rosen, K.H. Discrete Mathematics and
Its Applications, 6th Ed., McGraw-Hill
2. Liu, 1976, Element of Discrete
Mathematics
3. Moot, Joe L., 1986, Discrete
Mathematics fos Computer Scientist
and Mathematicians, New Jersey:
Prentice-Hall
5
Nilai
•
•
•
•
Evaluasi 1
Evaluasi 2
Evaluasi 3
Tugas
25 %
25 %
25 %
25 %
– Maju ke depan
– PR
– program
6
Penilaian
•Semua penilaian jika terlambat, akan
dipotong 25%
7
Aturan untuk Dosen :
1. Maksimal keterlambatan 30 menit, jika belum datang
berarti diganti hari lain
2. Pertemuan minimal 90 % => 90 % x 18 = 17
pertemuan
8
Aturan untuk Mahasiswa
1. Maksimal keterlambatan 30 menit,
• Jika ingin masuk harus membawa kue bagi seluruh
teman (satu kelas)
• Kue dapat dibawa hari itu juga atau pada minggu depan
2. HP harap di silent, jika terdengar bunyi HP, maka :
• harus membawa kue bagi seluruh teman (satu kelas)
• Kue dapat dibawa hari itu juga atau pada minggu depan
9
Aturan untuk Mahasiswa
1. Di kelas di larang selalu berbicara dengan
teman atau menerima telpon, jika ingin
berbicara atau menerima telpon dapat ijin
keluar
2. Jika ingin keluar atau ke toilet ketika dosen
sedang menerangkan, tidak perlu minta ijin,
tapi langsung saja keluar
10
• Buat kelompok yang terdiri dari 3 orang,
dikumpulkan minggu depan
• Yang akan mendapat nilai adalah mahasiswa
yang terdaftar pada portal akademik
11
Cara kuliah
• Tiap akhir kuliah ada PR
• PR terdiri dari :
– PR hari ini dan
– PR resume topik minggu depan
12
Minggu depan
• PR akan dibahas, cara :
– Satu kelompok akan membahas satu masalah di
depan kelas, atau ada kemungkinan
– Satu soal akan dibahas oleh 2 atau lebih
kelompok
• Membahas contoh soal untuk minggu ini
13
Bab dari Buku
•
•
•
•
•
•
Bab 1 Logic and Proof
Bab 2 Sets, function, sequence and sums
Bab 4 Induction and recursion
Bab 7 Advance Counting Technique
Bab 8 Relation
Bab 9 Graph
14
Logika, Proposisi
Sub-bab 1.1 – 1.2
15
Logika
• Mempelajari penalaran/pemikiran (reasoning) secara
benar
• Logic mempelajari bgm cara mengambil kesimpulan
yang benar menurut aturan yang ada ,
misalkan:or,and,not,dll
• Fokus pada relasi antar pernyataan (statement) /
kalimat (sentence).
Contoh:
1. Doni adalah mahasiswa UNIB.
2. Semua mahasiswa UNIBpandai.
3. Doni orang pandai.
16
Logika
• Perhatikan bahwa logika tidak harus
memperhatikan isi kalimat; jika diketahui bahwa
dua kalimat pertama di atas benar, maka kalimat
ketiga harus benar.
17
Proposisi
• Proposisi merupakan sebuah pernyataan atau
kalimat yang punya nilai kebenaran (benar = 1 /
salah = 0). Proposisi disimbolkan dengan huruf
kecil p, q, r, …
• Proposisi kalimat yg dapat bernilai benar atau
salah, tetapi tidak kedua-duanya
• Proposisi biasanya berbentuk kalimat deklaratif
18
Proposisi
• Pernyataan dibawah ini proposisi atau bukan?
•
Matahari terbit dari Timur
Yes
• Bilangan bulat yang membagi habis 23
adalah 1 dan 23.
• Berapa harga tiket ke Manila?
• Silakan duduk.
• X + 4 = 12
• 8- 5=3
Yes
No
No
No
Yes
19
Konektif
• Jika p dan q adalah proposisi, dapat dibentuk
proposisi majemuk (compound proposition) dengan
menggunakan konektif
• Macam-macam konektif:
– AND (konjungsi)
Simbol
– Inclusive OR (disjungsi)
Simbol v
– EXclusive OR(XOR)
Simbol
– NOT (negasi)
Simbol
– Implikasi
Simbol
– Implikasi ganda/biimplikasi
Simbol
20
Tingkat Presedensi
NEGASI
(NOT)
KONJUNGSI
(AND)
DISJUNGSI
(OR, XOR)
IMPLIKASI
IMPLIKASI GANDA
Catatan: mengatasi tingkat presedensi dengan
cara memberikan kurung pada
proposisi yang ingin didahulukan
21
Tabel Kebenaran
(truth table)
konjungsi
p
0
0
1
1
q
0
1
0
1
pq
0
0
0
1
P ^ q bernilai benar jika p dan q benar
22
Contoh
• p = Harimau adalah binatang buas
• q = Malang adalah ibukota Jawa Timur
• p q = Harimau adalah binatang buas dan Malang
adalah ibukota Jawa Timur
• p q salah.
Perhatikan bahwa tidak perlu ada keterkaitan
antara p dan q
23
Tabel Kebenaran
disjungsi (inclusive or)
p
0
0
1
1
q
0
1
0
1
pvq
0
1
1
1
Contoh: p = Joni seorang mahasiswa
q = Mira seorang sarjana hukum
p v q = Joni seorang mahasiswa atau Mira seorang
sarjana hukum
P ^ q bernilai salah jika p dan q salah
24
Tabel Kebenaran
exclusive or
p
0
0
1
1
q
0
1
0
1
pq
0
1
1
0
p q is true only when p is true and q is false, or p is false and q
is true.
Example: p = “bilqis pergi ke Jakarta, q = “bilqis pergi ke Malang"
p q = “pilih salah satu, bilqis pergi ke jakarta atau bilqis pergi
ke malang"
25
Tabel Kebenaran
Negasi
Contoh:
p
0
p
1
1
0
p = Joni seorang mahasiswa
p = Joni bukan seorang mahasiswa
26
Kalimat majemuk
compound statements
p, q, r merupakan kalimat / pernyataan
sederhana (simple statements)
Beberapa contoh bentukan compound
statements, seperti:
–
–
–
–
–
(p q) r
p (q r)
(p) (q)
(p q) (r)
dll
27
Tabel Kebenaran (p r)q
p
0
0
0
0
1
1
1
1
q
0
0
1
1
0
0
1
1
r
0
1
0
1
0
1
0
1
(p r)q
(0 1) 0 = 0
(0 0) 0 = 0
(0 1) 1 = 1
(0 0 1 = 1
(1 1) 0 = 1
(1 0) 0 = 0
(1 1) 1 = 1
(1 0) 1 = 1
28
Implikasi
• Disebut juga proposisi kondisional (conditional
proposition) dan berbentuk
“jika p maka q”
• Notasi simboliknya : p q
• Contoh:
– p = " John rajin belajar"
– q = " John dapat hadiah "
– p q = “If John rajin belajar then John dapat hadiah "
29
Tabel Kebenaran
implikasi
p
q
pq
0
0
1
0
1
1
1
0
0
1
1
1
P q benar jika p dan q benar atau p salah
30
Hipotesa dan konklusi
• Dalam implikasi p q
p disebut anteseden, hipotesa, premis
(antecedent, hypothesis, premise)
q disebut konsekuensi atau konklusi
(consequence, conclusion)
31
Cara menyebut p q
jika p maka q if p then q
jika p, q if p, q
q jika p
q if p
p hanya jika q p only if q
p mengimplikasikan q p implies q
32
Perlu dan Cukup
•
•
•
•
Kondisi “perlu” dinyatakan oleh konklusi.
Kondisi “cukup” dinyatakan oleh hipotesa.
Perlu = necessary; Cukup = sufficient
Contoh:
– Jika Joni seorang mahasiswa maka Mira
seorang sarjana hukum
– Kondisi perlu: ?
• Mira seorang sarjana hukum
– Kondisi cukup: ?
• Joni seorang mahasiswa
33
Ekivalensi Logikal
Dua proposisi yang tabel kebenarannya identik
disebut ekivalen (logically equivalent).
Contoh: p q ekivalen (logically equivalent
to) p q
p
0
0
1
1
q
pq
pq
0
1
0
1
1
1
0
1
1
1
0
1
34
Konversi dan Inversi
•
•
•
•
Konversi dari p q adalah q p
Inversi dari p q adalah p q
p q tidak ekivalen q p
p q tidak ekivalen p q
p
q
0
0
1
1
0
1
0
1
pq
1
1
0
1
qp
1
0
1
1
p q
1
0
1
1
35
Kontrapositif
• kontrapositif dari proposisi p q adalah q p.
• p q dan q p ekivalen
p
0
0
1
1
q
0
1
0
1
pq
1
1
0
1
qp
1
1
0
1
36
Ekivalensi Logika
Ekivalensi Logika lain dapat dilihat di
buku teks Sub-bab 1.2. halaman 24
Tabel 6
Tabel 7
Tabel 8
37
Implikasi Ganda
• Implikasi Ganda (double implication) dibaca
“p jika dan hanya jika q”
• Notasi simboliknya p q
• p q ekivalen dengan (p q)^(q p)
p
q
pq
(p q) (q p)
0
0
1
1
0
1
0
1
1
0
0
1
1
0
0
1
38
Propositional Logic 2 more defn…
A tautology is a proposition that’s always TRUE.
A contradiction is a proposition that’s always FALSE.
p
T
F
05/20/18
p
p p
p p
F
T
T
F
T
F
Tautology
Proposisi yang selalu bernilai benar (true)
dalam keadaan apapun
Contoh: p p v q
p
q
ppvq
0
0
1
0
1
1
1
0
1
1
1
1
40
Kontradiksi
Proposisi yang selalu bernilai salah
(false) dalam keadaan apapun
Contoh : p ( p )
p
0
p ( p)
0
1
0
41
Hukum De Morgan
(p q) ekivalen dengan ( p) ( q)
(p q) ekivalen dengan ( p) ( q)
Bukti (yang pertama, buktikan yang kedua
sendiri):
p
q
p
q
pq
0
0
1
1
0
1
1
0
1
1
0
1
0
0
1
0
0
1
1
0
0
1
1
0
0
1
0
0
(pq)
(p)(q)
42
Propositional Logic an unfamous
if NOT (blue AND NOT red) OR red then…
(p q) q p q
(p q) q
05/20/18
(p
(q)) q
(p
q) q
DeMorgan’s
Double negation
p (q q)
Associativity
p q
Idempotent
Propositional Logic one last proof
Show that [p (p q)] q is a tautology.
We use to show that [p (p q)] q T.
[p (p q)] q
[p (p q)] q
substitution for
[(p p) (p q)] q
distributive
05/20/18
[ F (p q)] q
(p q) q
(p q) q
(p q) q
p (q q )
p T
T
uniqueness
identity
substitution for
DeMorgan’s
associative
excluded middle
domination
Predicate Logic everybody loves somebody
Proposition, YES or NO?
3 + 2 = 5 YES
X + 2 = 5
NO
X + 2 = 5 for any choice of X in
{1, 2, 3}
YES
X + 2 = 5 for some X in {1, 2, 3}
05/20/18
YES
Predicates
…
Alicia eats pizza at least once a week.
Define:
EP(x) = “x eats pizza at least once a week.”
Universe of Discourse - x is a student in cs173
A predicate, or propositional function, is a
function that takes some variable(s) as
arguments and returns True or False.
Note that EP(x) is not a proposition, EP(Ariel)
is.
05/20/18
Predicates
Suppose Q(x,y) = “x > y”
Proposition, YES or NO?
Q(x,y)
NO
Q(3,4)
Predicate, YES or NO?
YES
Q(x,9)
YES
Q(x,y)
NO
Q(3,4)
NO
Q(x,9)
YES
05/20/18
Predicate Logic everybody loves somebody
Proposition, YES or NO?
3 + 2 = 5 YES
X + 2 = 5
NO
X + 2 = 5 for any choice of X in
{1, 2, 3}
YES
X + 2 = 5 for some X in {1, 2, 3}
05/20/18
YES
Predicates the universal quantifier
Another way of changing a predicate into a proposition.
Suppose P(x) is a predicate on some universe of discourse.
Ex. B(x) = “x is carrying a backpack,” x is set of cs173
students.
The universal quantifier of P(x) is the proposition:
“P(x) is true for all x in the universe of discourse.”
We write it x P(x), and say “for all x, P(x)”
x P(x) is TRUE if P(x) is true for every single x.
x P(x) is FALSE if there is an x for which P(x) is false.
05/20/18
x
B(x)?
Predicates the universal quantifier
Universe of
B(x) = “x is wearing sneakers.” discourse is people
L(x) = “x is at least 21 years old.”
in this room.
Y(x)= “x is less than 24 years old.”
Are either of these propositions true?
a)
b)
x (Y(x) B(x))
x (Y(x) L(x))
A: only a is
true
B: only b is
true
C: both are
true
05/20/18
D: neither is
Predicates the existential quantifier
Another way of changing a predicate into a proposition.
Suppose P(x) is a predicate on some universe of discourse.
Ex. C(x) = “x has a candy bar,” x is set of cs173 students.
The existential quantifier of P(x) is the proposition:
“P(x) is true for some x in the universe of discourse.”
We write it x P(x), and say “for some x, P(x)”
x P(x) is TRUE if there is an x for which P(x) is true.
x P(x) is FALSE if P(x) is false for every single x.
05/20/18
x
C(x)?
Predicates the existential quantifier
Universe of
B(x) = “x is wearing sneakers.” discourse is people
L(x) = “x is at least 21 years old.”
in this room.
Y(x)= “x is less than 24 years old.”
Are either of these propositions true?
a)
b)
x B(x)
x (Y(x) L(x))
A: only a is
true
B: only b is
true
C: both are
true
05/20/18
D: neither is
Predicates more examples
L(x) = “x is a lion.”Universe of
discourse is
F(x) = “x is fierce.”creatures.
C(x) = “x drinks coffee.”
All lions are fierce.
x
all
(L(x) F(x))
Some lions don’t drink coffee.
x (L(x) C(x))
Some fierce creatures don’t drink coffee.
x (F(x) C(x))
05/20/18
Predicates more examples
B(x)
L(x)
H(x)
R(x)
=
=
=
=
“x
“x
“x
“x
is a hummingbird.”
Universe of
is a large bird.”
lives on honey.”discourse is all
creatures.
is richly colored.”
x (B(x)
All hummingbirds are richly colored.
R(x))
No large birds live on honey.
x (L(x) H(x))
Birds that do not live on honey are dully
colored.
05/20/18
x (H(x) R(x))
Predicates quantifier negation
x (L(x)
Not all large birds live on honey.
H(x))
x P(x) means “P(x) is true for every x.”
What about x P(x) ?
Not [“P(x) is true for every x.”]
“There is an x for which P(x) is not true.”
x P(x)
So, x P(x) is the same as x P(x).
x (L(x) H(x))
05/20/18
Predicates quantifier negation
No large birds live on honey.
x (L(x) H(x))
x P(x) means “P(x) is true for some x.”
What about x P(x) ?
Not [“P(x) is true for some x.”]
“P(x) is not true for all x.”
x P(x)
So, x P(x) is the same as x P(x).
x (L(x) H(x))
05/20/18
Predicates quantifier negation
So, x P(x) is the same as
So, x P(x) is the same as
x P(x).
x P(x).
General rule: to negate a quantifier, move
negation to the right, changing
quantifiers as you go.
05/20/18
Predicates quantifier negation
No large birds live on honey.
x (L(x) H(x)) x (L(x) H(x))
Negation
rule
x (L(x) H(x))
DeMorgan’s
x (L(x) H(x))
Subst for
What’s wrong with this
proof?
05/20/18
PR kelompok
• Menjawab
– 1.1 11, 17, 19, 23, 37, 45, 47
– 1.2 1, 11, 13
• Menjawab semua soal latihan yang ada di
pertemuan 2
• Meringkas bab 1.3 dari buku
• Sistem belajar yang bagaimana yang anda
inginkan agar anda semangat belajar
59
2010
1
Tujuan Pembelajaran
• Mahasiswa mampu memahami konsep logika,
metode pembuktian, himpunan, fungsi,
induksi matematis & rekursi, relasi dan dapat
mengaplikasikannya pada permasalahan
nyata.
2
Kompetensi
•
•
•
•
•
Mahasiswa mampu menjelaskan dengan benar konsep
logika dan dapat mengambil kesimpulan yang benar,
Mahasiswa mampu mengaplikasikan metode-metode
pembuktian yang efesien,
Mahasiswa mampu menjelaskan & mengaplikasikan
konsep himpunan dan fungsi,
Mahasiswa menjelaskan induksi matematis dan rekursi
& mengaplikasikan pada permasalahan nyata
Mahasiswa menjelaskan konsep relasi &
mengaplikasikan pada permasalahan nyata.
3
Cara Belajar
• Perhatikan ketika dosen mengajar
• Kerjakan latihan seluruhnya
• Cocokkan untuk soal ganjil dengan jawaban
dibelakang buku
• Cek web site :
– www.mhhe.com/rosen
4
Buku
1. Rosen, K.H. Discrete Mathematics and
Its Applications, 6th Ed., McGraw-Hill
2. Liu, 1976, Element of Discrete
Mathematics
3. Moot, Joe L., 1986, Discrete
Mathematics fos Computer Scientist
and Mathematicians, New Jersey:
Prentice-Hall
5
Nilai
•
•
•
•
Evaluasi 1
Evaluasi 2
Evaluasi 3
Tugas
25 %
25 %
25 %
25 %
– Maju ke depan
– PR
– program
6
Penilaian
•Semua penilaian jika terlambat, akan
dipotong 25%
7
Aturan untuk Dosen :
1. Maksimal keterlambatan 30 menit, jika belum datang
berarti diganti hari lain
2. Pertemuan minimal 90 % => 90 % x 18 = 17
pertemuan
8
Aturan untuk Mahasiswa
1. Maksimal keterlambatan 30 menit,
• Jika ingin masuk harus membawa kue bagi seluruh
teman (satu kelas)
• Kue dapat dibawa hari itu juga atau pada minggu depan
2. HP harap di silent, jika terdengar bunyi HP, maka :
• harus membawa kue bagi seluruh teman (satu kelas)
• Kue dapat dibawa hari itu juga atau pada minggu depan
9
Aturan untuk Mahasiswa
1. Di kelas di larang selalu berbicara dengan
teman atau menerima telpon, jika ingin
berbicara atau menerima telpon dapat ijin
keluar
2. Jika ingin keluar atau ke toilet ketika dosen
sedang menerangkan, tidak perlu minta ijin,
tapi langsung saja keluar
10
• Buat kelompok yang terdiri dari 3 orang,
dikumpulkan minggu depan
• Yang akan mendapat nilai adalah mahasiswa
yang terdaftar pada portal akademik
11
Cara kuliah
• Tiap akhir kuliah ada PR
• PR terdiri dari :
– PR hari ini dan
– PR resume topik minggu depan
12
Minggu depan
• PR akan dibahas, cara :
– Satu kelompok akan membahas satu masalah di
depan kelas, atau ada kemungkinan
– Satu soal akan dibahas oleh 2 atau lebih
kelompok
• Membahas contoh soal untuk minggu ini
13
Bab dari Buku
•
•
•
•
•
•
Bab 1 Logic and Proof
Bab 2 Sets, function, sequence and sums
Bab 4 Induction and recursion
Bab 7 Advance Counting Technique
Bab 8 Relation
Bab 9 Graph
14
Logika, Proposisi
Sub-bab 1.1 – 1.2
15
Logika
• Mempelajari penalaran/pemikiran (reasoning) secara
benar
• Logic mempelajari bgm cara mengambil kesimpulan
yang benar menurut aturan yang ada ,
misalkan:or,and,not,dll
• Fokus pada relasi antar pernyataan (statement) /
kalimat (sentence).
Contoh:
1. Doni adalah mahasiswa UNIB.
2. Semua mahasiswa UNIBpandai.
3. Doni orang pandai.
16
Logika
• Perhatikan bahwa logika tidak harus
memperhatikan isi kalimat; jika diketahui bahwa
dua kalimat pertama di atas benar, maka kalimat
ketiga harus benar.
17
Proposisi
• Proposisi merupakan sebuah pernyataan atau
kalimat yang punya nilai kebenaran (benar = 1 /
salah = 0). Proposisi disimbolkan dengan huruf
kecil p, q, r, …
• Proposisi kalimat yg dapat bernilai benar atau
salah, tetapi tidak kedua-duanya
• Proposisi biasanya berbentuk kalimat deklaratif
18
Proposisi
• Pernyataan dibawah ini proposisi atau bukan?
•
Matahari terbit dari Timur
Yes
• Bilangan bulat yang membagi habis 23
adalah 1 dan 23.
• Berapa harga tiket ke Manila?
• Silakan duduk.
• X + 4 = 12
• 8- 5=3
Yes
No
No
No
Yes
19
Konektif
• Jika p dan q adalah proposisi, dapat dibentuk
proposisi majemuk (compound proposition) dengan
menggunakan konektif
• Macam-macam konektif:
– AND (konjungsi)
Simbol
– Inclusive OR (disjungsi)
Simbol v
– EXclusive OR(XOR)
Simbol
– NOT (negasi)
Simbol
– Implikasi
Simbol
– Implikasi ganda/biimplikasi
Simbol
20
Tingkat Presedensi
NEGASI
(NOT)
KONJUNGSI
(AND)
DISJUNGSI
(OR, XOR)
IMPLIKASI
IMPLIKASI GANDA
Catatan: mengatasi tingkat presedensi dengan
cara memberikan kurung pada
proposisi yang ingin didahulukan
21
Tabel Kebenaran
(truth table)
konjungsi
p
0
0
1
1
q
0
1
0
1
pq
0
0
0
1
P ^ q bernilai benar jika p dan q benar
22
Contoh
• p = Harimau adalah binatang buas
• q = Malang adalah ibukota Jawa Timur
• p q = Harimau adalah binatang buas dan Malang
adalah ibukota Jawa Timur
• p q salah.
Perhatikan bahwa tidak perlu ada keterkaitan
antara p dan q
23
Tabel Kebenaran
disjungsi (inclusive or)
p
0
0
1
1
q
0
1
0
1
pvq
0
1
1
1
Contoh: p = Joni seorang mahasiswa
q = Mira seorang sarjana hukum
p v q = Joni seorang mahasiswa atau Mira seorang
sarjana hukum
P ^ q bernilai salah jika p dan q salah
24
Tabel Kebenaran
exclusive or
p
0
0
1
1
q
0
1
0
1
pq
0
1
1
0
p q is true only when p is true and q is false, or p is false and q
is true.
Example: p = “bilqis pergi ke Jakarta, q = “bilqis pergi ke Malang"
p q = “pilih salah satu, bilqis pergi ke jakarta atau bilqis pergi
ke malang"
25
Tabel Kebenaran
Negasi
Contoh:
p
0
p
1
1
0
p = Joni seorang mahasiswa
p = Joni bukan seorang mahasiswa
26
Kalimat majemuk
compound statements
p, q, r merupakan kalimat / pernyataan
sederhana (simple statements)
Beberapa contoh bentukan compound
statements, seperti:
–
–
–
–
–
(p q) r
p (q r)
(p) (q)
(p q) (r)
dll
27
Tabel Kebenaran (p r)q
p
0
0
0
0
1
1
1
1
q
0
0
1
1
0
0
1
1
r
0
1
0
1
0
1
0
1
(p r)q
(0 1) 0 = 0
(0 0) 0 = 0
(0 1) 1 = 1
(0 0 1 = 1
(1 1) 0 = 1
(1 0) 0 = 0
(1 1) 1 = 1
(1 0) 1 = 1
28
Implikasi
• Disebut juga proposisi kondisional (conditional
proposition) dan berbentuk
“jika p maka q”
• Notasi simboliknya : p q
• Contoh:
– p = " John rajin belajar"
– q = " John dapat hadiah "
– p q = “If John rajin belajar then John dapat hadiah "
29
Tabel Kebenaran
implikasi
p
q
pq
0
0
1
0
1
1
1
0
0
1
1
1
P q benar jika p dan q benar atau p salah
30
Hipotesa dan konklusi
• Dalam implikasi p q
p disebut anteseden, hipotesa, premis
(antecedent, hypothesis, premise)
q disebut konsekuensi atau konklusi
(consequence, conclusion)
31
Cara menyebut p q
jika p maka q if p then q
jika p, q if p, q
q jika p
q if p
p hanya jika q p only if q
p mengimplikasikan q p implies q
32
Perlu dan Cukup
•
•
•
•
Kondisi “perlu” dinyatakan oleh konklusi.
Kondisi “cukup” dinyatakan oleh hipotesa.
Perlu = necessary; Cukup = sufficient
Contoh:
– Jika Joni seorang mahasiswa maka Mira
seorang sarjana hukum
– Kondisi perlu: ?
• Mira seorang sarjana hukum
– Kondisi cukup: ?
• Joni seorang mahasiswa
33
Ekivalensi Logikal
Dua proposisi yang tabel kebenarannya identik
disebut ekivalen (logically equivalent).
Contoh: p q ekivalen (logically equivalent
to) p q
p
0
0
1
1
q
pq
pq
0
1
0
1
1
1
0
1
1
1
0
1
34
Konversi dan Inversi
•
•
•
•
Konversi dari p q adalah q p
Inversi dari p q adalah p q
p q tidak ekivalen q p
p q tidak ekivalen p q
p
q
0
0
1
1
0
1
0
1
pq
1
1
0
1
qp
1
0
1
1
p q
1
0
1
1
35
Kontrapositif
• kontrapositif dari proposisi p q adalah q p.
• p q dan q p ekivalen
p
0
0
1
1
q
0
1
0
1
pq
1
1
0
1
qp
1
1
0
1
36
Ekivalensi Logika
Ekivalensi Logika lain dapat dilihat di
buku teks Sub-bab 1.2. halaman 24
Tabel 6
Tabel 7
Tabel 8
37
Implikasi Ganda
• Implikasi Ganda (double implication) dibaca
“p jika dan hanya jika q”
• Notasi simboliknya p q
• p q ekivalen dengan (p q)^(q p)
p
q
pq
(p q) (q p)
0
0
1
1
0
1
0
1
1
0
0
1
1
0
0
1
38
Propositional Logic 2 more defn…
A tautology is a proposition that’s always TRUE.
A contradiction is a proposition that’s always FALSE.
p
T
F
05/20/18
p
p p
p p
F
T
T
F
T
F
Tautology
Proposisi yang selalu bernilai benar (true)
dalam keadaan apapun
Contoh: p p v q
p
q
ppvq
0
0
1
0
1
1
1
0
1
1
1
1
40
Kontradiksi
Proposisi yang selalu bernilai salah
(false) dalam keadaan apapun
Contoh : p ( p )
p
0
p ( p)
0
1
0
41
Hukum De Morgan
(p q) ekivalen dengan ( p) ( q)
(p q) ekivalen dengan ( p) ( q)
Bukti (yang pertama, buktikan yang kedua
sendiri):
p
q
p
q
pq
0
0
1
1
0
1
1
0
1
1
0
1
0
0
1
0
0
1
1
0
0
1
1
0
0
1
0
0
(pq)
(p)(q)
42
Propositional Logic an unfamous
if NOT (blue AND NOT red) OR red then…
(p q) q p q
(p q) q
05/20/18
(p
(q)) q
(p
q) q
DeMorgan’s
Double negation
p (q q)
Associativity
p q
Idempotent
Propositional Logic one last proof
Show that [p (p q)] q is a tautology.
We use to show that [p (p q)] q T.
[p (p q)] q
[p (p q)] q
substitution for
[(p p) (p q)] q
distributive
05/20/18
[ F (p q)] q
(p q) q
(p q) q
(p q) q
p (q q )
p T
T
uniqueness
identity
substitution for
DeMorgan’s
associative
excluded middle
domination
Predicate Logic everybody loves somebody
Proposition, YES or NO?
3 + 2 = 5 YES
X + 2 = 5
NO
X + 2 = 5 for any choice of X in
{1, 2, 3}
YES
X + 2 = 5 for some X in {1, 2, 3}
05/20/18
YES
Predicates
…
Alicia eats pizza at least once a week.
Define:
EP(x) = “x eats pizza at least once a week.”
Universe of Discourse - x is a student in cs173
A predicate, or propositional function, is a
function that takes some variable(s) as
arguments and returns True or False.
Note that EP(x) is not a proposition, EP(Ariel)
is.
05/20/18
Predicates
Suppose Q(x,y) = “x > y”
Proposition, YES or NO?
Q(x,y)
NO
Q(3,4)
Predicate, YES or NO?
YES
Q(x,9)
YES
Q(x,y)
NO
Q(3,4)
NO
Q(x,9)
YES
05/20/18
Predicate Logic everybody loves somebody
Proposition, YES or NO?
3 + 2 = 5 YES
X + 2 = 5
NO
X + 2 = 5 for any choice of X in
{1, 2, 3}
YES
X + 2 = 5 for some X in {1, 2, 3}
05/20/18
YES
Predicates the universal quantifier
Another way of changing a predicate into a proposition.
Suppose P(x) is a predicate on some universe of discourse.
Ex. B(x) = “x is carrying a backpack,” x is set of cs173
students.
The universal quantifier of P(x) is the proposition:
“P(x) is true for all x in the universe of discourse.”
We write it x P(x), and say “for all x, P(x)”
x P(x) is TRUE if P(x) is true for every single x.
x P(x) is FALSE if there is an x for which P(x) is false.
05/20/18
x
B(x)?
Predicates the universal quantifier
Universe of
B(x) = “x is wearing sneakers.” discourse is people
L(x) = “x is at least 21 years old.”
in this room.
Y(x)= “x is less than 24 years old.”
Are either of these propositions true?
a)
b)
x (Y(x) B(x))
x (Y(x) L(x))
A: only a is
true
B: only b is
true
C: both are
true
05/20/18
D: neither is
Predicates the existential quantifier
Another way of changing a predicate into a proposition.
Suppose P(x) is a predicate on some universe of discourse.
Ex. C(x) = “x has a candy bar,” x is set of cs173 students.
The existential quantifier of P(x) is the proposition:
“P(x) is true for some x in the universe of discourse.”
We write it x P(x), and say “for some x, P(x)”
x P(x) is TRUE if there is an x for which P(x) is true.
x P(x) is FALSE if P(x) is false for every single x.
05/20/18
x
C(x)?
Predicates the existential quantifier
Universe of
B(x) = “x is wearing sneakers.” discourse is people
L(x) = “x is at least 21 years old.”
in this room.
Y(x)= “x is less than 24 years old.”
Are either of these propositions true?
a)
b)
x B(x)
x (Y(x) L(x))
A: only a is
true
B: only b is
true
C: both are
true
05/20/18
D: neither is
Predicates more examples
L(x) = “x is a lion.”Universe of
discourse is
F(x) = “x is fierce.”creatures.
C(x) = “x drinks coffee.”
All lions are fierce.
x
all
(L(x) F(x))
Some lions don’t drink coffee.
x (L(x) C(x))
Some fierce creatures don’t drink coffee.
x (F(x) C(x))
05/20/18
Predicates more examples
B(x)
L(x)
H(x)
R(x)
=
=
=
=
“x
“x
“x
“x
is a hummingbird.”
Universe of
is a large bird.”
lives on honey.”discourse is all
creatures.
is richly colored.”
x (B(x)
All hummingbirds are richly colored.
R(x))
No large birds live on honey.
x (L(x) H(x))
Birds that do not live on honey are dully
colored.
05/20/18
x (H(x) R(x))
Predicates quantifier negation
x (L(x)
Not all large birds live on honey.
H(x))
x P(x) means “P(x) is true for every x.”
What about x P(x) ?
Not [“P(x) is true for every x.”]
“There is an x for which P(x) is not true.”
x P(x)
So, x P(x) is the same as x P(x).
x (L(x) H(x))
05/20/18
Predicates quantifier negation
No large birds live on honey.
x (L(x) H(x))
x P(x) means “P(x) is true for some x.”
What about x P(x) ?
Not [“P(x) is true for some x.”]
“P(x) is not true for all x.”
x P(x)
So, x P(x) is the same as x P(x).
x (L(x) H(x))
05/20/18
Predicates quantifier negation
So, x P(x) is the same as
So, x P(x) is the same as
x P(x).
x P(x).
General rule: to negate a quantifier, move
negation to the right, changing
quantifiers as you go.
05/20/18
Predicates quantifier negation
No large birds live on honey.
x (L(x) H(x)) x (L(x) H(x))
Negation
rule
x (L(x) H(x))
DeMorgan’s
x (L(x) H(x))
Subst for
What’s wrong with this
proof?
05/20/18
PR kelompok
• Menjawab
– 1.1 11, 17, 19, 23, 37, 45, 47
– 1.2 1, 11, 13
• Menjawab semua soal latihan yang ada di
pertemuan 2
• Meringkas bab 1.3 dari buku
• Sistem belajar yang bagaimana yang anda
inginkan agar anda semangat belajar
59