文档库

最新最全的文档下载
当前位置:文档库 > 人工智能不确定性推理部分参考答案

人工智能不确定性推理部分参考答案

不确定性推理部分参考答案

1.设有如下一组推理规则:

r1: IF E1THEN E2 (0.6)

r2: IF E2AND E3THEN E4 (0.7)

r3: IF E4THEN H (0.8)

r4: IF E5THEN H (0.9)

且已知CF(E1)=0.5, CF(E3)=0.6, CF(E5)=0.7。求CF(H)=?

解:(1) 先由r1求CF(E2)

CF(E2)=0.6 × max{0,CF(E1)}

=0.6 × max{0,0.5}=0.3

(2) 再由r2求CF(E4)

CF(E4)=0.7 × max{0, min{CF(E2 ), CF(E3 )}}

=0.7 × max{0, min{0.3, 0.6}}=0.21

(3) 再由r3求CF1(H)

CF1(H)= 0.8 × max{0,CF(E4)}

=0.8 × max{0, 0.21)}=0.168

(4) 再由r4求CF2(H)

CF2(H)= 0.9 ×max{0,CF(E5)}

=0.9 ×max{0, 0.7)}=0.63

(5) 最后对CF1(H )和CF2(H)进行合成,求出CF(H)

CF(H)= CF1(H)+CF2(H)+ CF1(H) × CF2(H)

=0.692

2 设有如下推理规则

r1: IF E1THEN (2, 0.00001) H1

r2: IF E2THEN (100, 0.0001) H1

r3: IF E3THEN (200, 0.001) H2

r4: IF H1THEN (50, 0.1) H2

且已知P(E1)= P(E2)= P(H3)=0.6, P(H1)=0.091, P(H2)=0.01, 又由用户告知:

P(E1| S1)=0.84, P(E2|S2)=0.68, P(E3|S3)=0.36

请用主观Bayes方法求P(H2|S1, S2, S3)=?

解:(1) 由r1计算O(H1| S1)

先把H1的先验概率更新为在E1下的后验概率P(H1| E1)

P(H1| E1)=(LS1× P(H1)) / ((LS1-1) × P(H1)+1)

=(2 × 0.091) / ((2 -1) × 0.091 +1)

=0.16682

由于P(E1|S1)=0.84 > P(E1),使用P(H | S)公式的后半部分,得到在当前观察S1下的后验概率P(H1| S1)和后验几率O(H1| S1)

P(H1| S1) = P(H1) + ((P(H1| E1) – P(H1)) / (1 - P(E1))) × (P(E1| S1) – P(E1))

= 0.091 + (0.16682 –0.091) / (1 – 0.6)) × (0.84 – 0.6)

=0.091 + 0.18955 × 0.24 = 0.136492

O(H1| S1) = P(H1| S1) / (1 - P(H1| S1))

= 0.15807

(2) 由r2计算O(H1| S2)

先把H1的先验概率更新为在E2下的后验概率P(H1| E2)

P(H1| E2)=(LS2×P(H1)) / ((LS2-1) × P(H1)+1)

=(100 × 0.091) / ((100 -1) × 0.091 +1)

=0.90918

由于P(E2|S2)=0.68 > P(E2),使用P(H | S)公式的后半部分,得到在当前观察S2下的后验概率P(H1| S2)和后验几率O(H1| S2)

P(H1| S2) = P(H1) + ((P(H1| E2) – P(H1)) / (1 - P(E2))) × (P(E2| S2) – P(E2))

= 0.091 + (0.90918 –0.091) / (1 – 0.6)) × (0.68 – 0.6)

=0.25464

O(H1| S2) = P(H1| S2) / (1 - P(H1| S2))

=0.34163

(3) 计算O(H1| S1,S2)和P(H1| S1,S2)

先将H1的先验概率转换为先验几率

O(H1) = P(H1) / (1 - P(H1)) = 0.091/(1-0.091)=0.10011

再根据合成公式计算H1的后验几率

O(H1| S1,S2)= (O(H1| S1) / O(H1)) × (O(H1| S2) / O(H1)) × O(H1)

= (0.15807 / 0.10011) × (0.34163) / 0.10011) × 0.10011

= 0.53942

再将该后验几率转换为后验概率

P(H1| S1,S2) = O(H1| S1,S2) / (1+ O(H1| S1,S2))

= 0.35040

(4) 由r3计算O(H2| S3)

先把H2的先验概率更新为在E3下的后验概率P(H2| E3)

P(H2| E3)=(LS3× P(H2)) / ((LS3-1) × P(H2)+1)

