Discrete Math for Data Science

DSCI 220, 2025 W1

September 12, 2025

Announcements

Logical Equivalences

Vocabulary

Given \(p\rightarrow q\), we define the following 3 terms:

  • ________________ is \(\neg q\rightarrow \neg p\)

  • ________________ is \(q\rightarrow p\)

  • ________________ is \(\neg p\rightarrow \neg q\)

Describe all the logical equivalences among the 4 statements:

Converses — check what’s True

# Statement p→q p→q q→p
1 To be empty, a string must have length 0.
2 Playing in the NHL entails being a professional hockey player.
3 If an animal is a mammal, then it is a cat.
4 Riding the 99 B-Line counts as public transit.
5 If a dish is spicy, then it is Indian cuisine.
6 If it’s a kitten, then it’s a cat.
7 No song appears on the Billboard Hot 100 without reaching #1.
8 If I live in Totem Park residence, then I live in campus housing.
9 If I eat breakfast, then I ace the quiz.
10 If a movie is a superhero film, then it is an MCU movie.
11 If I’m an only child, then I have zero siblings.
12 If I’m in British Columbia, then I’m in Vancouver.

Biconditionals

We have a special operator for those implications whose converses are also True:

  \((p\rightarrow q) \wedge (q\rightarrow p)\equiv p\leftrightarrow q\)

Some phrases describing this relationship:

  • biconditional
  • if and only if (iff)
  • equivalent

Which of the expressions on the previous page are biconditionals?

Quantifiers

Quantified Predicates

Consider the predicate:

       \(H(x)\): \(x\) is a Hero

Is this a proposition? ____. We add a “quantifier”:

               \(H(x)\): \(x\) is a Hero

Now is it a proposition? ____. We scope the variable:

                       \(H(x)\): \(x\) is a Hero



Two classic quantifiers:

  \(\forall\): “For every” or “For all”
  \(\exists\): “There exists” or “There is at least one”

Quantified Predicates

In pairs, complete the worksheet!

 

What did you discover about negation?

 

Counterexample

Suppose someone says “all comedians are funny,” and you disagree, how would you refute the statement?


       \(\forall x, C(x)\rightarrow F(x)\)




Your immediate response: __________

This evidence of refutation is called a _______________.

Another way:

Applies specifically to \(\neg\forall\)

Witness

Suppose someone says “there is a funny comedian,” and you disagree, how could they justify their statement?


       \(\exists x, C(x)\wedge F(x)\)


Their immediate response: __________

This evidence of justification is called a _______________.

Applies specifically to \(\exists\)

Aside: Why not \(\exists x, C(x)\rightarrow F(x)\)?

Code Patterns

Nested Quantifiers

It will not surprise you that we can use multiple quantifiers:

 

     \(\forall x, \forall y \text{ Knows}(x,y)\)


In pairs, complete the second worksheet.

Words and Ideas

Quantifiers – “For all” and “There exists”

Counterexample and Witness

Negating quantifiers

Nested Quantifiers