← Back to Blog

COMP-2310 Chapter 1 - Applications

Justin Bornais • • 3-minute read
Education Computer Science

Section 1.8 of chapter 1 of the COMP2310 courseware discusses a concept called Applications. This describes using what was learned about formal proofs in propositional logic to test the validity of certain real-world arguments.

In this blog, I will go over an example to see how we can use propositional logic to prove if certain arguments make sense. Each proof follows a given structure:

  1. Denote each proposition with a variable (usually upper-case but doesn’t have to be), such as AA, BB, CC, etc.
  2. Translate each statement into a wff.
  3. Prove the conclusion with the given premises.

Some general tips when solving:

  1. Try to only denote the positive expressions as variables (i.e. if the statement reads “John does not walk”, denote J as “John walks” and convert the expression to ∼J\sim J).
  2. Once the statements are properly translated into wffs, do your best to try and understand conceptually why the logic works out.

Example

There is a poker game going on. If Nick wins, then Matt will throw a party. If Spencer wins, then Tom will throw a party. It is the case that either Nick or Spencer will win. If Nick wins, then Tom will not throw a party, and if Spencer wins, then Matt will not throw a party. Therefore, Matt will throw a party if and only if Tom does not throw a party.

Solution

Let N denote “Nick wins”,
\quad S denote “Spencer wins”,
\quad M denote “Matt will throw a party”,
\quad T denote “Tom will throw a party”.

The sentence “There is a poker game going on” does not need to be translated at all, as there is nothing useful about it.
The sentence “If Nick wins, then Matt will throw a party” can be translated to N⇒MN\Rightarrow M
The sentence “If Spencer wins, then Tom will throw a party” can be translated to S⇒TS\Rightarrow T
The sentence “It is the case that either Nick or Spencer will win” can be translated to (N∨S)∧∼(N∧S)(N\lor S)\land\sim(N\land S)
The sentence “If Nick wins, then Tom will not throw a party, and if Spencer wins, then matt will not throw a party ” can be translated to (N⇒∼T)∧(S⇒∼M)(N\Rightarrow\sim T)\land (S\Rightarrow\sim M)
The conclusion “Matt will throw a party if and only if Tom does not throw a party” can be translated to M⇔∼TM\Leftrightarrow\sim T.

Note

One might translate the third sentence to (N∨S)(N\lor S). However, the purpose of the statement was to say only one of them will win. The final wff (N∨S)∧∼(N∧S)(N\lor S)\land\sim(N\land S) translates to “Nick or Spencer will win, and both of them won’t win” which has the same meaning.

The conclusion is a bidirectional because it said “if and only if”.

We thus have:
P1:N⇒M\qquad P_1:\quad N\Rightarrow M
P2:S⇒T\qquad P_2:\quad S\Rightarrow T
P3:(N∨S)∧∼(N∧S)\qquad P_3:\quad (N\lor S)\land\sim(N\land S)
P4:(N⇒∼T)∧(S⇒∼M)\qquad P_4:\quad (N\Rightarrow\sim T)\land (S\Rightarrow\sim M)
C:M⇔∼T\qquad C:\quad M\Leftrightarrow\sim T

and we are to prove that P1,P2,P3,P4⊢CP_1,P_2,P_3,P_4\vdash C.

1. N⇒MN\Rightarrow M\quad from Γ\Gamma
2. S⇒TS\Rightarrow T\quad from Γ\Gamma
3. (N∨S)∧∼(N∧S)(N\lor S)\land\sim(N\land S)\quad from Γ\Gamma
4. (N⇒∼T)∧(S⇒∼M)(N\Rightarrow\sim T)\land(S\Rightarrow\sim M)\quad from Γ\Gamma
5. (S⇒∼M)∧(N⇒∼T)(S\Rightarrow\sim M)\land(N\Rightarrow\sim T)\quad 4, E9
6. (S⇒∼M)(S\Rightarrow\sim M)\quad 5, I2
7. (∼∼M⇒∼S)(\sim\sim M\Rightarrow\sim S)\quad 6, E19
8. (M⇒∼S)(M\Rightarrow\sim S)\quad 7, E15
9. N∨SN\lor S\quad 3, I2
10. S∨NS\lor N\quad 9, E10
11. ∼∼S∨N\sim\sim S\lor N\quad 10, E15
12. ∼S⇒N\sim S\Rightarrow N\quad 11, E18
13. M⇒NM\Rightarrow N\quad 8, 12, I5
14. N⇒∼TN\Rightarrow\sim T\quad 4, I2
15. M⇒∼TM\Rightarrow\sim T\quad 13, 14, I5
16. ∼T⇒∼S\sim T\Rightarrow\sim S\quad 2, E19
17. ∼T⇒N\sim T\Rightarrow N\quad 16, 12, I5
18. ∼T⇒M\sim T\Rightarrow M\quad 17, 1, I5
19. (M⇒∼T)∧(∼T⇒M)(M\Rightarrow\sim T)\land(\sim T\Rightarrow M)\quad 15, 18, I6
20. M⇔∼TM\Leftrightarrow\sim T\quad 19, E20

Hence, P1,P2,P3,P4⊢C■P_1,P_2,P_3,P_4\vdash C\qquad\blacksquare