=(200 × 0.01) / ((200 -1) × 0.01 +1)

=0.09569

由于P(E3|S3)=0.36 < P(E3),使用P(H | S)公式的前半部分,得到在当前观察S3下的后验概率P(H2| S3)和后验几率O(H2| S3)

P(H2| S3) = P(H2 | ? E3) + (P(H2) – P(H2| ?E3)) / P(E3)) × P(E3| S3)

由当E3肯定不存在时有

P(H2 | ? E3) = LN3× P(H2) / ((LN3-1) × P(H2) +1)

= 0.001 × 0.01 / ((0.001 - 1) × 0.01 + 1)

= 0.00001

因此有

P(H2| S3) = P(H2 | ? E3) + (P(H2) – P(H2| ?E3)) / P(E3)) × P(E3| S3)

=0.00001+((0.01-0.00001) / 0.6) × 0.36

=0.00600

O(H2| S3) = P(H2| S3) / (1 - P(H2| S3))

=0.00604

(5) 由r4计算O(H2| H1)

先把H2的先验概率更新为在H1下的后验概率P(H2| H1)

P(H2| H1)=(LS4× P(H2)) / ((LS4-1) × P(H2)+1)

=(50 × 0.01) / ((50 -1) × 0.01 +1)

=0.33557

由于P(H1| S1,S2)=0.35040 > P(H1),使用P(H | S)公式的后半部分,得到在当前观察S1,S2下H2的后验概率P(H2| S1,S2)和后验几率O(H2| S1,S2)

P(H2| S1,S2) = P(H2) + ((P(H2| H1) – P(H2)) / (1 - P(H1))) × (P(H1| S1,S2) – P(H1))

= 0.01 + (0.33557 –0.01) / (1 – 0.091)) × (0.35040 – 0.091)

=0.10291

O(H2| S1,S2) = P(H2| S1, S2) / (1 - P(H2| S1, S2))

=0.10291/ (1 - 0.10291) = 0.11472

(6) 计算O(H2| S1,S2,S3)和P(H2| S1,S2,S3)

先将H2的先验概率转换为先验几率

O(H2) = P(H2) / (1 - P(H2) )= 0.01 / (1-0.01)=0.01010

再根据合成公式计算H1的后验几率

O(H2| S1,S2,S3)= (O(H2| S1,S2) / O(H2)) × (O(H2| S3) / O(H2)) ×O(H2)

= (0.11472 / 0.01010) × (0.00604) / 0.01010) × 0.01010

=0.06832

再将该后验几率转换为后验概率

P(H2| S1,S2,S3) = O(H1| S1,S2,S3) / (1+ O(H1| S1,S2,S3))

= 0.06832 / (1+ 0.06832) = 0.06395

可见,H2原来的概率是0.01,经过上述推理后得到的后验概率是0.06395,它相当于先验概率的6倍多。

3 设有如下推理规则

r1:IF E1THEN (100, 0.1) H1

r2: IF E2THEN (50, 0.5) H2

r3: IF E3THEN (5, 0.05) H3

且已知P(H1)=0.02, P(H2)=0.2, P(H3)=0.4,请计算当证据E1,E2,E3存在或不存在时P(H i | E i)或P(H i |﹁E i)的值各是多少(i=1, 2, 3)?

解:(1) 当E1、E2、E3肯定存在时,根据r1、r2、r3有

P(H1 | E1) = (LS1× P(H1)) / ((LS1-1) × P(H1)+1)

= (100 × 0.02) / ((100 -1) × 0.02 +1)

=0.671

P(H2 | E2) = (LS2× P(H2)) / ((LS2-1) × P(H2)+1)

= (50 × 0.2) / ((50 -1) × 0.2 +1)

=0.9921

P(H3 | E3) = (LS3× P(H3)) / ((LS3-1) × P(H3)+1)

= (5 × 0.4) / ((5 -1) × 0.4 +1)

=0.769

(2) 当E1、E2、E3肯定存在时,根据r1、r2、r3有

P(H1 | ?E1) = (LN1× P(H1)) / ((LN1-1) × P(H1)+1)

= (0.1 × 0.02) / ((0.1 -1) × 0.02 +1)

=0.002

P(H2 | ?E2) = (LN2× P(H2)) / ((LN2-1) × P(H2)+1)

= (0.5 × 0.2) / ((0.5 -1) × 0.2 +1)

=0.111

P(H3 | ?E3) = (LN3× P(H3)) / ((LN3-1) × P(H3)+1)

= (0.05 × 0.4) / ((0.05 -1) × 0.4 +1)

=0.032