Discrete Math for Data Science

DSCI 220, 2025 W1

September 16, 2025

Announcements

Inference

🎉 Spot the Rule, Dodge the Trap

Goal for today: treat valid logical arguments like legal moves in a game.

You’ll identify moves, build quick proofs, and design traps.

Warm Up (5 min)

A valid argument is a legal inference. Content can change; form is what makes it valid.

  • If the lab is open, I’ll go. The lab is open. So I’ll go.

  • If the exam is today, the forum is quiet. The forum isn’t quiet. So the exam isn’t today.

Micro Rule Cards

Use these all class as a reference.

  • MP: from p→q, p infer q
  • MT: from p→q, ¬q infer ¬p
  • HS: from p→q, q→r infer p→r
  • DS: from p∨q, ¬p infer q
  • ∧-Intro: from p, q infer p∧q
  • ∧-Elim: from p∧q infer p (or q)
  • ∨-Intro: from p infer p∨q (any q)
  • RES: from p∨q, ¬p∨r infer q∨r
  • CD: from (p→r), (q→s), (p∨q) infer r∨s

Common traps:

  • Affirming consequent: p→q, q ∴ p

  • Denying antecedent: p→q, ¬p ∴ ¬q

Rule Card: Modus Ponens (MP)

From p→q and p, infer q.

Ex:
If the bus is full, I’ll walk. The bus is full. So I’ll walk.

Rule Card: Modus Tollens (MT)

From p→q and ¬q, infer ¬p.

Ex:
If office hours moved, Slack has an announcement. No announcement. So they didn’t move.

Rule Card: Hypothetical Syllogism (HS)

From p→q and q→r, infer p→r.

Ex:
If tidy then joins are simpler; if simpler joins then faster viz; so tidy ⇒ faster viz.

Rule Card: Disjunctive Syllogism (DS)

From p∨q and ¬p, infer q.

Ex:
Dinner is sushi or tacos. Not sushi. So tacos.

Rule Card: Conjunction / Simplification

∧-Intro: from p, q infer p∧q

∧-Elim: from p∧q infer p (or q)

Rule Card: ∨-Intro

From p infer p∨q.

Ex: I rode my scooter today, so I either rode my scooter or I’m a unicorn.

Note validity cares about form, not plausibility of the added disjunct.

Rule Card: Resolution (RES)

From p∨q and ¬p∨r infer q∨r.

Ex:
Either study or soccer; if study then library. So soccer or library.

Rule Card: Constructive Dilemma (CD)

From (p→r), (q→s), (p∨q) infer r∨s.

Ex:
If sunny then picnic; if rainy then museum; sunny or rainy; so picnic or museum.

Fallacy Cards (flash)

Affirming the consequent
from p→q, q infer p

Denying the antecedent
from p→q, ¬p infer ¬q

Validity

∧-Elim: \((p\wedge q)\rightarrow p\) is this always true?

INValidity

Affirming Consequent: \(((p\rightarrow q)\wedge q)\rightarrow p\) is this always true?

\(p\) \(q\) \(p\rightarrow q\) \((p\rightarrow q)\wedge q\) \(((p\rightarrow q)\wedge q)\rightarrow p\)
F F
F T
T F
T T

Spot the Rule or the Trap

How to play: post in chat…

(a) valid or not, (b) if valid, name the rule, (c) formal pattern.

Campus

If the lecture live-streams, the chat is busy. The chat is busy. So it live-streams.

❌ Fallacy: Affirming the consequent (p→q, q ∴ p)

Sports

If the Canucks win, downtown is loud. Downtown isn’t loud. So the Canucks didn’t win.

✅ MT (p→q, ¬q ∴ ¬p)

Food

Dinner is sushi or tacos. Not sushi. So tacos.

✅ DS (p∨q, ¬p ∴ q)

Travel

If it rains, I’ll bus. If I’m late, I’ll bus. It’s raining or I’m late. So I’ll bus.

✅ CD with r=s=bus

Movies

If a film is MCU, it has a post-credits scene. This is MCU. So post-credits.

✅ MP (p→q, p ∴ q)

Music

Either I practice guitar or code. If coding, then coffee. So either practice or coffee.

✅ RES: (g ∨ c) and (f v ¬c)

Wellness

I stretched and hydrated. So I stretched.

✅ ∧-Elim

Data

If a dataset is tidy then joins are simpler. If joins are simpler then viz faster. So if tidy then viz faster.

✅ HS

Build a proof

In the chat, each person adds exactly one line using a Rule Card.

Relay A

Premises
1. D→R (deadline ⇒ review session)
2. R→C (review ⇒ crowded café)
3. D

Goal: C

Relay B

Premises
1. P∨Q (pizza or quinoa)
2. ¬P∨R (if pizza then ramen)
3. ¬Q (no quinoa)

Goal: R

Design a Trap

Your mission:
- Write one valid two-premise argument (any rule).
- Write a look-alike fallacy with the same topic words.
- Bring to class on Wednesday morning!

Quantifier Teaser

  • UI: ∀x S(x) ⇒ S(Alex) (Universal instantiation)
  • EG: S(Alex) ⇒ ∃x S(x) (Existential generalization) Analogy: mixing ∀/∃ incorrectly creates traps like affirming the consequent/denying the antecedent.

Exit Ticket (2 min)

In chat (or poll), complete both:

  • One valid rule I can spot in the wild is ________.
  • One trap I’ll watch for is ________.