logic (slides)
TRANSCRIPT
Logic
Propositions and Logical OperationsDefinition: A statement or proposition is a declarative sentence that is either true (T) or false (F), but not both.
Example: Which of the following are statements?
a. It is raining.
b. 2 + 3 = 5
c. Do you speak English?
d. 3 β π₯π₯ = 5
e. Take two aspirins.Β© S. Turaev, CSC 1700 Discrete Mathematics 2
Propositions and Logical Operations The letters ππ, ππ, ππ are denote propositional variables
β’ ππ: I am teaching.
β’ ππ: 3 Γ 23 = 70
Compound statements: propositional variables combined by logical connectives (and, or, if β¦ then, β¦):
β’ ππ and ππ.
β’ ππ or ππ.
β’ If ππ then ππ.
3Β© S. Turaev, CSC 1700 Discrete Mathematics
Propositions and Logical OperationsDefinition: If ππ is a statement, the negation of ππ is the statement not ππ, denoted by ~ππ (sometimes, Β¬ππ, οΏ½Μ οΏ½π).
~ππ: βIt is not the case that ππβ.
Example:
ππ: 2 + 3 > 1 ~ππ:
ππ: It is cold. ~ππ:
4Β© S. Turaev, CSC 1700 Discrete Mathematics
ππ ~ππT FF T
Propositions and Logical OperationsDefinition: If ππ and ππ are statements, the conjunction of ππand ππ is the compound statement ππ and ππ, denoted by ππ β§ ππ.
Example:
ππ: It is raining. ππ: It is cold.
ππ: 2 < 3. ππ: β3 < β2.
ππ β§ ππ:
5Β© S. Turaev, CSC 1700 Discrete Mathematics
ππ ππ ππ β§ ππT T TT F FF T FF F F
Propositions and Logical OperationsDefinition: If ππ and ππ are statements, the disjunction of ππand ππ is the compound statement ππ or ππ, denoted by ππ β¨ππ.
Example:
ππ: It is raining. ππ: It is cold.
ππ: 2 < 3. ππ: β3 < β2.
ππ β¨ ππ:
6Β© S. Turaev, CSC 1700 Discrete Mathematics
ππ ππ ππ β§ ππT T TT F TF T TF F F
Propositions and Logical OperationsA compound statement may have many components:
ππ β¨ (ππ β§ (~ ππ β§ ππ ))
Example: Make a truth table for ππ β§ ππ β¨ ~ππ.
7Β© S. Turaev, CSC 1700 Discrete Mathematics
ππ ππ ππ β§ ππ ~ππ β¨T TT FF TF F
Propositions and Logical OperationsDefinition: If ππ and ππ are statements, the compound statement βif ππ then ππβ, denoted ππ β ππ, is called a conditional statement or implication.
The statement ππ is called antecedent or hypothesis and ππis called the consequent or conclusion.
Example:
ππ: I am hungry. ππ: I will eat.
ππ: It is snowing. ππ: 3 + 2 = 5.
ππ β ππ:
8Β© S. Turaev, CSC 1700 Discrete Mathematics
ππ ππ ππ β ππT T TT F FF T TF F T
Propositions and Logical OperationsDefinition: If ππ β ππ is an implication, then
the converse of ππ β ππ is the implication ππ β ππ
the inverse of ππ β ππ is the implication ~ππ β ~ππ
the contrapositive of ππ β ππ is the implication ~ππ β~ππ
Example: ππ β ππ: βIf it is raining then I get wetβ then
ππ β ππ, ~ππ β ~ππ, ~ππ β ~ππ?
9Β© S. Turaev, CSC 1700 Discrete Mathematics
Propositions and Logical OperationsDefinition: If ππ and ππ are statements, the compound statement βππ if and only if ππβ, denoted ππ β ππ, is called an equivalence or biconditional.
Example:
ππ: 3 > 2. ππ: 0 < 3 β 2.
ππ: It is snowing. ππ: 3 + 2 = 5.
ππ β ππ:
10Β© S. Turaev, CSC 1700 Discrete Mathematics
ππ ππ ππ β ππT T TT F FF T FF F T
Propositions and Logical OperationsExample: Compute the truth table of the statement
ππ β ππ β (~ππ β ~ππ)
11Β© S. Turaev, CSC 1700 Discrete Mathematics
ππ ππ ππ β ππ ~ππ ~ππ ~ππ β ~ππ βT TT FF TF F
Propositions and Logical OperationsDefinition: A statement that is true for all possible values of its propositional variables is called a tautology.
Definition: A statement that is false for all possible values of its propositional variables is called a contradiction or an absurdity.
Definition: A statement that can be either true or falsefor all possible values of its propositional variables is called contingency.
12Β© S. Turaev, CSC 1700 Discrete Mathematics
Propositions and Logical OperationsExample:
The statement ππ β¨ ~ππ:
The statement ππ β§ ~ππ:
The statement ππ β ππ β§ (ππ β¨ ππ):
13Β© S. Turaev, CSC 1700 Discrete Mathematics
Propositions and Logical OperationsDefinition: We say that the statements ππ and ππ are logically equivalent (or simply equivalent), denoted by ππ β‘ ππ, if ππ β ππ is tautology.
Example: Show that
ππ β¨ ππ β‘ ππ β¨ ππ
ππ β ππ β‘ ~ππ β¨ ππ
14Β© S. Turaev, CSC 1700 Discrete Mathematics
Propositions and Logical OperationsDefinition: A predicate or a propositional function is a noun/verb phrase template that describes a property of objects, or a relationship among objects represented by the variables:
Example: ππ π₯π₯ : βπ₯π₯ is integer less than 8.β
ππ 1 =
ππ 10 =
ππ β11 =
15Β© S. Turaev, CSC 1700 Discrete Mathematics
Propositions and Logical OperationsDefinition: The universal quantification of a predicate ππ π₯π₯ is the statement βFor all values of π₯π₯ (for every π₯π₯, for each π₯π₯, for any π₯π₯), ππ π₯π₯ is trueβ and is denoted by βπ₯π₯ππ π₯π₯ .
Example: ππ π₯π₯ : ββ βπ₯π₯ = π₯π₯β is a predicate that is true for all real numbers.
βπ₯π₯ππ π₯π₯ =
Example: ππ π₯π₯ : βπ₯π₯ + 1 < 4β.
βπ₯π₯ππ π₯π₯ =
16Β© S. Turaev, CSC 1700 Discrete Mathematics
Propositions and Logical OperationsA predicate may contain several variables.
Example: ππ π₯π₯, π¦π¦ : π₯π₯ + π¦π¦ = π¦π¦ + π₯π₯
βπ₯π₯βπ¦π¦ππ π₯π₯,π¦π¦ =
Example: Write the following statement in the form of a predicate and quantifier:
βThe sum of any two integers is even number.β
17Β© S. Turaev, CSC 1700 Discrete Mathematics
Propositions and Logical OperationsDefinition: The existential quantification of a predicate ππ π₯π₯ is the statement βThere exists a value of π₯π₯, for which ππ π₯π₯ is trueβ and is denoted by βπ₯π₯ππ π₯π₯ .
Example: ππ π₯π₯ : ββπ₯π₯ = π₯π₯β.
βπ₯π₯ππ π₯π₯ =
Example: ππ π₯π₯ : βπ₯π₯ + 1 < 4β.
βπ₯π₯ππ π₯π₯ =
18Β© S. Turaev, CSC 1700 Discrete Mathematics
Algebraic PropertiesCommutative properties:
ππ β¨ ππ β‘ ππ β¨ ππ ππ β§ ππ β‘ ππ β§ ππ
Associative properties:
ππ β¨ ππ β¨ ππ β‘ ππ β¨ ππ β¨ ππ ππ β§ ππ β§ ππ β‘ ππ β§ ππ β§ ππ
Distributive properties:
ππ β¨ ππ β§ ππ β‘ ππ β¨ ππ β§ ππ β¨ ππ ππ β§ ππ β¨ ππ β‘ ππ β§ ππ β¨ ππ β§ ππ
19Β© S. Turaev, CSC 1700 Discrete Mathematics
Algebraic PropertiesIdempotent properties:
ππ β¨ ππ β‘ ππ
ππ β§ ππ β‘ ππ
Properties of negation:
~(~ππ) β‘ ππ
~ ππ β¨ ππ β‘ ~ππ β§ ~ππ
~ ππ β§ ππ β‘ ~ππ β¨ ~ππ
20Β© S. Turaev, CSC 1700 Discrete Mathematics
Algebraic PropertiesProperties of implication:
ππ β ππ β‘ ~ππ β¨ ππ
ππ β ππ β‘ ~ππ β ~ππ
ππ β ππ β‘ ππ β ππ β§ ππ β ππ
~ ππ β ππ β‘ ππ β ~ππ
~ ππ β ππ β‘ ππ β§ ~ππ β¨ ππ β§ ~ππ
21Β© S. Turaev, CSC 1700 Discrete Mathematics
Algebraic PropertiesProperties of quantifiers:
~ βπ₯π₯ππ π₯π₯ β‘ βπ₯π₯~ππ π₯π₯
~ βπ₯π₯ππ π₯π₯ β‘ βπ₯π₯~ππ π₯π₯
βπ₯π₯ ππ π₯π₯ β ππ π₯π₯ β‘ βπ₯π₯ππ π₯π₯ β βπ₯π₯ππ π₯π₯
βπ₯π₯ ππ π₯π₯ β¨ ππ π₯π₯ β‘ βπ₯π₯ππ π₯π₯ β¨ βπ₯π₯ππ π₯π₯
βπ₯π₯ ππ π₯π₯ β§ ππ π₯π₯ β‘ βπ₯π₯ππ π₯π₯ β§ βπ₯π₯ππ π₯π₯
βπ₯π₯ππ π₯π₯ β¨ βπ₯π₯ππ π₯π₯ β βπ₯π₯ ππ π₯π₯ β¨ ππ π₯π₯
βπ₯π₯ ππ π₯π₯ β§ ππ π₯π₯ β βπ₯π₯ππ π₯π₯ β¨ βπ₯π₯ππ π₯π₯22Β© S. Turaev, CSC 1700 Discrete Mathematics
Algebraic PropertiesTautologies:
ππ β ππ β§ ππ β ππ β (ππ β ππ)23Β© S. Turaev, CSC 1700 Discrete Mathematics
ππ β§ ππ β ππ
ππ β ππ β¨ ππ
~ππ β ππ β ππ
ππ β§ ππ β ππ β ππ
~ππ β§ ππ β ππ β ~ππ
ππ β§ ππ β ππ
ππ β ππ β§ ππ
~ ππ β ππ β ππ
~ππ β§ ππ β¨ ππ β ππ