Discrete Mathematics: Principles of Logic and Propositional Logic
Foundations of Mathematical and Automated Reasoning
- Logic serves as the fundamental basis for all mathematical reasoning as well as all automated reasoning.
- Standard mathematical logic is essential for providing precisely formulated statements that would otherwise be expressed in natural language.
- The application of logical principles allows for the development of sets of laws that remain internally consistent.
- Within the field of computer science, mathematical logic is utilized to:
- Construct specific computer programs.
- Provide verification that programs perform exactly what they were designed to do.
Propositional Logic
- A proposition is defined as a statement or sentence that declares a specific fact.
- A proposition must evaluate to exactly one of two truth values: TRUE or FALSE, but it cannot be both.
- Truth values are typically denoted by letters:
- If a proposition is true, it is denoted by .
- If a proposition is false, it is denoted by .
Examples of Quantitative and Factual Propositions
- True Propositions:
- There are seven days in a week.
- Accra is the capital of Ghana.
- False Propositions:
- The angles of a triangle add up to .
- London is the capital of France.
Sentences That Are Not Propositions
- Sentences that do not declare a fact are not considered propositions.
- Questions: "Who are you?"
- Commands or Exclamations: "Read this chapter before the next class."
- Sentences with Unassigned Variables: "" is not a proposition because its truth value depends on the value of . However, if values are assigned to variables, such sentences can become propositions.
Mathematical Notation for Propositions
- Letters are used to denote specific propositional statements. Common examples include:
- : Jane drives a Ford
- : Bob has grey hair
- : Joe likes computer science
Logical Connectives and Truth Tables
- Logical connectives are operators used to combine propositions into compound statements.
- These connectives provide precise semantic meanings to words used in natural language such as "AND" and "OR."
- Semantic meaning for these connectives is defined using truth tables, which list the resulting truth value for every possible combination of values of the individual component statements.
Negation (The NOT Operator)
- If is a proposition, "not " is the negation, represented by the symbols or .
- The negation yields a value opposite to that of the original proposition.
- Example: If represents "I like dogs," then represents "I do not like dogs."
- Truth Table for Negation:
Conjunction (The AND Operator)
- The conjunction of propositions and is represented by the symbol .
- The compound statement is written as .
- Example: If is "I like shopping" and is "The sun is shining," then is "I like shopping and the sun is shining."
- Truth Table for Conjunction:
Disjunction (The OR Operator)
- The disjunction of propositions and is represented by the symbol .
- The compound statement is written as .
- This is an inclusive OR, meaning it is true if either or both propositions are true.
- Example: If is "I do the gardening" and is "Today is Wednesday," then can represent "I do gardening every Wednesday" (or "I do gardening or it is Wednesday").
- Truth Table for Disjunction:
Exclusive OR (The XOR Operator)
- The exclusive or connects propositions and to result in " or (but not both)."
- The symbol for exclusive or is .
- The statement is true only when one proposition is true and the other is false.
- Example: "I will earn an A in this course," "I will drop this course." "I will either earn an A in this course, or I will drop it (but not both!)."
- Truth Table for Exclusive OR:
Conditional Statements and Implications
The Implication Operator
- The implication operator gives meaning to the expression " implies ," represented by the symbol .
- This is also known as a conditional statement, often expressed as "if then ."
- Components:
- is the hypothesis, antecedent, or premise.
- is the conclusion, consequence, or result.
- Alternative phrasings for :
- If , then
- is sufficient for
- A necessary condition for is
- only if
- unless
- follows from
- Example: "If you get an A (), then I'll give you a dollar ()."
- If both are true, the promise is kept ().
- If is true but is false, the promise is broken ().
- If is false, the promise hasn't been broken regardless of . Thus, in two-valued logic, it is considered true ().
- Truth Table for Implication:
Converse, Contrapositive, and Inverse
From an original conditional statement , we can derive three related statements:
- Converse:
- Contrapositive:
- Inverse:
Example Application:
- Original Statement: "The home team wins whenever it is raining" (If it is raining, then the home team wins).
- Converse: "If the home team wins, then it is raining."
- Contrapositive: "If the home team does not win, then it is not raining."
- Inverse: "If it is not raining, then the home team does not win."
Biconditional (The Equivalence Operator)
- The biconditional combines two propositions to express that they share the same truth value.
- Represented by the symbol , often read as " if and only if (iff) ."
- It is true if and are both true, or if and are both false.
- Example: : "David is son of Ricky (male)." : "Ricky is father of David." This can be written as .
- Truth Table for Biconditional:
Three-Valued Logic
In both computing and mathematics, expressions sometimes cannot be evaluated precisely (e.g., the square root of a negative integer). In these cases, a three-valued logic is defined using truth values: TRUE (), FALSE (), and UNDEFINED.
Three-Valued Conjunction ()
| Undefined | Undefined | |
| Undefined | ||
| Undefined | Undefined | |
| Undefined | ||
| Undefined | Undefined | Undefined |
Three-Valued Disjunction ()
| Undefined | ||
| Undefined | Undefined | |
| Undefined | ||
| Undefined | Undefined | |
| Undefined | Undefined | Undefined |
Three-Valued Implication ()
| Undefined | Undefined | |
| Undefined | ||
| Undefined | ||
| Undefined | Undefined | |
| Undefined | Undefined | Undefined |
Three-Valued Exclusive OR () and Biconditional ()
Truth Table for :
| Undefined | Undefined | |
| Undefined | Undefined | |
| Undefined | Undefined | |
| Undefined | Undefined | |
| Undefined | Undefined | Undefined |
Truth Table for :
| Undefined | Undefined | |
| Undefined | Undefined | |
| Undefined | Undefined | |
| Undefined | Undefined | |
| Undefined | Undefined | Undefined |
Working with Compound Statements
- Compound statements involve two or more logical operations.
- Order of Operations (Precedence):
- Parenthetical Expressions: (evaluated innermost to outermost).
- Negation (NOT):
- Conjunction (AND):
- Disjunction (OR):
- Conditional (Implication):
- Operations with equal precedence are evaluated from left to right.
Creating a Truth Table
- Row Count: Determined by , where is the number of propositional variables. (e.g., variables rows).
- Column Count: Number of variables plus one column for each logical operation.
- General Steps:
- Assign variables to basic statements.
- Symbolize the compound statement.
- Identify the order of operations based on precedence.
- Fill the table left to right.
Walkthrough Example
Statement: "If the tire is flat then I will have to remove it and take it to the gas station."
- Step 1 (Variables):
- : The tire is flat.
- : I have to remove the tire.
- : I have to take the tire to the gas station.
- Step 2 (Symbolism): . (Parentheses are used for clarity, though conjunction naturally has higher precedence than implication).
- Step 3 (Precedence Checking):
- AND ()
- Conditional ()
- Final Truth Table Construction:
Logical Equivalence, Tautology, and Contradiction
Logical Equivalence
- Two compound propositions are logically equivalent () if they produce identical results in their truth tables.
- Example 1: (Double negation).
- Example 2 (De Morgan's Laws derivation): .
Tautology
- A tautology is a statement that is always TRUE regardless of the truth values of its components. All rows of the truth table evaluate to .
- Example 1:
- Example 2:
Contradiction
- A contradiction is a statement that is always FALSE. All rows of the truth table evaluate to .
- Example: