离散数学 - 例子
离散数学 - 例子
本文列举出一些离散数学相关的,篇幅较大的例子。例子会按其所属的章节组织。
例子参考来源:
《离散数学(第二版)》,屈婉玲,耿素云,张立昂,高等教育出版社。
2 命题逻辑等值演算
2.1 等值式
- 例 2.6
在某次研讨会的中间休息时间,3 名与会者根据王教授的口音对他是那个省市的人判断如下:
甲:王教授不是苏州人,是上海人;
乙:王教授不是上海人,是苏州人;
丙:王教授既不是上海人,也不是杭州人;
听完这 3 人的判断后,王教授笑着说,你们 3 人中有一人说得全对,有一人说对了一半,另一人说得全不对。试用逻辑演算分析王教授到底是哪里人。
解:
先定义三个命题:
\(p\):王教授是苏州人
\(q\):王教授是上海人
\(r\):王教授是杭州人对甲、乙、丙三人的描述进行符号化:
甲的描述:\(\lnot p\land q\)
乙的描述:\(\lnot q\land p\)
丙的描述:\(\lnot q\land \lnot r\)
判断 全对\((0)\) 一半错\((1)\) 全错\((2)\) 甲\((A)\) \(\lnot p\land q\) \((p\land q)\lor(\lnot p\land \lnot q)\) \(p\land \lnot q\) 乙\((B)\) \(\lnot q\land p\) \((q\land p)\lor (\lnot q \land \lnot p)\) \(q\land \lnot p\) 丙\((C)\) \(\lnot q\land \lnot p\) \((q\land \lnot r)\lor(\lnot q\land r)\) \(q\land r\) 将王教授的说法符号化,记为 \(E=(A_0\land B_1\land C_2)\lor (A_0\land B_2\land C_1)\lor(A_1\land B_0\land C_2)\lor (A_1\land B_2\land C_0)\lor(A_2\land B_0\land C_1)\lor(A_2\land B_1\land C_0)\) 且为真。
\((A_0\land B_1\land C_2)\) \(\Leftrightarrow\)
\((\lnot p\land q)\land ((q\land p)\lor (\lnot q \land \lnot p))\land (q\land r)\) \(\Leftrightarrow\)
\((\lnot p\land q)\land((q\land p\land q\land r)\lor (\lnot q\land \lnot p\land q\land r))\) \(\Leftrightarrow\)
\((\lnot p\land q)\land ((q\land p\land r)\lor (0))\) \(\Leftrightarrow\)
\(0\)\((A_0\land B_2\land C_1)\) \(\Leftrightarrow\)
\((\lnot p\land q)\land (q\land \lnot p) \land ((q\land \lnot r)\lor(\lnot q\land r))\) \(\Leftrightarrow\)
\((q\land \lnot p\land q\land \lnot r)\lor (q \land \lnot p\land \lnot q\land r)\) \(\Leftrightarrow\)
\(q\land \lnot p\land \lnot r\)\((A_1\land B_0\land C_2)\) \(\Leftrightarrow\)
\(((p\land q)\lor(\lnot p\land \lnot q))\land (\lnot q\land p)\land (q\land r)\) \(\Leftrightarrow\)
\(0\)\((A_1\land B_2\land C_0)\) \(\Leftrightarrow\)
\(((p\land q)\lor(\lnot p\land \lnot q))\land (q\land \lnot p) \land (\lnot q\land \lnot p)\) \(\Leftrightarrow\)
\(0\)\((A_2\land B_0\land C_1)\) \(\Leftrightarrow\)
\((p\land \lnot q)\land (\lnot q\land p)\land ((q\land \lnot r)\lor(\lnot q\land r))\) \(\Leftrightarrow\)
\(0\lor (p\land \lnot q\land r)\)
\(p\land \lnot q\land r\)\((A_2\land B_1\land C_0)\) \(\Leftrightarrow\)
\((p\land \lnot q)\land ((q\land p)\lor (\lnot q \land \lnot p)) \land (\lnot q\land \lnot p)\) \(\Leftrightarrow\)
\(0\)也即有 \(E=(q\land \lnot p\land \lnot r)\lor (p\land \lnot q\land r)\) 。
而 \(p,q,r\) 不能同时为真,也即 \(p\land r=0\) ,故 \(E=q\land \lnot p\land \lnot r\) ,故 \(q=1,p=0,r=0\) ,也即王教授为上海人,且 \(A_0,B_2,C_1\) ,即甲全对,乙全错,丙对了一半。
posted on 2021-01-19 23:48 amazzzzzing 阅读(1025) 评论(0) 收藏 举报