1
Tujuan Pembelajaran
• Mahasiswa mampu memahami konsep logika, metode pembuktian, himpunan, fungsi,
induksi matematis & rekursi, relasi dan dapat mengaplikasikannya pada permasalahan
3
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 &
Cara Belajar
• Perhatikan ketika dosen mengajar • Kerjakan latihan seluruhnya
• Cocokkan untuk soal ganjil dengan jawaban dibelakang buku
• Cek web site :
5
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:
Nilai
• Evaluasi 1 25 %
• Evaluasi 2 25 %
• Evaluasi 3 25 %
• Tugas 25 %
– Maju ke depan – PR
7
Penilaian
•Semua penilaian jika terlambat, akan
Aturan untuk Dosen :
1. Maksimal keterlambatan 30 menit, jika belum datang berarti diganti hari lain
9
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)
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
11
• Buat kelompok yang terdiri dari 3 orang, dikumpulkan minggu depan
Cara kuliah
• Tiap akhir kuliah ada PR • PR terdiri dari :
– PR hari ini dan
13
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
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
15
Logika, Proposisi
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:
17
Logika
• Perhatikan bahwa logika tidak harus
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
• Pernyataan dibawah ini proposisi atau bukan?
19
• Matahari terbit dari Timur Yes
• Bilangan bulat yang membagi habis 23
adalah 1 dan 23. Yes
• Berapa harga tiket ke Manila? No
• Silakan duduk. No
• X + 4 = 12 No
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
21
Tingkat Presedensi
NEGASI (NOT)
KONJUNGSI (AND)
DISJUNGSI (OR, XOR)
IMPLIKASI
IMPLIKASI GANDA
Catatan: mengatasi tingkat presedensi dengan cara memberikan kurung pada
Tabel Kebenaran
(truth table )
konjungsi
p q p q
0 0 0
0 1 0
1 0 0
23
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.
Tabel Kebenaran
disjungsi (
inclusive or
)
Contoh: p = Joni seorang mahasiswa
q = Mira seorang sarjana hukum
p v q = Joni seorang mahasiswa atau Mira seorang sarjana hukum
p q p v q
0 0 0
0 1 1
1 0 1
25
Tabel Kebenaran
exclusive or
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
Tabel Kebenaran
Negasi
Contoh: p = Joni seorang mahasiswa
p = Joni bukan seorang mahasiswa
p p
0 1
27
Kalimat majemuk
compound statements
p, q, r merupakan kalimat / pernyataan sederhana (simple statements)
Tabel Kebenaran (p
r)
q
p q r (p r)q
0 0 0 (0 1) 0 = 0
0 0 1 (0 0) 0 = 0
0 1 0 (0 1) 1 = 1
0 1 1 (0 0 1 = 1
1 0 0 (1 1) 0 = 1
1 0 1 (1 0) 0 = 0
29
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 "
Tabel Kebenaran
implikasi
p q p q
0 0 1
0 1 1
1 0 0
31
Hipotesa dan konklusi
• Dalam implikasi p q
p disebut anteseden, hipotesa, premis (antecedent, hypothesis, premise)
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
33
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: ?
Ekivalensi Logikal
Dua proposisi yang tabel kebenarannya identik disebut ekivalen (logically equivalent).
Contoh: p q ekivalen (logically equivalent
to) p q
p q p q p q
0 0 1 1
0 1 1 1
Kontrapositif
• kontrapositif dari proposisi p q adalah q p. • p q dan q p ekivalen
p q p q q p
0 0 1 1
0 1 1 1
1 0 0 0
37
Ekivalensi Logika
Ekivalensi Logika lain dapat dilihat di buku teks Sub-bab 1.2. halaman 24
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 p q (p q) (q p)
0 0 1 1
0 1 0 0
05/20/18
Propositional Logic 2 more defn…
A tautology is a proposition that’s always TRUE.
A contradiction is a proposition that’s always FALSE.
p p p p p p
T F
F T
T T
Tautology
Proposisi yang selalu bernilai benar (
true
)
dalam keadaan apapun
Contoh: p p v q
p q p p v q
0 0 1
0 1 1
41
Kontradiksi
Proposisi yang selalu bernilai salah
(
false
) dalam keadaan apapun
Contoh : p
(
p )
p p ( p)
0 0
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 (pq) (p)(q)
0 0 1 1 0 1 1
05/20/18
Propositional Logic an unfamous
(p q) q p q
if NOT (blue AND NOT red) OR red then…
05/20/18
Predicate Logic everybody loves somebody
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)
Predicate, YES or NO?
Predicate Logic everybody loves somebody
Proposition, YES or NO? 3 + 2 = 5
X + 2 = 5
X + 2 = 5 for any choice of X in
{1, 2, 3}
X + 2 = 5 for some X in {1, 2, 3}
YES
NO
YES
05/20/18
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.
x
Predicates the universal quantifier
B(x) = “x is wearing sneakers.”
L(x) = “x is at least 21 years old.” Y(x)= “x is less than 24 years old.”
Are either of these propositions true?
a) x (Y(x) B(x))
05/20/18
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.
x
Predicates the existential quantifier
B(x) = “x is wearing sneakers.”
L(x) = “x is at least 21 years old.” Y(x)= “x is less than 24 years old.”
Are either of these propositions true?
a) x B(x)
05/20/18
Predicates more examples
Universe of
discourse is all creatures.
L(x) = “x is a lion.” F(x) = “x is fierce.”
C(x) = “x drinks coffee.”
All lions are fierce.
Some lions don’t drink coffee.
Some fierce creatures don’t drink coffee.
x (L(x) F(x))
x (L(x) C(x))
Predicates more examples
Universe of
discourse is all creatures.
B(x) = “x is a hummingbird.” L(x) = “x is a large bird.” H(x) = “x lives on honey.”
R(x) = “x is richly colored.”
All hummingbirds are richly colored. No large birds live on honey.
Birds that do not live on honey are dully colored.
x (B(x) R(x))
05/20/18
Predicates quantifier negation
Not all large birds live on honey.
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))
Predicates quantifier negation
No large birds live on honey.
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).
05/20/18
Predicates quantifier negation
So, x P(x) is the same as x P(x).
So, x P(x) is the same as x P(x).
General rule: to negate a quantifier, move negation to the right, changing
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
59
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