Wolfram Book 之逻辑判断、逻辑运算

在学习了命题和四种命题关系及命题的真假判断后,我们可以借助 Mathematica,学习有关命题真假的判断与运算

例 1

Mathematica 截图

Mathematica 代码

【文字版】

2 < 3

2 > 3

2 > 1 && π > 3

1 > 2 || π > 3

Reduce[Exists[x, x^2 – 1 == 0]]

Reduce[ForAll[{a, b}, a > 0 && b > 0, (a + b)/2 >= Sqrt[a b]]]

Simplify[x^2 > y^2, Assumptions -> 0 < x < y]

 

用逻辑运算验证集合运算律

Mathematica 截图

Mathematica 代码

【文字版】

(A || (B || C)) == ((A || B) || C) // LogicalExpand

(A && (B && C)) == ((A && B) && C) // LogicalExpand

 

LogicalExpand[A && (B || C)] == ((A && B) || (A && C))

BooleanConvert[A || (B && C), “CNF”] == ((A || B) && (A || C))

 

(A || (A && B)) == A // FullSimplify

(A && (A || B)) == A // FullSimplify

 

发布者:Cara,转载请注明出处:http://www.makercollider.com/course/2425

发表评论

登录后才能评论
QR code