Cari Blog Ini

Senin, 07 Mei 2012

LOGIKA INFORMATIKA- 1. LOGIKA PROPOSISIONAL (PROPOSITION LOGIC)




Proposition (Pernyataan)
§  Merupakan komponen penyusun logika dasar.
§  Dilambangkan dengan propositional symbols (huruf kecil; misal: p, q, r, …..).
§  Diwakili oleh kalimat deklaratif, yaitu kalimat yang memiliki nilai kebenaran (truth value) berupa nilai True atau False.
§  Lawan dari kalimat deklaratif adalah kalimat terbuka.
Contoh:
a.    Jakarta ibu kota negara Indonesia
b.    3 adalah bilangan prima yang pertama
c.    6 + 9 > 20

Propositional Connective (Penghubung Pernyataan)
§  Untuk mengkombinasikan dua atau lebih proposisi diperlukan propositional connective (penghubung pernyataan).
§  Propositional connective beserta Notasi yang digunakan adalah sebagai berikut:
Connective
Notasi
Englishlike
Konvensional
Negation
not
~
Conjunction
and
^
Disjunction
or
v
Implication
if – then –
è
Equivalence
– if and only if –
ó
Conditional
If – then – else –
If – then – else –

Syntactics Rule (Aturan Sintaktik)
Adalah aturan yang diperlukan untuk mengkombinasikan antara proposition(s) dan propositional connective(s) untuk menghasilkan sentence (kalimat logika).
Aturan sintaktik:
·         Proposition:        (p)
·         Negation:           (not p)
·         Conjunction:       (p and q)
·         Disjunction:        (p or q)
·         Implication:        (if p then q)
·         Equivalence:      (p if and only if q)
·         Conditional:        (if p then q else r)
Sentence (Kalimat Logika)
Merupakan kombinasi antara proposition(s) dan propositional connective(s).
Proposition(s) + Propositional Connective(s) à Sentence
Interpretation (Interpretasi)
Adalah pemberian nilai kebenaran (true atau false) pada setiap propositional symbols dari suatu kalimat logika.
Semantic Rule (Aturan Semantik)
Adalah suatu aturan yang digunakan untuk menentukan “truth value” dari suatu sentence,  yaitu :
1.  Negation Rule (Aturan NOT)
Negasi akan memiliki truth value yang berlawanan dengan proposisinya.
p
not p
true
false
false
true

2.  Conjunction Rule (Aturan AND)
Konjungsi hanya akan bernilai true jika kedua proposisinya bernilai true.
p
q
p and q
true
true
true
true
false
false
false
true
false
false
false
false

3.  Disjunction Rule (Aturan OR)
Disjungsi hanya akan bernilai false jika kedua proposisinya bernilai false.
p
q
p or q
true
true
true
true
false
true
false
true
true
false
false
false

4.  Implication Rule (Aturan IF-THEN)
Implikasi hanya akan bernilai false jika anteseden (p) = true dan konsekuen (q) = false.
p
q
if p then q
true
true
true
true
false
false
false
true
true
false
false
true

Jika (pàq) adalah implikasi, maka :
(qàp) adalah konvers
(not pànot q) adalah invers
(not qànot p) adalah kontraposisi
Jika (pàq) bernilai benar, maka:
belum tentu (q à p), (not p à not q), dan (not q à not p) bernilai benar.

5.  Equivalence Rule (Aturan IF -AND ONLY IF -)
Biimplikasi hanya akan bernilai true jika kedua penyusun proposisi bernilai sama
p
q
p if and only if q
true
true
true
true
false
false
false
true
false
false
false
true

6.  Conditional Rule (Aturan IF–THEN-ELSE)
Jika p bernilai true maka nilai q yang berlaku.
Jika p bernilai false maka nilai r yang berlaku.
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

Sifat-sifat aljabar logika untuk konjungsi dan disjungsi:
a.            Hukum Idempoten
p v p                      = p
p ^ p                      = p
b.            Hukum Komutatif
p v q                      = q v p
p ^ q                      = q ^ p
c.             Hukum Assosiatif
(p v q) v r                          =  p v (q v r)
(p ^ q) ^ r              =  p ^ (q ^ r)
d.            Hukum Distributif
p v (q ^ r)                          =  (p v q) ^ (p v r)
p ^ (q v r)              =  (p ^ q) v (p ^ r)

e.            Hukum Identitas
p v false                            =  p
p ^ true                 =  p
p v true                 =  true
p ^ false                            =  false
f.              Hukum Komplemen
p v not p                =  true
p ^ not p                =  false
not (not p)             =  p
g.            Hukum De Morgan
Negasi dari konjungsi dan disjungsi:
not (p v q)             =  not p ^ not q
not (p ^ q)             =  not p v not q

Truth Table (Tabel Kebenaran)
Adalah suatu cara untuk menentukan nilai kebenaran dari suatu kalimat logika
Contoh:
Tentukan nilai kebenaran kalimat berikut dengan menggunakan truth table!
not (p and (not p)) or q
Langkah penyelesaian:
·      Ubahlah menjadi kalimat logika dengan simbol konvensional.
~ (p ^ ~p) v q
·      Buatlah truth table dengan menginterpretasikan kemungkinan nilai dari setiap proposisinya.
p
q
~p
p ^ ~p
~ (p ^ ~p)
~ (p ^ ~p) v 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



LATIHAN
1. Diberikan simbol untuk beberapa proposisi berikut:
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
Dengan menggunakan simbol proposisi diatas, ubahlah kalimat berikut menjadi simbol kalimat logika (Gunakan Notasi englishlike dan konvensional..!):
a)        Saya suka kuliah logika informatika
b)        Jika Saya suka kuliah logika informatika maka SBY presiden RI ke‐7
c)        13 bukan bilangan prima ke‐6 jika dan hanya jika Deret fibbonaci ke‐4 adalah 3
d)        Tidak benar bahwa Saya tidak suka kuliah logika informatika
e)        Jika 13 adalah bilangan prima ke 6 maka Deret fibbonaci ke‐4 adalah 3 atau Jika SBY presiden RI ke‐7 dan Deret fibbonaci ke‐4 adalah 3 maka 13 bukan bilangan prima ke 6

2. Tentukan truth value dari sentence berikut, dengan menggunakan truth table :
a)        (f and g) if and only if (g and g)
b)        if (if p then q) then q
c)        ((p or q) and not r) if and only if (if p then r) and (if q then r)

3. Jika diberikan interpretasi true untuk p dan s; dan false untuk q  dan r, maka tentukanlah truth value untuk kalimat berikut:
a)        ((if p then q) and (if q then p)) if and only if (q or not p)
b)        (p and (if r then s)) if and only if ((if r then s) and p)

4. 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)))
Tentukan truth value-nya, jika:
a)        Interpretasi p, q, r, dan s true
b)        Interpretasi p dan q true, r dan s false
5. 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

Tidak ada komentar:

Posting Komentar