题目:
大致结果手绘图:
详细计算过程:
一级筛选:
一级筛选 1.天气 from math import* sum = -(9/14) * log(9/14,2) - (5/14) * log(5/14,2) a = 5/14*(-(2/5) * log(2/5,2) - (3/5) * log(3/5,2))#晴 b = 4/14*(-1 * log(1,2))#阴 c = 5/14*(-(3/5) * log(3/5,2) - (2/5) * log(2/5,2))#雨 sum1 = a + b + c print(sum - sum1) 结果 #0.2467498197744391 2.温度 from math import* sum = -(9/14) * log(9/14,2) - (5/14) * log(5/14,2) a = 4/14*(