DSCI 220, 2025 W1
September 5, 2025
π§ Email cheeren@cs.ubc.ca
Checked daily. Please place βDSCI220β in subject!
Piazza piazza.com/ubc.ca/winterterm12025/dsci220
Post questions for quick response.
π« Office Hours
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 |
Key observations about the table:
\(p\) | \(q\) | \(p \lor q\) |
---|---|---|
F | F | F |
F | T | T |
T | F | T |
T | T | T |
\(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
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
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 |
A well-formed formula is a Boolean statement generated by the following rules:
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.
Example derivation:
<wff>
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.
Which of these are WFFs?
03:00
Theorem: \(\neg (p β¨ q))\) is not a WFF.
Proof:
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}}\)
\(p\): ___________ ate cereal for breakfast.
\(q\): ___________ brought a backpack to class.
\((p\lor q)\)
\((p\wedge q)\)
\(\neg q\)
\(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.
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?
Select all the cereals with at least 4 units of protein and no more than 6 units of sugars.
Truth Table
Proposition
Grammar
Predicate
Boolean Mask
Logical Equivalence