Logic & Propositions
In place of specific propositions, usually the letters
Connectives:
These are the connectives that are mostly used:
connective | symbol | |
---|---|---|
negation | "not" | |
conjunction | "and" | |
disjunction | "or" | |
exclusive disjunction | "xor (exclusive or)" | |
implication | "if ... then" | |
biconditional | "iff" ("if and only if") |
-
Negation just inverses the truth value of a proposition.
-
A conjunction is true only if both propositions are true.
-
A disjunction is true if one of the propositions is true.
-
An exclusive disjunction, "exclusive or (XOR)," is true when the both of the propositions are of different truth values.
-
A biconditional is true when both of the propositions are of the same value.
-
An implication is only false when the antecedent (the "if part") is true, and the consequent (the "then part") is false; in all other cases it is true. In fact, let's take a look at one example:
The statement is: "If Goldbach's conjecture is true, thenfor every real number ." Remember that Goldbach's conjecture says that every even integer greater than 2 is the sum of two primes.
We don't know for certain if it is true or not, but "
for every real number " is definitely true. So, it doesn't matter if the antecedent (If Goldbach's conjecture is true) is true or not, the fact that the consequent (then for every real number ) is true makes the whole proposition true.
From an implication (
- converse (
) — switching and - inverse (
) — negate both and - contrapositive (
) — switch & negate both and
An implication and its contrapositive are equivalent:
An implication and its converse is the same as the biconditional:
A tautology is a proposition that is always true (e.g.,
A contradiction is a proposition that is always false (e.g.,
A contingency is a proposition that is neither a tautology nor a contradiction (e.g.,
Equivalence
Assignment of values to variables is called an environment.
For example, environment
Two propositional formulas are equivalent iff they have the same truth value in all environments. That is, the compound propositions
An example is De Morgan's Laws:
A half adder is a digital circuit that adds two 1-bit numbers. A full adder also adds two 1-bit numbers, but the difference is that a half adder does not have a carry input while a full adder does. (Carry is the same thing when you do decimal addition, for example, with
1-bit half adder | 1-bit full adder |
---|---|
A binary addition circuit example (a "ripple carry") is as follows:
We can say that
(Imagine
If we define
What does it mean? Let's see.
Let's say |
We already know we don't have a carry ( |
Plugging in our values, we get |
Satisfiability & Validity
A formula is satisfiable iff it is true in some environment (which can sometimes be true), for example,
An example of a formula that is not satisfiable is
A formula is valid iff it is true in all environments (which is always true), for example,