CS 381 Test I



March 6, 2002



1. Fill in the blanks with the SHORTEST string of characters so that the resultant proposition is valid. [20]



(a) $\neg (\neg P \vee Q) \Leftrightarrow$ ( $\framebox [1.0in]{P}$ $ \wedge \neg Q )$
(b) $( P \rightarrow \neg ( P \rightarrow Q ) ) $ $\Leftrightarrow$ $( P \rightarrow ( \framebox [1.0in]{P}\wedge \neg Q ) )$
$\Leftrightarrow$ ( $\framebox [1.0in]{$\neg P$}\vee ( P \wedge \neg Q ) )$
$\Leftrightarrow$ (( $\framebox [1.0in]{$\neg P$}\vee P) \wedge ( \framebox [1.0in]{$\neg P$}\vee \neg Q )$)
$\Leftrightarrow$ ( $\framebox [1.0in]{T}\wedge ( \neg P \vee \neg Q ) ) \Leftrightarrow$ ( $\framebox [1.0in]{$\neg P$}\vee \neg Q ) $
$\Leftrightarrow$ ( $\framebox [1.0in]{P}\rightarrow \neg Q )$
(c) ( ( $ P \framebox [1.0in]{$\rightarrow$}Q ) \wedge ( Q \rightarrow \framebox [1.0in]{P}) ) \Leftrightarrow
( P \leftrightarrow Q ) $



2. State the following formula in English, where $P(x,y)$ means $ \mid x \mid \leq \mid y \mid $ , $Q(x,y)$ means $x \geq y$ and the universe is the set of integers: [12]



(a) $\exists x \forall y P(x,y)$



There is an integer whose absooute vbalue is less than or equal to the absolute value of every integer.
OR
There is an integer x such that for every integer y, $ \mid x \mid \leq \mid y \mid $ holds.



(b) $\forall x \exists y [P(x,y) \rightarrow Q(x,y)]$



For every integer x there is an integer y such that if $ \mid x \mid \leq \mid y \mid $ then $x \geq y$.



(c) $\exists x \forall y Q(x,y) \vee \exists x \exists y Q(x,y)$



Either there is an integer which is not less than any integer or there is an integer which is not less than some integer.



(d) $\forall x \neg Q(0,x) \rightarrow \forall x Q(x,1)$



If every integer is positive then every integer is not less than 1.




3. Express the assertions given below as propositions of predicate logic using the following predicates. The universe is the set of objects. [20]



$B(x)$: $x$ is a bug.
$C(x, y)$: $x$ contains (has) $y$.
$E(x)$: $x$ is expensive.
$S(x)$: $x$ is a software.
$U(x)$: $x$ is easy to use.

a) No software is easy to use.



$\forall x [S(x) \rightarrow \neg U(x)]$



b) Every software is expensive if it is easy to use.



$\forall x [[S(x) \wedge U(x)] \rightarrow E(x)]$



c) Some software is easy to use only if it is expensive.



$\exists x [S(x) \wedge [U(x) \rightarrow E(x)]]$



d) Not every software is bug free and easy to use.



$\neg \forall x [[S(x) \rightarrow [\forall y [ B(y) \rightarrow \neg C(x,y) ] \wedge U(x)] ]$



e) Only expensive software is bug free.



$\forall x [[S(x) \wedge [\forall y [ B(y) \rightarrow \neg C(x,y) ]] \rightarrow E(x) ]$




4. Negate the following sentences. DO NOT simply say "It is not the case that ..." or something similarly trivial. [6]



(a) Someone is missing.



No one is missing.



(b) Everyone passed every courses.



Someone did not pass some course.



(c) There are people who are happy only if they are rich.



Everyone is happy but not rich.



5. State the following sentences as "If ... then ..." statement: [6]



(a) Some people like mathematics only if it is a fun.



If some people like mathematics then it is fun.



(b) Some people like only mathematics.



If it is not mathematics then no people like it.



(c) That Mary loves Sam is necessary for Sam to love Mary.



If Sam loves Mary then Mary loves Sam.

6. Give the contrapositive of the sentences of Question 5 above. [6]



(a) If it is not fun then no people like mathematics.



(b) If some people like it then it is mathematics.



(c) If Mary does not love Sam then Sam does not love Mary.



7 (a) Express the argument given below as propositions of propositional logic using the symbol suggested for each proposition. [6]
(b) Check whether or not the reasoning is correct. Give your reasons. [9]



If the food is allowed by my doctor (AL), then it is not very rich ($\neg$ VR).
Neither the food agrees with me (AG) and not suitable for supper ($\neg$ SS), nor the food is suitable for supper but not allowed. If the food is a wedding cake (WC), then it is very rich. Therefore a wedding cake does not agree with me.



(a)
$ AL \rightarrow \neg VR$
$\neg (AG \wedge \neg SS)$
$\neg (SS \wedge \neg AL)$
$ WC \rightarrow VR$
--------------
$ WC \rightarrow \neg AG$



(b) First note the following two by De Morgan:
$\neg (AG \wedge \neg SS)$
--------------
$ \neg AG \vee SS$



$\neg (SS \wedge \neg AL)$
--------------
$\neg SS \vee AL$



Then
$WC$
$ WC \rightarrow VR$
--------------
$VR$ by modus ponens
$ AL \rightarrow \neg VR$
--------------
$\neg AL$ by modus tollens
$\neg SS \vee AL$
--------------
$\neg SS$ by disjunctive syllogism
$ \neg AG \vee SS$
--------------
$\neg AG$ by disjunctive syllogism
Hence $ WC \rightarrow \neg AG$ and the reasoning is correct.



8 (a) Express the argument given below as propositions of predicate logic using the symbol suggested for each proposition. The universe is the set of people. [6]
(b) Explain what inference rules are used to draw the conclusion. [9]



Everyone is either happy or depressed. If one is depressed then one loses interest in everything. George is very much interested in basketball (i.e. George is interested in something). Therefore there is someone who is happy.



$D(x)$ : $x$ is depressed.
$H(x)$ : $x$ is happy.
$L(x)$ : $x$ loses interest in everything.



(a)
$\forall x [H(x) \vee D(x) ]$
$\forall x [D(x) \rightarrow L(x) ]$
$\neg L(George)$
-------------
$\exists x H(x)$



(b)
$\forall x [D(x) \rightarrow L(x) ]$
-------------
$D(George) \rightarrow L(George)$ by universal instantiation
$\neg L(George)$
-------------
$\neg D(George)$ by modus tollens



$\forall x [H(x) \vee D(x) ]$
-------------
$H(George) \vee D(George)$ by universal instantiation
$\neg D(George)$
-------------
$H(George)$ by disjunctive syllogism
-------------
$\exists x H(x)$ by existential generalization.