206 lines
8.1 KiB
TeX
206 lines
8.1 KiB
TeX
|
\documentclass[全部作业]{subfiles}
|
|||
|
\usepackage{titlesec}
|
|||
|
\pagestyle{fancyplain}
|
|||
|
\fancyhead{}
|
|||
|
\fancyhead[C]{\mysignature}
|
|||
|
\setcounter{chapter}{2}
|
|||
|
|
|||
|
\begin{document}
|
|||
|
% \titleformat{\chapter}{}
|
|||
|
\chapter{命题逻辑}
|
|||
|
\section{命题}
|
|||
|
\begin{enumerate}
|
|||
|
\myitem{下列语句哪些是命题?}{
|
|||
|
\item 2是正数吗?
|
|||
|
\begin{zhongwen}
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
不是。
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
\end{zhongwen}
|
|||
|
\item $x^{2}+x+1=0$
|
|||
|
\begin{zhongwen}
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
是。
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
\end{zhongwen}
|
|||
|
\item 我要上学。
|
|||
|
\begin{zhongwen}
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
是。
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
\end{zhongwen}
|
|||
|
\item 明年2月1日下雨。
|
|||
|
\begin{zhongwen}
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
是。
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
\end{zhongwen}
|
|||
|
\item 如果股票涨了,那么我就赚钱。
|
|||
|
\begin{zhongwen}
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
是。
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
\end{zhongwen}
|
|||
|
}
|
|||
|
\item 将当当网的图书高级搜索符号化:http://search.dangdang.com/AdvanceSearch/AdvanceSearch.aspx?c=0
|
|||
|
\begin{zhongwen}
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
&介质=\{\}\land 书名=\{\}\land 作者译者=\{\}\land 关键词=\{\}\land 出版社=\{\}\land ISBN=\{\}\land 包装=\{\} \\
|
|||
|
&\land 分类=\{\}\land \{最低价格\} \le 价格 \le \{最高价格\}\land \{最低折扣\}\le 折扣\le \{最高折扣\} \\
|
|||
|
&\land \{最早出版时间\}\le 出版时间\le \{最晚出版时间\}\land 库存状态=\{\} \\
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
\end{zhongwen}
|
|||
|
\item 请将语句“除非你已满16周岁,否则只要你身高不足1.2米就不能乘公园的滑行铁道”符号化。
|
|||
|
\begin{zhongwen}
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
&令p:你已满16周岁,q:你身高足1.2米,r:你能乘公园的滑行铁道。 \\
|
|||
|
&命题符号化为:\lnot p \to (\lnot q \to \lnot r) \\
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
\end{zhongwen}
|
|||
|
\item p、q、r为如下命题: \par
|
|||
|
\qquad p:你得流感了 \par
|
|||
|
\qquad q:你错过了最后的考试 \par
|
|||
|
\qquad r:这门课你通过了 \\
|
|||
|
请用自然语言表达命题$(p \to \lnot r)\lor (q \to \lnot r)$。
|
|||
|
\begin{zhongwen}
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
如果你得流感了,那么这门课你没通过,或者如果你错过了最后的考试,那么这门课你没通过。
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
\end{zhongwen}
|
|||
|
\myitem{判断下列命题的真值:}{
|
|||
|
\item \begin{zhongwen}
|
|||
|
$若1+1=3,则2+2=4$
|
|||
|
\end{zhongwen}
|
|||
|
\begin{zhongwen}
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
最外层的蕴含式的前件为假,所以此命题的真值为1。
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
\end{zhongwen}
|
|||
|
\item \begin{zhongwen}
|
|||
|
$若鸟会飞,则1+1=3$
|
|||
|
\end{zhongwen}
|
|||
|
\begin{zhongwen}
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
&在考虑例外的情况下(\exists 不会飞的鸟类): \\
|
|||
|
&\qquad 最外层的蕴含式的前件为假,所以此命题的真值为1。 \\
|
|||
|
&在不考虑例外的情况下: \\
|
|||
|
&\qquad 最外层的蕴含式的前件为真,但后件为假,所以此命题的真值为0。 \\
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
\end{zhongwen}
|
|||
|
}
|
|||
|
\item 构造一个只含命题变量p、q和r的命题公式A,满足:p、q和r的任意一个赋值是A的成真赋值当且仅当p、q和r中恰有两个为真
|
|||
|
\begin{zhongwen}
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
A=(p\land q\land \lnot r)\lor (p\land \lnot q\land r)\lor (\lnot p\land q\land r)
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
\end{zhongwen}
|
|||
|
\end{enumerate}
|
|||
|
\section{等值演算}
|
|||
|
\begin{enumerate}
|
|||
|
\myitem{将下列两个命题符号化,并分别用真值表和等值演算的方法证明所得到的那两个命题公式是等值的。}{
|
|||
|
\item 你不会休息所以就不会工作,你没有丰富的知识所以你就不会工作。
|
|||
|
\item 你会工作所以一定会休息并具有丰富的知识。
|
|||
|
}
|
|||
|
\begin{zhongwen}
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
令&p:你会休息,q:你会工作,r:你有丰富的知识 \\
|
|||
|
则&(1)符号化为(\lnot p \to \lnot q)\land (\lnot r \to \lnot q) \\
|
|||
|
&(2)符号化为q \to p \land r \\
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
\end{zhongwen}
|
|||
|
\begin{proof}
|
|||
|
\begin{zhongwen}
|
|||
|
$$
|
|||
|
以下是真值表:
|
|||
|
$$
|
|||
|
\begin{longtable}{ccccc}
|
|||
|
\hline
|
|||
|
$p$ & $q$ & $r$ & $(\lnot p \to \lnot q)\land (\lnot r \to \lnot q)$ & $q \to p \land r$ \\
|
|||
|
\hline
|
|||
|
0 & 0 & 0 & 1 & 1 \\
|
|||
|
0 & 0 & 1 & 1 & 1 \\
|
|||
|
0 & 1 & 0 & 0 & 0 \\
|
|||
|
0 & 1 & 1 & 0 & 0 \\
|
|||
|
1 & 0 & 0 & 1 & 1 \\
|
|||
|
1 & 0 & 1 & 1 & 1 \\
|
|||
|
1 & 1 & 0 & 0 & 0 \\
|
|||
|
1 & 1 & 1 & 1 & 1 \\
|
|||
|
\hline
|
|||
|
\end{longtable}
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
以下是等值演算: \\
|
|||
|
(\lnot p \to \lnot q)\land (\lnot r \to \lnot q) & = (p\lor \lnot q)\land (r\lor \lnot q) \\
|
|||
|
& = (p\land r)\lor \lnot q \\
|
|||
|
& = \lnot q\lor (p\land r) \\
|
|||
|
& = q \to p\land r \\
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
$$
|
|||
|
所以(\lnot p \to \lnot q)\land (\lnot r \to \lnot q)与q \to p \land r等值。
|
|||
|
$$
|
|||
|
\end{zhongwen}
|
|||
|
\end{proof}
|
|||
|
\item 用等值演算的方法证明命题恒等式$p \to (q \to p)=\lnot p \to (p \to \lnot q)$
|
|||
|
\begin{proof}
|
|||
|
\begin{zhongwen}
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
\lnot p \to (p \to \lnot q) & = p \lor (p \to \lnot q) \\
|
|||
|
& = p \lor (\lnot p \lor \lnot q) \\
|
|||
|
& = \lnot p \lor \lnot q \lor p \\
|
|||
|
& = p \to (\lnot q \lor p) \\
|
|||
|
& = p \to (q \to p) \\
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
\end{zhongwen}
|
|||
|
\end{proof}
|
|||
|
\myitem{一教师要从3名学生A、B和C中选派1$\sim $2人参加市级科技竞赛,需满足以下条件:}{
|
|||
|
\item 若A去,则C同去;
|
|||
|
\item 若B去,则C不能去;
|
|||
|
\item 若C不去,则A或B可以去。
|
|||
|
}
|
|||
|
问该如何选派?\\
|
|||
|
\begin{zhongwen}
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
&令a:A去,b:B去,c:C去 \\
|
|||
|
则需满足:& \quad (a \to c)\land (b \to \lnot c) \land (\lnot c \to a \lor b)\land \lnot (a\land b\land c) \\
|
|||
|
&=(\lnot a \lor c)\land (\lnot b \lor \lnot c)\land (c \lor (a \lor b))\land (\lnot a\lor \lnot b\lor \lnot c) \\
|
|||
|
&=(\lnot a \lor c)\land (\lnot b \lor \lnot c)\land (a \lor b\lor c)\land (\lnot a\lor \lnot b\lor \lnot c) \\
|
|||
|
&=(\lnot a\lor \lnot b\lor c)\land (\lnot a\lor b\lor c)\land (\lnot a\lor \lnot b\lor \lnot c)\land (a\lor \lnot b\lor \lnot c)\land (a\lor b\lor c) \\
|
|||
|
&=\bigwedge M(0,3,4,6,7) \\
|
|||
|
&=\bigvee m(1,2,5) \\
|
|||
|
&=(\lnot a\land \lnot b\land c)\lor (\lnot a\land b\land \lnot c)\lor (a\land \lnot b\land c) \\
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
\begin{flalign*}
|
|||
|
即选派C或选派B或选派AC。&&\\
|
|||
|
\end{flalign*}
|
|||
|
\end{zhongwen}
|
|||
|
\end{enumerate}
|
|||
|
\end{document}
|