---
# System prepended metadata

title: Week 1&2

---

# Week 1&2

## Problem 3

(a)

| $p$ | $q$ | $p \rightarrow q$ | $p \land (p \rightarrow q)$ | $(p \land (p \rightarrow q)) \rightarrow q$ |
| --- | --- | ----------------- | --------------------------- | ------------------------------------------- |
| T   | T   | T                 | T                           | T                                           |
| T   | F   | F                 | F                           | T                                           |
| F   | T   | T                 | F                           | T                                           |
| F   | F   | T                 | F                           | T                                           |

$(p \land (p \rightarrow q)) \rightarrow q$ is True no matter what value $p$ and $q$ is, so it is a tautology.

\(c\)

| $p$ | $q$ | $\sim p$ | $\sim q$ | $p \leftrightarrow q$ | $\sim p \leftrightarrow \sim q$ |
| --- | --- | -------- | -------- | --------------------- | ------------------------------- |
| T   | T   | F        | F        | T                     | T                               |
| T   | F   | F        | T        | F                     | F                               |
| F   | T   | T        | F        | F                     | F                               |
| F   | F   | T        | T        | T                     | T                               |


$p \leftrightarrow q$ and $\sim p \leftrightarrow \sim q$ are logically equivalent since their truth values are the same for any logical value combinations between $p$ and $q$.

## Problem 16

(a)

sum 23 ~ 899 (4 *i^2 + 6i + 3)
= sum 1 ~ 899 (4 *i^2 + 6i + 3) - sum 1 ~ 22 (4 *i^2 + 6i + 3)
= 4 * 899 * 900 * (899 * 2 + 1) / 6 + 6 * 899 * (899 + 1) / 2


sum 1 ~ n (i) = n * (n + 1) / 2
sum 1 ~ n (i^2) = n * (n + 1) * (2n + 1) / 6

1^2 +2^2 + 3 ^ 2 = 14 = 3 * 4 * 7 / 6

$
\begin{align*}
&(\lnot q \land (p \rightarrow q)) \rightarrow \lnot p\\
&\equiv (\lnot q \land (\lnot p \lor q)) \rightarrow \lnot p\\
&\equiv \lnot(\lnot q \land (\lnot p \lor q)) \lor \lnot p\\
&\equiv (q \lor \lnot (\lnot p \lor q)) \lor \lnot p\\
&\equiv (q \lor (p \land \lnot q)) \lor \lnot p\\
&\equiv ((q \lor p) \land (q \lor \lnot q)) \lor \lnot p\\
&\equiv ((q \lor p) \land t) \lor \lnot p\\
&\equiv (q \lor p) \lor \lnot p\\
&\equiv \lnot p \lor (q \lor p)\\
&\equiv \lnot p \lor (p \lor q)\\
&\equiv (\lnot p \lor p) \lor q\\
&\equiv (p \lor \lnot p) \lor q\\
&\equiv t \lor q\\
&\equiv q \lor t\\
&\equiv t
\end{align*}
$
