3 - Logic
Statements
A statement is a declarative sentence that has a truth value (or claim)
Assign letters to a symbols using a : not a =
For example:
P: 2 is an even number
Sentences involving unknown variables, such as
Complex Statements
P ∧ Q is like P and Q in Python or P && Q in Javascript.

P V Q is like P || Q in Javascript or P or Q in Python. It is read P and Q.

You can say "not P". Similar to ! in JS or not in Python. Used with a whole statement you can say "it is not the case that" +

Implications & Conditional Statements

If P is false (and Q is false or true), then the statement is true.
If P is true AND Q is true, the statement is true.
If P is true AND Q is false, the statement is false.
Biconditional Statements

If P And Q are both true or are both false, the statement is true. Otherwise, it is false.
P ⇔Q is the same as saying that P ⇒Q and Q ⇒ P.
A logical connective is an operation that modifies or combines statements into more complex statements. Examples of logical connectives are ∧, ∨, ¬, ⇒, and ⇔.

A compound statement is a statement that has been built by applying at least one logical connective to one or more statements. For example, ((P ∨Q)∧(R∨¬(S)))⇒(P ∧R).
Logical Equivalence
Two compound statements are logically equivalent if they have the same truth value. If R and S are compound statements that are logically equivalent, we write R ≡ S.

Each of the logical equivalences in Theorem 3.26 can be proved by constructing a truth table.
In other words, if two columns have different values, they are NOT logically equivalent.
Tautologies and Contradictions
Contradiction
A compound statement that is false for every possible combination of truth values of its components is called a contradiction.
For example
| P | ¬P | P ∧ (¬P ) |
|---|---|---|
| F | T | F |
| T | F | F |
Tautology
A compound statement that is true for every possible combination of truth values of its components is called a tautology.
For example
Example of a compound statement that is a tautology:

