• Tidak ada hasil yang ditemukan

LOGIKA INFORMATIKA PROPOSITION LOGIC. Materi 1. Proposition Sentences Notation Interpretation Exercise

N/A
N/A
Protected

Academic year: 2021

Membagikan "LOGIKA INFORMATIKA PROPOSITION LOGIC. Materi 1. Proposition Sentences Notation Interpretation Exercise"

Copied!
42
0
0

Teks penuh

(1)

Materi

1

PROPOSITION LOGIC

Proposition

Sentences

Notation

Interpretation

Exercise

LOGIKA INFORMATIKA

Heri Sismoro, M.Kom.

STMIK AMIKOM Yogyakarta

2010

(2)

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)

(3)

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)

(4)

Notation

Notasi dari 6 connective:

Contoh penulisan notasi konvensional:

if ((p or q) and (if q then r)) then (if (p and q) then not r)

adalah:

Englishlike

Konvensional

Not

~

And

Or

V

If-then

Æ

If and only if

Ù

If-then-else-

(5)

If-then-else-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

(6)

Exercise

Soal 1

z

Diberikan simbol penghubung kalimat logika berikut:

Englishlike

Konvensional

Not

~

And

Or

V

If‐then

Æ

If and only if

Ù

If‐then‐else‐

If‐then‐else‐

(7)

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

(8)

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

(9)

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)

(10)

Materi

2

PROPOSITION LOGIC

Semantic Rule

Truth Table

Exercise

LOGIKA INFORMATIKA

Heri Sismoro, M.Kom.

STMIK AMIKOM Yogyakarta

2010

(11)

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)

(12)

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

(13)

Semantic Rule

(cont)

3.

Disjunction Rule

p

q

pÆq

true

true

true

true

false

false

false

true

true

false

false

true

4. Implication

Rule

p

q

p∨q

true

true

true

true

false

true

false

true

true

(14)

Semantic Rule

(cont)

5.

Equivalence Rule

p

q

p Ù q

true

true

true

true

false

false

false

true

false

(15)

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

(16)

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:

z

Ubahlah menjadi kalimat dengan simbol konvensional

z

Buatlah table dengan menginterpretasi kemungkinan nilai

(17)

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

(18)

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

(19)

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

(20)

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 )

(21)

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

(22)

Mata Kuliah:

Logika Informatika

Semester Pendek TA 2009/2010

D3 Teknik Informatika

Dosen Pengampu: Heri Sismoro, M.Kom.

(23)
(24)
(25)
(26)
(27)
(28)
(29)
(30)
(31)

Mata Kuliah:

Logika Informatika

Semester Pendek TA 2009/2010

D3 Teknik Informatika

Dosen Pengampu: Heri Sismoro, M.Kom.

(32)
(33)
(34)
(35)
(36)
(37)
(38)
(39)
(40)
(41)
(42)

Referensi

Dokumen terkait