Truth and Propositions

Lecture 2, DSCI 220, 2026W1

Logic

Recall…

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?

Truth Tables

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

Open Activity 1: Propositional Logic and work through it.

us.prairielearn.com/pl/course_instance/209866

Swimming

 

I swim Tuesday and Thursday and Saturday or Sunday.


How many times did I swim? (circle all possible values)

\[0 \qquad 1 \qquad 2 \qquad 3 \qquad 4 \qquad 5\]

Swimming Continued

Add parentheses so that I swam exactly this many times:

5:   \(\text{Tue} \wedge \text{Thu} \wedge \text{Sat} \vee \text{Sun}\)

4:   \(\text{Tue} \wedge \text{Thu} \wedge \text{Sat} \vee \text{Sun}\)

3:   \(\text{Tue} \wedge \text{Thu} \wedge \text{Sat} \vee \text{Sun}\)

2:   \(\text{Tue} \wedge \text{Thu} \wedge \text{Sat} \vee \text{Sun}\)

1:   \(\text{Tue} \wedge \text{Thu} \wedge \text{Sat} \vee \text{Sun}\)

0:   \(\text{Tue} \wedge \text{Thu} \wedge \text{Sat} \vee \text{Sun}\)

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

Rand rule   apply rule on line —

Rand atom   atom becomes —

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

<atom> ::= p | q 

Generate a WFF:

<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))\)

Parse Trees

Apply the outermost relevant rule…

\(((\text{Tu} \wedge \text{Th}) \wedge (\text{Sa} \vee \text{Su}))\)       \((\text{Tu} \wedge (\text{Th} \wedge (\text{Sa} \vee \text{Su})))\)


WFFs

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

<atom> ::= p | q 

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

Proof:

Words and Ideas

Truth Table

Proposition

Grammar

Well-formed formula

Recursive definition