---
# System prepended metadata

title: 3.209 Propositional Logic Exercise - Pham Phan Nhan

---

# 3.209 Propositional Logic Exercise - Pham Phan Nhan

## Question 1 

a) 

p = {1, 3, 5, 7, 9, 11, 13, 15}
q = {2, 3, 5, 7, 11, 13}
r = {1, 2, 3, 4, 5, 6, 7}

Truth set of $p∧q$ is {2, 3, 5, 7, 11, 13}

Truth set of $p\oplus q$ is {1, 2, 9, 15}

| p | q | r | p  →   q | r  →   q |
|:-:|:-:|:-:|:--------:|:--------:|
| F | F | F |     T    |     T    |
| F | F | T |     T    |     F    |
| F | T | F |     T    |     T    |
| F | T | T |     T    |     T    |
| T | F | F |     F    |     T    |
| T | F | T |     F    |     F    |
| T | T | F |     T    |     T    |
| T | T | T |     T    |     T    |

Truth set of $p→q$ is {2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14}

Truth set of $r→q$ is {2, 3, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15}

b)
- 'n is neither  odd  nor is a prime number': ~p ∧ ~q
- 'if n is  odd  and n less than 8 then n is a prime number': (p ∧ r) → q
- 'n is a prime number only if n is odd': q → p
- 'n is a prime number if n is odd': p → q 

c) The contrapositive of q→p is ~p → ~q or **if n is not an odd number, then n is not a prime number**.

## Question 2

Prove that: $(p→q)∧p=p∧q$

Using the the truth table, $p→q = \displaystyle \neg p \lor q$

| p | q | $p \rightarrow q$ | **$\displaystyle \neg p \lor q$** |
|:-:|:-:|:--------:|:-----------------------------:|
| F | F |     T    |               T               |
| F | T |     T    |               T               |
| T | F |     F    |               F               |
| T | T |     T    |               T               |

Thus,

$$(p→q)∧p = (\displaystyle \neg p \lor q) ∧ p $$ 

$$ = (\displaystyle \neg p ∧ p) \lor (q \land p) $$

$$ = F \lor(q \land p) $$

$$ = q \land p$$

$$ = p \land q$$


