人工智能 第6章 参考答案

更新时间:2024-01-30 14:14:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

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

6.8 设有如下一组推理规则: r1: IF E1 THEN E2 (0.6)

r2: IF E2 AND E3 THEN E4 (0.7) r3: IF E4 THEN H (0.8) r4: IF E5 THEN 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

6.10 设有如下推理规则

r1: IF E1 THEN (2, 0.00001) H1 r2: IF E2 THEN (100, 0.0001) H1 r3: IF E3 THEN (200, 0.001) H2 r4: IF H1 THEN (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)

1

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 因此有

2

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倍多。

6.11设有如下推理规则

r1: IF E1 THEN (100, 0.1) H1 r2: IF E2 THEN (50, 0.5) H2 r3: IF E3 THEN (5, 0.05) H3

且已知P(H1)=0.02, P(H2)=0.2, P(H3)=0.4,请计算当证据E1,E2,E3存在或不存在时P(Hi | Ei)或P(Hi |﹁Ei)的值各是多少(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

3

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

6.13 设有如下一组推理规则:

r1: IF E1 AND E2 THEN A={a} (CF={0.9})

r2: IF E2 AND (E3 OR E4) THEN B={b1, b2} (CF={0.8, 0.7}) r3: IF A THEN H={h1, h2, h3} (CF={0.6, 0.5, 0.4}) r4: IF B THEN H={h1, h2, h3} (CF={0.3, 0.2, 0.1}) 且已知初始证据的确定性分别为:

CER(E1)=0.6, CER(E2)=0.7, CER(E3)=0.8, CER(E4)=0.9。

假设|Ω|=10,求CER(H)。 解:其推理过程参考例6.9 具体过程略

6.15 设

U=V={1,2,3,4}

且有如下推理规则:

IF x is 少 THEN y is 多 其中,“少”与“多”分别是U与V上的模糊集,设 少=0.9/1+0.7/2+0.4/3 多=0.3/2+0.7/3+0.9/4 已知事实为

x is 较少 “较少”的模糊集为

较少=0.8/1+0.5/2+0.2/3 请用模糊关系Rm求出模糊结论。

4

解:先用模糊关系Rm求出规则

IF x is 少 THEN y is 多 所包含的模糊关系Rm

Rm (1,1)=(0.9∧0)∨(1-0.9)=0.1 Rm (1,2)=(0.9∧0.3)∨(1-0.9)=0.3 Rm (1,3)=(0.9∧0.7)∨(1-0.9)=0.7 Rm (1,4)=(0.9∧0.9)∨(1-0.9)=0.7 Rm (2,1)=(0.7∧0)∨(1-0.7)=0.3 Rm (2,2)=(0.7∧0.3)∨(1-0.7)=0.3 Rm (2,3)=(0.7∧0.7)∨(1-0.7)=0.7 Rm (2,4)=(0.7∧0.9)∨(1-0.7)=0.7 Rm (3,1)=(0.4∧0)∨(1-0.4)=0.6 Rm (3,2)=(0.4∧0.3)∨(1-0.4)=0.6 Rm (3,3)=(0.4∧0.7)∨(1-0.4)=0.6 Rm (3,4)=(0.4∧0.9)∨(1-0.4)=0.6 Rm (4,1)=(0∧0)∨(1-0)=1 Rm (4,2)=(0∧0.3)∨(1-0)=1 Rm (4,3)=(0∧0.7)∨(1-0)=1 Rm (3,4)=(0∧0.9)∨(1-0)=1 即:

?0.10.30.70.9??0.30.30.70.7?? Rm???0.60.60.60.6???1111??因此有

?0.10.30.70.9??0.30.30.70.7?'?Y??0.8,0.5,0.2,0????0.60.60.60.6? ??1111????0.3,0.3.0.7,0.8?即,模糊结论为

Y’={0.3, 0.3, 0.7, 0.8}

6.16 设

U=V=W={1,2,3,4} 且设有如下规则:

r1:IF x is F THEN y is G

5

r2:IF y is G THEN z is H r3:IF x is F THEN z is H 其中,F、G、H的模糊集分别为: F=1/1+0.8/2+0.5/3+0.4/4 G=0.1/2+0.2/3+0.4/4 H=0.2/2+0.5/3+0.8/4

请分别对各种模糊关系验证满足模糊三段论的情况。

解:本题的解题思路是:

由模糊集F和G求出r1所表示的模糊关系R1m, R1c, R1g 再由模糊集G和H求出r2所表示的模糊关系R2m, R2c, R2g 再由模糊集F和H求出r3所表示的模糊关系R3m, R3c, R3g

然后再将R1m, R1c, R1g分别与R2m, R2c, R2g合成得R12 m, R12c, R12g 最后将R12 m, R12c, R12g分别与R3m, R3c, R3g比较

6

r2:IF y is G THEN z is H r3:IF x is F THEN z is H 其中,F、G、H的模糊集分别为: F=1/1+0.8/2+0.5/3+0.4/4 G=0.1/2+0.2/3+0.4/4 H=0.2/2+0.5/3+0.8/4

请分别对各种模糊关系验证满足模糊三段论的情况。

解:本题的解题思路是:

由模糊集F和G求出r1所表示的模糊关系R1m, R1c, R1g 再由模糊集G和H求出r2所表示的模糊关系R2m, R2c, R2g 再由模糊集F和H求出r3所表示的模糊关系R3m, R3c, R3g

然后再将R1m, R1c, R1g分别与R2m, R2c, R2g合成得R12 m, R12c, R12g 最后将R12 m, R12c, R12g分别与R3m, R3c, R3g比较

6

本文来源:https://www.bwwdw.com/article/4lmw.html

Top