DSCI 220, 2025 W1
October 27, 2025
Suppose \(A = \{1, \{2\}\}\)
We’ll use these café sets:
\(I\) = “iced orders” ( df['is_iced'])
\(N\) = “non-dairy milk” (df['milk']=='Oat' | df['milk'] == 'Almond')
\(O\) = “oat-milk orders” (df['milk'] == 'Oat')
\(A\) = “almond-milk orders” (df['milk'] == 'Almond')
\(H\) = “high-caffeine” (df['caffeine_mg'] >= 150)
\(L\) = “low-calorie” (df['calories'] <= 150)
By observation, you discovered that \((I\cup N)^c = I^c\cap N^c\). But is this always true?
Claim: For any sets \(A\) and \(B\), \((A\cup B)^c = A^c\cap B^c\).
Observations, before we begin:
Story: Broadening a filter to “non-dairy or iced” can’t lose non-dairy orders.
Theorem: \(N \subseteq N\cup I\).
Proof:
Apply:
Story: Every oat drink is non-dairy. Then “oat or high-caffeine” is contained in “non-dairy or high-caffeine”.
Theorem: If \(O\subseteq N\), then \(O\cup H \subseteq N\cup H\).
Proof: Let \(x\in O\cup H\). Then \(x\in H\) or \(x\in O\).
Apply: Replacing a condition by a superset inside an OR cannot shrink results.
Story: Since oat \(\subseteq\) non-dairy, anyone not non-dairy is certainly not oat.
Theorem: If \(O\subseteq N\), then \(N^{c}\subseteq O^{c}\).
Proof:
Apply: Negating a broader class yields a subset in the reverse direction.
Story: Split iced orders by whether they’re non-dairy (\(N\)) or not (\(N^c\)). We should neither lose nor double-count any iced orders.
Theorem: For any sets \(I\) and \(N\), \[ (I\cap N)\ \cup\ (I\cap N^{c}) \;=\; I \quad\text{and}\quad (I\cap N)\ \cap\ (I\cap N^{c}) \;=\; \varnothing. \]
Apply:
Theorem: For any sets \(I\) and \(N\), \[ (I\cap N)\ \cup\ (I\cap N^{c}) \;=\; I \quad\text{and}\quad (I\cap N)\ \cap\ (I\cap N^{c}) \;=\; \varnothing. \]
Proof: