2.1 Propositions and logical operations
Logic: the study of formal reasoning
Proposition: a statement that is either true or false (not a command or a question)
Proposition’s truth value: a value indicating whether the proposition is true or false
Proposition variables: denote arbitrary propositions
Compound proposition: connecting individual propositions with logical operations
Logical operation: combines propositions using a particular composition rule
Conjunction:
Truth table: shows the truth value of a compound proposition for every possible combination of truth values for the variables in the compound proposition
Disjunction (inclusive or):
Exclusive or:
Negation:
2.2 Evaluating compound propositions
Order of operations without parentheses:
2.3 Conditional statements
Conditional operation:
Conditional proposition: a compound proposition that uses a conditional operation
In ,
Hypothesis:
Conclusion:
ONLY IF: necessary condition
IF: sufficient condition
Ex., let:
: I share cookie
: You share soda
: I share cookie ONLY IF you share soda.
: I will NOT share cookie if you do NOT share soda.
| Proposition | |
|---|---|
| Converse | |
| Contrapositive | |
| Inverse |
Biconditional operation (if and only if, necessary and sufficient for):
Apply , , and before or
2.4 Logical equivalence
Tautology: the compound proposition is always true
Contradition: the compound proposition is always false
Not a tautology: find one case where it is false
Not a contradiction: find one case where it is true
Logical equivalence (): two compound propositions have the same truth value regardless of the truth values of their individual propositions
Not logically equivalent: find one case where they have different truth values
First De Morgan’s law:
Second De Morgan’s law:
2.5 Laws of propositional logic
| Law | Disjunction Form | Conjunction Form |
|---|---|---|
| Idempotent laws | ||
| Associative laws | ||
| Commutative laws | ||
| Distributive laws | ||
| Identity laws | ||
| Domination laws | ||
| Double negation law | ||
| Complement laws | | |
| De Morgan’s laws | ||
| Absorption laws | ||
| Conditional identities |
2.6 Predicates and quantifiers
Predicate: a logical statement with a truth value that is a function of one or more variables (even if true for all values in the domain)
Domian of a variable in a predicate: the set of possible values for the variable
Universal quantifier:
Universally quantified statement:
NOTE: to turn a predicate into a proposition, either assign values to its variables or use quantifiers
A counterexample for a universally quantified statement: an element in the domain for which the predicate is false
NOTE: if domain of is empty, then the statement is true because there are no elements int he domian for which is false
Existential quantifier:
Existentially quantified statement:
An example for an existentially quantified statement: an element in the domain for which the predicate is true
NOTE: if domian of is empty, then the statement is false becuase there is no element in the domain for which is true
2.7 Quantified statements
Quantified statement: a logical statement that includes a universal or existential quantifier
Quantifiers are applied before logical operations
Free variable: a variable in the predicate
Bound variable: a variable in the statement
Scope of a quantifier: the part of the logical expression to which the quantifier applies
A variable name can be reused, as long as the scopes of the quantifiers that bind the variables do not overlap
NOTE: changing someone to everyone usually changes both the quantifier and the operator
- Someone who is A is B:
- Everyone who is A is B:
2.8 De Morgan’s law for quantified statements
De Morgan’s laws for quantified statements
2.9 Nested quantifiers
Nested quantifiers: a logical expression with more than one quantifier that binds different variables in the same predicate
Two quantifiers of the same type that are next to each other in a logical expression can be switched to obtain a logically equivalent expression
2.10 More nested quantified statements
Ex., let:
: whether sent an email to
Everyone sent an email to someone else:
Ex., let:
: whether or not came late
Exactly one person was late:
Someone who came late and everyone other than did not come late
Null qualification
NOTE: remember to verify that does not appear in
Ex.,
Ex., let:
: passed the exam
Everyone other than Alex:
- Every person except Alex must satisfy
- When , is false, so the implication is automatically true
- Therefore, whether Alex passed is irrelevant
Everyone: - Every person, including Alex, must satisfy
Key: “Other than Alex” means Alex is not required to pass; it does not mean Alex is required to fail
To explicitly say Alex did not pass:
2.11 Set notation and quantified logical statements
Define domian before logical expression:
Inline: the set used in an inline definition of a domian must be explicitly defined beforehand or must use a standard symbol for a methematical set (Ex., )
Multiple variables inline: