Discrete Math for Data Science

DSCI 220, 2025 W1

September 5, 2025

Syllabus Continued

Communications

Name Time Location & Zoom
Cinda Mon 2–4pm 🏒 ICCS 233 Β· Zoom
Joe Fri 11-12a 🏒 FORW 317
Marko Tue 1:30-2:30p 🏒 TBD

Logic

Truth

Make at least 3 observations about the following table:

\(p\) \(q\) \(p \lor q\)
F F F
F T T
T F T
T T T



Summary

Key observations about the table:

\(p\) \(q\) \(p \lor q\)
F F F
F T T
T F T
T T T
  • The diagram is called a Truth Table
  • p and q are variables, each of which take on one of two Boolean values, True or False (T/F, 1/0)
  • ∨ is a binary operator that implements a function (creates output) from the 2 input variables to another Boolean value. It is characterized by its output values.
  • The operator ∨ corresponds to the English word or.
  • The expression p ∨ q is called a proposition.

Foreshadowing

\(p\) \(q\) \(p \lor q\)
F F F
F T T
T F T
T T T
  • How many rows for a proposition on 3 variables? \(k\) variables?

  • Give a good name for an operator that takes 1 variable: __________

  • Give a good name for an operator that takes 3 variables: __________

  • How many different binary operators could there be?

06:00

Truth Tables

All graded learning activities in the course will use a tool called PrairieLearn.

Navigate to today’s activity and complete question 1

https://us.prairielearn.com/pl/course_instance/186238/

10:00

Beyond Operators

Propositions can be more complex than just a single operator!

Example:

\(p\) \(q\) _____ \(\neg(p \lor q)\)
F F T
F T F
T F F
T T F

WFFs

A well-formed formula is a Boolean statement generated by the following rules:

<wff> ::= <atom>
        | ~ <wff>
        | ( <wff> ∧ <wff> )
        | ( <wff> ∨ <wff> )

<atom> ::= p | q | r | s | ...

This definition is in the form of a Grammar.

_____________: <wff> and <atom>

_____________: p, q, r, s …

It is our first self-referential or recursive definition.

WFFs

<wff> ::= <atom>
        | ~ <wff>
        | ( <wff> ∧ <wff> )
        | ( <wff> ∨ <wff> )

<atom> ::= p | q 

Example derivation:

<wff>

WFFs (Notes)

<wff> ::= <atom>
        | ~ <wff>
        | ( <wff> ∧ <wff> )
        | ( <wff> ∨ <wff> )

<atom> ::= p | q 
  • Grammars can be used to construct many different kinds of sequences.

  • We could have included additional operators \(\rightarrow\), \(\leftrightarrow\), \(\oplus\), \(\uparrow\)

  • Computational evaluation of <wff>is covered in DSCI221. For now, we trust Python and focus on logic.

  • The <wff> are propositions.

WFF Puzzle

Which of these are WFFs?

<wff> ::= <atom>
        | ~ <wff>
        | ( <wff> ∧ <wff> )
        | ( <wff> ∨ <wff> )

<atom> ::= p | q 
  1. \((\neg p ∧ (q ∨ r))\)
  2. \(((p ∧ q) ∨ (r ∧ \neg s))\)
  3. \(((\neg p) ∨ (q ∨ r))\)
  1. \((p ∨ (qr))\)
  2. \(\neg (p ∨ (q ∧ \neg r))\)
  3. \(\neg (p ∨ q))\)
03:00

WFFs

<wff> ::= <atom>
        | ~ <wff>
        | ( <wff> ∧ <wff> )
        | ( <wff> ∨ <wff> )

<atom> ::= p | q 

Theorem: \(\neg (p ∨ q))\) is not a WFF.

Proof:

Propositions

A proposition is a statement that can be either True or False.

Examples:

  • \(37 > 12\)

  • Fewer than 5 people in this room feel sleepy.

  • There are extra-terrestrial life forms.

  • This statement is False.

  • \(\underline{\hspace{10em}}\)

Translation


\(p\): ___________ ate cereal for breakfast.

\(q\): ___________ brought a backpack to class.

 

  • \((p\lor q)\)

  • \((p\wedge q)\)

  • \(\neg q\)

Predicates


\(p\): ___________ ate cereal for breakfast.


We may want to apply the statement to many students, in which case we define a Predicate.


  • \(P(x)\): \(x\) ate cereal for breakfast.

  • \(x\) can be instantiated to be a particular student, or an arbitrary student.

  • \(P(\underline{\hspace{2em}} )\) is a proposition.

Logical Equivalence


Ex: Is it true that \((p \lor q) \equiv (q\lor p)\) ?


Discussion points:

  • \(\equiv\) means logically equivalent

  • The answer had better be _________!!!

  • How can we justify our instinct?

Logical Equivalence example

Boolean Masks

Select all the cereals with at least 4 units of protein and no more than 6 units of sugars.

Words and Ideas

Truth Table

Proposition

Grammar

Predicate

Boolean Mask

Logical Equivalence