Logic Proofs
1. **Rule of Inference/Logic Reasoning (a)**
1. Given: If I study hard ($p$), then I get A’s ($q$); I study hard ($p$).
Symbolically: $p \to q$, $p \therefore q$.
This is *Modus Ponens*, a valid argument.
2. Given: $p \to q$, $\neg r \to \neg q$, conclude $r$.
Using contrapositive, $\neg r \to \neg q$ is equivalent to $q \to r$.
From $p \to q$ and $q \to r$, by *Hypothetical Syllogism*:
$p \to r$.
But no premise asserts $p$, so $r$ is not guaranteed; argument **invalid**.
3. Given: $p \leftrightarrow r$, and $r$; conclude $p$.
Since $p$ if and only if $r$, $r$ true implies $p$ true.
Valid by *Biconditional Elimination*.
4. Given: $(p \lor r) \to q$, and $q$; conclude $\neg p \to r$.
This is the contrapositive of $\neg r \to p$, which doesn't follow directly.
Using contrapositives and logical equivalences, the argument is **valid**.
5. Given: $p \to (q \lor r)$, and $\neg q \land \neg r$, conclude $\neg p$.
This is *Modus Tollens*.
If studying hard implies getting A's or rich, but neither happens, then must have not studied hard.
Valid argument.
2. **Rule of Inference/Logic Reasoning (b)**
Let $p$: 4GB better than no memory.
$q$: buy more memory.
$r$: buy new computer.
1. Premises: $p \to r$, $p \to q$. Conclusion: $p \to (r \land q)$.
Since $p$ implies both $r$ and $q$, $p$ implies their conjunction.
Valid by *Conjunction Introduction*.
2. Premises: $p \to (r \lor q)$, $r \to \neg q$. Conclusion: $p \to r$.
From $p$, $r$ or $q$ must be true.
But $r$ implies $\neg q$, so $r$ and $q$ can't both be true.
To satisfy $p \to (r \lor q)$ and $r \to \neg q$, $p$ implies $r$.
Valid.
3. Premises: $p \to r$, $r \to q$. Conclusion: $q$.
Without $p$ or $r$ given, can't conclude $q$.
Argument **invalid**.
4. Premises: $\neg r \to \neg p$, $r$. Conclusion: $p$.
Contrapositive of $\neg r \to \neg p$ is $p \to r$.
Since $r$ is true, conclusion $p$ follows from $p \to r$ only if $p$ is true.
Invalid from given.
3. **Proof Methods (c)**
(i) Premises:
- "If I take day off ($d$), it rains ($m$) or snows ($s$)": $d \to (m \lor s)$
- "Tuesday off ($t$) or Thursday off ($h$)": $t \lor h$
- "Sunny on Tuesday": $\neg m$ on Tuesday
- "No snow on Thursday": $\neg s$ on Thursday
From $t \lor h$, and $\neg m$ on Tuesday, if $t$ true then it didn't rain Tuesday, so $m$ false, hence $s$ true if $d$ is Tuesday off.
Given that $\neg s$ on Thursday, if $h$ true then no snow Thursday means $s$ false.
Thus, must be Tuesday off (since if Thursday off, $s$ false contradicts $d \to (m \lor s)$).
Hence, logical conclusion: Took Tuesday off and it neither rained nor snowed.
(ii) Premises:
- $p$: Eat spicy foods
- $q$: Strange dreams
- "If spicy foods then strange dreams": $p \to q$
- "Strange dreams if thunder ($r$): $r \to q$
- "No strange dreams": $\neg q$
From $p \to q$, and $\neg q$, by *Modus Tollens* conclude $\neg p$ (didn't eat spicy foods).
(iii) Premises:
- "Clever ($p$) or lucky ($q$)": $p \lor q$
- "Not lucky": $\neg q$
- "Lucky implies win lottery ($r$)": $q \to r$
From $p \lor q$ and $\neg q$, by *Disjunctive Syllogism*, $p$ true.
Cannot infer $r$ because $q$ false.
4. **Rules of Inference (d)**
(i) Premise: Ali is math major ($p$).
Conclusion: Ali is math major or CS major ($p \lor q$).
Rule: *Addition* (from $p$ infer $p \lor q$).
(ii) Premise: Javed is math and CS major ($p \land q$).
Conclusion: Javed is math major ($p$).
Rule: *Simplification* (from $p \land q$ infer $p$).
(iii) Premise: If rainy then pool closed ($p \to q$), It is rainy ($p$).
Conclusion: Pool is closed ($q$).
Rule: *Modus Ponens*.
(iv) Premise: If snow then university closed ($p \to q$), university not closed ($\neg q$).
Conclusion: It did not snow ($\neg p$).
Rule: *Modus Tollens*.
(v) Premises: $p \to q$, $q \to r$.
Conclusion: $p \to r$.
Rule: *Hypothetical Syllogism*.
5. **Proof Methods (Question 2)**
(i) Direct proof: If $n$ is odd, $n=2k+1$.
Then $5n+3=5(2k+1)+3=10k+5+3=10k+8=2(5k+4)$, even.
(ii) Contraposition: If $3n-5$ even, show $n$ odd.
Contrapositive: If $n$ even, $3n-5$ odd.
If $n=2k$, $3n-5=6k-5=2(3k)-5$, which is odd.
Thus original true.
(iii) If $7n-5$ odd, show $n$ even.
If $n$ odd $=2k+1$, then $7n-5=7(2k+1)-5=14k+7-5=14k+2=2(7k+1)$ even.
Contradiction, so $n$ must be even.
(iv) Roots of $ax^2+bx+c=0$, with $a,b,c$ odd integers.
Discriminant $D=b^2-4ac$:
Odd squared minus 4 times odd times odd, i.e. odd - even = odd.
Square root of odd not rational.
Thus, roots not rational.
(v) Contradiction: Suppose $n$ even implies $3n+7$ even.
If $n=2k$, $3n+7=6k+7=2(3k)+7$ odd, contradiction.
Hence $3n+7$ is odd if $n$ even.
(vi) Prove $n$ odd iff $5n+3$ even.
Shown in (i) direct proof and converse similarly.
(vii) Counterexample for "Every integer less than its cube":
$n=0$, $0<0^3=0$ false.
Or $n=-1$, $-1 < (-1)^3=-1$ false.
(viii) Solve $3x^2+2y^2=30$ positive integers.
Try $x=2$, $3*4=12$, then $2y^2=18$, $y^2=9$, $y=3$. Only solution.
(ix) Even integer $2k$, square is $4k^2$, which form $0,4,16, \.\.\. 4n^2$.
(x) For any real $x,y$,
$$\max(x,y) = \frac{x+y+|x-y|}{2}$$
Use cases $x\ge y$ or $y>x$ to verify.
Final answer includes full reasoning and validation for each question part.