Materi 1 PROPOSITION LOGIC Proposition Sentences Notation Interpretation Exercise LOGIKA INFORMATIKA Heri Sismoro, M.Kom. STMIK AMIKOM Yogyakarta 2010 1
Propositions Komponen dasar pembentuk kalimat logika (sentence) Membentuk kalimat deklaratif~yaitu kalimat yang dapat ditentukan nilai kebenarannya (truth value), true atau false tetapi tidak keduanya Contoh: 1. Jakarta ibu kota negara Indonesia 2. 3 adalah bilangan prima yang pertama 3. 6+9>20 Dinyatakan dengan: 1. Truth Value, (misal: true dan false) 2. Propositional Symbols, (misal: p, q, r, s, t,...) 2
Sententces Dibangun dari proposisi-proposisi dengan menggunakan propositional connectives, yaitu: not, and, or, if-then, -if and only if-, If-then-else Aturan pembentukan sentences: 1. Proposition, (p) 2. Negation proposisi p, (not p) 3. Conjunction, (p and q) 4. Disjunction, (p or q) 5. Implication, (if p then q) 6. Equivalence, (p if and only if q) 7. Conditional, (if p then q else r) 3
Notation Notasi dari 6 connective: Englishlike Konvensional Not ~ And Or If-then If and only if If-then-else- V If-then-else- Contoh penulisan notasi konvensional: if ((p or q) and (if q then r)) then (if (p and q) then not r) adalah: ((p V q) (q r) ((p q) ~r) 4
Interpretation Pemberian truth value pada setiap simbol proposisi dari suatu kalimat logika Contoh: not p or q Maka, interpretasi untuk proposisi p dan q adalah: p True p False atau q True q False 5
Exercise Soal 1 Diberikan simbol penghubung kalimat logika berikut: Englishlike Konvensional Not ~ And Or V If then If and only if If then else If then else 6
Pernyataan: Simbol Pernyataan p Saya suka kuliah logika informatika q SBY presiden Ri ke 7 r 13 adalah bilangan prima ke 6 s Deret fibbonaci ke 4 adalah 3 t Dua garis sejajar memiliki kemiringan yang sama 7
Ubahlah kalimat berikut menjadi simbol kalimat logika (simbol englishlike): 1. Saya suka kuliah logika informatika 2. Jika Saya suka kuliah logika informatika maka SBY presiden RI ke 7 3. 13 bukan bilangan prima ke 6 jika dan hanya jika Deret fibbonaci ke 4 adalah 3 4. Tidak benar bahwa Saya tidak suka kuliah logika informatika 5. Jika 13 adalah bilangan prima ke 6 maka Deret fibbonaci ke 4 adalah 3 atau Jika SBY presiden RI ke 7 dan 13 bilangan prima ke 6 maka 13 bukan bilangan prima ke 6 8
Exercise Soal 2 Ubahlah kalimat logika berikut ke dalam simbol konvensional: 1. (if p then q) or (if q then p) 2. (not q) or not[if p then (notq) and p) 3. (if p then (not q)) if and only if not (p and q) 4. (if (p or q) then r] if and only if [(if p then r) and (if q then r)) 5. (p if and only if (q if and only if r)) if and only if ((p if and only if q) if and only if r) 6. (if p then q and r else (not q) and s] if and only if [if q then p and r else (not p) and s) 9
Materi 2 PROPOSITION LOGIC Semantic Rule Truth Table Exercise LOGIKA INFORMATIKA Heri Sismoro, M.Kom. STMIK AMIKOM Yogyakarta 2010 1
Semantic Rule Suatu aturan yang digunakan untuk menentukan arti atau nilai kebenaran dari suatu kalimat logika Aturan Semantic: 1. Aturan NOT (Negation Rule) 2. Aturan AND (Conjunction Rule) 3. Aturan OR (Disjunction Rule) 4. Aturan IF-THEN (Implication Rule) 5. Aturan IF AND ONLY IF (Equivalence Rule) 6. Aturan IF-THEN-ELSE (Conditional Rule) 2
Semantic Rule (cont) 1. Negation Rule p ~p true false False true 2. Conjunction Rule p q p q true true true true false false false true false false false false 3
Semantic Rule (cont) 3. Disjunction Rule p q p q true true true true false true false true true false false false 4. Implication Rule p q p q true true true true false false false true true false false true 4
Semantic Rule (cont) 5. Equivalence Rule p q p q true true true true false false false true false false false true 5
Semantic Rule (cont) 6. Conditional Rule p q r If p then q else r true true true true true true false true true false true false true false false false false true true true false true false false false false true true false false false false 6
Truth Table Adalah suatu cara untuk menentukan nilai kebenaran dari suatu kalimat logika Contoh 1. Diberikan kalimat logika berikut: not (p and (not p)) or q Tentukan nilai kebenarannya dengan menggunakan tabel kebenaran! Langkah: Ubahlah menjadi kalimat dengan simbol konvensional Buatlah table dengan menginterpretasi kemungkinan nilai dari setiap proposisinya 7
Truth Table (cont) Jawab: Langkah 1. Mengubah ke simbol Konvensional ~(p ~p) q Langkah 2. Membuat Truth Table p q ~p p ~p ~(p ~p) ~(p ~p) q true true false false true true true false false false true true false true true false true true false false true false true true 8
Truth Table (cont) Contoh 2. Tentukan truth value dengan menggunakan truth table dari kalimat logika berikut: (if p then q) or (r and (not p)) Jawab: 1. (p q) (r ~p) 2. p q r ~p p q r ~p (p q) (r ~p) true true true false true false true true true false false true false true true false true false false false false true false false false false false false false true true true true true true false true false true true false true false false true true true true true false false false true true false true 9
Exercise 1. Diberikan kalimat logika: If (if q then not p) then (not q and p) else not ((p or s) if and only if ( if r then q)) Maka tentukan truth value-nya, jika ; a. Interpretasi p, q, r, dan s true b. Interpretasi p, q, r, dan s false c. Interpretasi p dan q true, r dan s false d. Interpretasi p dan q false, r dan s true 10
Exercise (cont) 2. Dengan menggunakan tabel kebenaran (truth value), tentukan nilai kebenaran dari kalimat logika berikut: a. ( p and (if r then s)) if and only if (( if r then s ) and p ) b. ( if not p then not s ) or (( if q then s ) and p ) 3. Dengan mengasumsikan p dan r benar, serta q dan s salah, tentukan nilai kebenaran dari setiap kalimat logika (sentences), berikut a. ( p and ( if r then s )) if and only if ((if r then s) and p) b. ( if not p then not s ) or (( if q then s ) and p) c. (( p or q ) and not r ) if and only if (( if p then r ) and (if q then r) d. if (( if not q then p ) or not q ) then (p if and only if q) else not ( r and q ) 11
Exercise (cont) 4. Tentukan, apakah pasangan-pasangan kalimat berikut ekuivalen: a. ((not p or q) and (p or not r)) and (p or not q) dengan not (p or r) b. (r or p) and ((not r or (not r or (p and q)) and (r or q)) dengan p and q c. (p or q) and (not p and (not p and q)) dengan not p and q 12
3. Logika Kombinasional (1) Mata Kuliah: Logika Informatika Semester Pendek TA 2009/2010 D3 Teknik Informatika Dosen Pengampu: Heri Sismoro, M.Kom.
Logika Biner
Operasi Lojik Dasar
Gerbang Lojik
Aljabar Boolean
Aljabar Boolean
Identitas Dasar
Manipulasi Aljabar
Latihan
4. Logika Kombinasional (2) Mata Kuliah: Logika Informatika Semester Pendek TA 2009/2010 D3 Teknik Informatika Dosen Pengampu: Heri Sismoro, M.Kom.
Minterm dan Maxterm
Minterm dan Maxterm
Minterm dan Maxterm
SOP dan POS
K-Map
K-Map
K-Map
K-Map
Latihan
Latihan