# HW1
## Part 1
5.
b. No. We do not know who "she" is so we cannot determine whether the sentence is true of false.
c. Yes. It is a statement since it is a false sentence.
d. No. True or false depends on the value of $x$.
8.
c. $\sim h \land \sim w \land \sim s$
10.
e. $\sim p \lor (q \land r)$
30.
The dollar is not at all-time high or the stock market is not at a record low.
37.
$x < -7$ or $x \geq 0$
39.
$(num\_orders \geq 50 \text{ or } num\_instock \leq 300) \text{ and } ((num\_orders < 50 \text{ or } num\_orders \geq 75) \text{ or } num\_instock \leq 500)$
43.
| $p$ | $q$ | $\sim p$ | $\sim p \lor q$ | $\sim q$ | $p \land \sim q$ | $(\sim p \lor q) \lor (p \land \sim q)$ |
| --- | --- | -------- | --------------- | -------- | ---------------- | --------------------------------------- |
| T | T | F | T | F | F | T |
| T | F | F | F | T | T | T |
| F | T | T | T | F | F | T |
| F | F | T | T | T | F | T |
tautology
45.
Let
$p$ = "Bob is both a math and computer science major"
$q$ = "Ann is a math major"
$r$ = "Ann is a computer science major"
statement in (a) = $(p \land q) \land (\sim (q \land r))$
truth table:
| $p$ | $q$ | $r$ | $(p \land q)$ | $(q \land r)$ | $\sim (q \land r)$ | $(p \land q) \land (\sim (q \land r))$ |
| --- | --- | --- | ------------- | ------------- | ------------------ | -------------------------------------- |
| T | T | T | T | T | F | F |
| T | T | F | T | F | T | T |
| T | F | T | F | F | T | F |
| T | F | F | F | F | T | F |
| F | T | T | F | T | F | F |
| F | T | F | F | F | T | F |
| F | F | T | F | F | T | F |
| F | F | F | F | F | T | F |
statement in (b) = $\sim (p \land q \land r) \land (q \land p)$
truth table:
| $p$ | $q$ | $r$ | $p \land q \land r$ | $\sim (p \land q \land r)$ | $q \land p$ | $\sim (p \land q \land r) \land (q \land p)$ |
| --- | --- | --- | ------------------- | -------------------------- | ----------- | -------------------------------------------- |
| T | T | T | T | F | T | F |
| T | T | F | F | T | T | T |
| T | F | T | F | T | F | F |
| T | F | F | F | T | F | F |
| F | T | T | F | T | F | F |
| F | T | F | F | T | F | F |
| F | F | T | F | T | F | F |
| F | F | F | F | T | F | F |
Statements in (a) and (b) are logically equivalent since for every possible combination of truth values their value are the same.
49.
a. Commutative law
b. Distributive law
c. Negation law
d. Indentity law
54.

## Part 2
20.
b. Today is New Year's Eve and tomorrow is not January.
c. The decimal expansion of $r$ is terminating and $r$ is not rational.
e. $x$ is nonnegative and $x$ is not positive and not 0.
g. $n$ is divisible by 6 and $n$ is not divisible by 2 or $n$ is not divisible by 3.
27.
| $p$ | $q$ | $\sim p$ | $\sim q$ | $q \rightarrow p$ | $\sim p \rightarrow \sim q$ |
| --- | --- | -------- | -------- | ----------------- | --------------------------- |
| T | T | F | F | T | T |
| T | F | F | T | T | T |
| F | T | T | F | F | F |
| F | F | T | T | T | T |
$q \rightarrow p$ and $\sim p \rightarrow \sim q$ are logically equivalent since thay always have the same truth values.
31.
| $p$ | $q$ | $r$ | $q \rightarrow r$ | $p \rightarrow (q \rightarrow r)$ | $p \land q$ | $(p \land q) \rightarrow r$ | $(p \rightarrow (q \rightarrow r)) \leftrightarrow ((p \land q) \rightarrow r)$ |
| --- | --- | --- | ----------------- | --------------------------------- | ----------- | --------------------------- | ------------------------------------------------------------------------------- |
| T | T | T | T | T | T | T | T |
| T | T | F | F | F | T | F | T |
| T | F | T | T | T | F | T | T |
| T | F | F | T | T | F | T | T |
| F | T | T | T | T | F | T | T |
| F | T | F | F | T | F | T | T |
| F | F | T | T | T | F | T | T |
| F | F | F | T | T | F | T | T |
$(p \rightarrow (q \rightarrow r)) \leftrightarrow ((p \land q) \rightarrow r)$ is a tautology because all of its truth values are T.
39.
If a security code is not entered, this door will not open.
45.
If this computer program produces error messages during translation, then it is not correct.
46.
Let p = "compound X is boiling", q = "its temperature is at least 150$^\circ$C"
c. True. The statement can be written as $\sim q \rightarrow \sim p$, which is the contrapositive of the given statement.
d. False. The statement can be written as $\sim p \rightarrow \sim q$, which is not neccessarilly true. For example, if the actual boiling point of compound X were 200$^\circ$C, then the given statement would be true but this statement would be false.
e. True. The statement can be written as $\sim q \rightarrow \sim p$, which is the contrapositive of the given statement.
f. False. The statement can be written as $q \rightarrow p$, which is not neccessarilly true. For example, if the actual boiling point of compound X were 200$^\circ$C, then the given statement would be true but this statement would be false.
50.