All contradictions are logically equivalent to each other. Similarly, all tautologies are logically equivalent to each other.
Exercises - HW3
E 3.1
a) It is a statement. It's true.
b) It is not a statement.
c) It is not a statement.
d) It is a statement. It's false.
e) It is a statement. It's false.
f) It is a statement. It seems to be false.
E3.2
a)
| P | Q | P ∧ Q | (P ∧ Q) ⇒ P . |
|---|---|---|---|
| T | T | T | T |
| F | T | F | T |
| T | F | F | F |
| F | F | F | T |
b)
| P | Q | P ∨ Q | P ⇒ (P ∨ Q). |
|---|---|---|---|
| T | T | T | T |
| F | T | T | T |
| T | F | T | T |
| F | F | F | T |
c)
| P | Q | P ⇒ Q | ¬(P ⇒Q) | ¬P | ¬(P ⇒Q)∧(¬P) |
|---|---|---|---|---|---|
| T | T | T | F | F | F |
| F | T | T | F | T | F |
| T | F | F | T | F | F |
| F | F | T | F | T | F |
d)
| P | Q | R | P ∨ Q | (P ∨ Q) ∧ R |
|---|---|---|---|---|
| T | T | T | T | T |
| T | T | F | T | F |
| T | F | T | T | T |
| T | F | F | T | F |
| F | T | T | T | T |
| F | T | F | T | F |
| F | F | T | F | F |
| F | F | F | F | F |
e)
| P | Q | R | Q ∧ R | P ∨ (Q ∧ R) |
|---|---|---|---|---|
| T | T | T | T | T |
| T | T | F | F | T |
| T | F | T | F | T |
| T | F | F | F | T |
| F | T | T | T | T |
| F | T | F | F | F |
| F | F | T | F | F |
| F | F | F | F | F |
E 3.3
a)
| P | Q | P ∧ Q | ¬(P ∧ Q) | ¬P | ¬Q | (¬P ) ∨ (¬Q) |
|---|---|---|---|---|---|---|
| T | T | T | F | F | F | F |
| T | F | F | T | F | T | T |
| F | T | F | T | T | F | T |
| F | F | F | T | T | T | T |
Since the columns containing
b)
| P | Q | P ⇒Q | ¬P | (¬P)∨Q |
|---|---|---|---|---|
| T | T | T | F | T |
| T | F | F | F | F |
| F | T | T | T | T |
| F | F | T | T | T |
Since the columns containing
c)
| P | Q | R | P ∨ Q | (P ∨ Q) ⇒ R | P ⇒ R | Q ⇒ R | (P ⇒R)∧(Q⇒R) |
|---|---|---|---|---|---|---|---|
| T | T | T | T | T | T | T | T |
| T | T | F | T | F | F | F | F |
| T | F | T | T | T | T | T | T |
| T | F | F | T | F | F | T | F |
| F | T | T | T | T | T | T | T |
| F | T | F | T | F | T | F | F |
| F | F | T | F | T | T | T | T |
| F | F | F | F | T | T | T | T |
Since the columns containing
E 3.4
a)
| P | Q | P ⇒ Q | ¬(P ⇒ Q) |
|---|---|---|---|
| T | T | T | F |
| T | F | F | T |
| F | T | T | F |
| F | F | T | F |
| P | Q | ¬Q | P ∧ (¬Q) |
|---|---|---|---|
| T | T | F | F |
| T | F | T | T |
| F | T | F | F |
| F | F | T | F |
Since the truth values for any values
b)
| P | Q | R | P ∧ Q | (P ∧ Q) ⇒ R |
|---|---|---|---|---|
| T | T | T | T | T |
| T | T | F | T | F |
| T | F | T | F | T |
| T | F | F | F | T |
| F | T | T | F | T |
| F | T | F | F | T |
| F | F | T | F | T |
| F | F | F | F | T |
| P | Q | R | ¬Q | ¬Q ∨ R | P ⇒ (¬Q ∨ R) |
|---|---|---|---|---|---|
| T | T | T | F | T | T |
| T | T | F | F | F | F |
| T | F | T | T | T | T |
| T | F | F | T | T | T |
| F | T | T | F | T | T |
| F | T | F | F | F | T |
| F | F | T | T | T | T |
| F | F | F | T | T | T |
Since the truth values for any values
c)
| P | Q | R | Q ∨ R | P ⇒ (Q ∨ R) |
|---|---|---|---|---|
| T | T | T | T | T |
| T | T | F | T | T |
| T | F | T | T | T |
| T | F | F | F | F |
| F | T | T | T | T |
| F | T | F | T | T |
| F | F | T | T | T |
| F | F | F | F | T |
| P | Q | R | ¬Q | P ∧ ¬Q | (P ∧ ¬Q) ⇒ R |
|---|---|---|---|---|---|
| T | T | T | F | F | T |
| T | T | F | F | F | T |
| T | F | T | T | T | T |
| T | F | F | T | T | F |
| F | T | T | F | F | T |
| F | T | F | F | F | T |
| F | F | T | T | F | T |
| F | F | F | T | F | T |
Since the truth values for any values
d)
| P | Q | R | P ∨ Q | (P ∨ Q) ⇒ R |
|---|---|---|---|---|
| T | T | T | T | T |
| T | T | F | T | F |
| T | F | T | T | T |
| T | F | F | T | F |
| F | T | T | T | T |
| F | T | F | T | F |
| F | F | T | F | T |
| F | F | F | F | T |
| P | Q | R | ¬R | ¬R∧P | ¬Q | (¬R∧P)⇒(¬Q) |
|---|---|---|---|---|---|---|
| T | T | T | F | F | F | T |
| T | T | F | T | T | F | F |
| T | F | T | F | F | T | T |
| T | F | F | T | T | T | T |
| F | T | T | F | F | F | T |
| F | T | F | T | F | F | T |
| F | F | T | F | F | T | T |
| F | F | F | T | F | T | T |
The two expressions are NOT logically equivalent because some values of P and Q result in different truth values for the expressions. For example, when P is false and Q is true,
e)
| P | Q | P ⇔Q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | T |
| P | Q | P ⇒Q | Q⇒P | (P ⇒Q)∧(Q⇒P) |
|---|---|---|---|---|
| T | T | T | T | T |
| T | F | F | T | F |
| F | T | T | F | F |
| F | F | T | T | T |
Since the truth values for any values
E 3.5
a)
| P | Q | P ⇒ Q | ¬Q | (P ⇒ Q) ∧ (¬Q) | ¬P | ((P ⇒ Q) ∧ (¬Q)) ⇒ (¬P ) |
|---|---|---|---|---|---|---|
| T | T | T | F | F | F | T |
| T | F | F | T | F | F | T |
| F | T | T | F | F | T | T |
| F | F | T | T | T | T | T |
The statement
b)
| P | Q | ¬P | P ∨ Q | (P ∨ Q) ∧ (¬P) | ((P ∨ Q) ∧ (¬P)) ⇒ Q |
|---|---|---|---|---|---|
| T | T | F | T | F | T |
| T | F | F | T | F | T |
| F | T | T | T | T | T |
| F | F | T | F | F | T |
The statement
c)
| P | Q | R | P ⇒ Q | P ⇒ R | (P ⇒ Q) ⇒ (P ⇒ R) |
|---|---|---|---|---|---|
| T | T | T | T | T | T |
| T | T | F | T | F | F |
| T | F | T | F | T | T |
| T | F | F | F | F | T |
| F | T | T | T | T | T |
| F | T | F | T | T | T |
| F | F | T | T | T | T |
| F | F | F | T | T | T |
This statement is neither a tautology nor a contradiction since not all values result in true or false.
d)
| P | Q | ¬P | ¬Q | (¬Q)⇒(¬P) | P ∧ (¬Q) | ((¬Q)⇒(¬P)) ∧ P ∧ (¬Q) |
|---|---|---|---|---|---|---|
| T | T | F | F | T | F | F |
| T | F | F | T | F | T | F |
| F | T | T | F | T | F | F |
| F | F | T | T | T | F | F |
The expression ((¬Q) ⇒ (¬P)) ∧ P ∧ (¬Q) is false for all combinations of P and Q; therefore, it is a contradiction.
E 3.6
a)
| P | Q | P ⇒ Q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | T |
| F | F | T |
| P | Q | Q ⇒ P |
|---|---|---|
| T | T | T |
| T | F | T |
| F | T | F |
| F | F | T |
Since the two tables right columns are not identical, the statements are not logically equivalent.
b)
Statement P: "It is raining." Statement Q: "The ground is wet."
P ⇒ Q: "If it is raining, then the ground is wet." This is (typically) true because rain typically makes the ground wet.
Q ⇒ P: "If the ground is wet, then it is raining." This is not necessarily true because there could be other reasons for the ground to be wet, such as BYU's awful sprinklers, a spilled drink, etc.
Truth value of P ⇒ Q: True
Truth value of Q ⇒ P: False