Logic and Discrete Mathematics Exam Help: Difference between revisions
(6 intermediate revisions by 2 users not shown) | |||
Line 29: | Line 29: | ||
! ''Equivalence'' !! ''Name'' | ! ''Equivalence'' !! ''Name'' | ||
|- | |- | ||
| | | p ∧ '''T''' ≡ p<br />p ∨ '''F''' ≡ p || Identity laws | ||
|- | |- | ||
| | | p ∨ '''T''' ≡ '''T'''<br /> p ∧ '''F''' ≡ '''F''' || Domination laws | ||
|- | |- | ||
| | | p ∨ p ≡ p <br />p∧p≡p || Idempotent laws | ||
|- | |- | ||
| ¬(¬p) | | ¬(¬p) ≡ p || Double negation law | ||
|- | |- | ||
| | | p ∨ q ≡ q ∨ p<br />p∧q≡q∧p || Commutative laws | ||
|- | |- | ||
| ( | | (p ∨ q) ∨ r ≡ p ∨ (q ∨ r)<br />(p ∧ q) ∧ r ≡ p ∧ (q ∧ r) || Associative laws | ||
|- | |- | ||
| | | p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)<br />p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) || Distributive laws | ||
|- | |- | ||
| ¬( | | ¬(p ∧ q) ≡ ¬p ∨ ¬q<br />¬(p ∨ q) ≡ ¬p ∧ ¬q || De Morgan's laws | ||
|- | |- | ||
| | | p ∨ (p ∧ q) ≡ p<br />p ∧ (p ∨ q) ≡ p || Absorption laws | ||
|- | |- | ||
| | | p ∨ ¬p ≡ '''T'''<br />p ∧ ¬p ≡ '''F''' || Negation laws | ||
|} | |} | ||
Line 120: | Line 120: | ||
==Conjunctive and Disjunctive Normal Form of propositional statements== | ==Conjunctive and Disjunctive Normal Form of propositional statements== | ||
A formula in conjunctive normal form (CNF) is a conjunction of clauses. | A formula in conjunctive normal form (CNF) is a conjunction of clauses. | ||
<pre>Example of CNF: ( | <pre>Example of CNF: (p ∨ ¬q ∨ r) ∧ (¬p ∨ ¬r) ∧ q </pre> | ||
Similarly, one defines formulas in disjunctive normal form (DNF) by swapping the words | Similarly, one defines formulas in disjunctive normal form (DNF) by swapping the words | ||
’conjunction’ and ’disjunction’ in the definitions above. | ’conjunction’ and ’disjunction’ in the definitions above. | ||
<pre>Example of DNF: ( | <pre>Example of DNF: (¬p ∧ q ∧ r) ∨ (¬q ∧ ¬r) ∨ (p ∧ r) </pre> | ||
<u>Transformation into CNF :</u> | <u>Transformation into CNF :</u> | ||
Every propositional formula can be converted into an equivalent formula that is in CNF. | Every propositional formula can be converted into an equivalent formula that is in CNF. | ||
<pre>Example: Transform the following formula into CNF: ¬(p → q) ∨ (r → p) | <pre>Example: Transform the following formula into CNF: ¬(p → q) ∨ (r → p) | ||
1) Express implication by disjunction and negation: ¬( | 1) Express implication by disjunction and negation: ¬(¬p ∨ q) ∨ (¬r ∨ p) | ||
2) Push implication by disjunction and negation: ( | 2) Push implication by disjunction and negation: (¬¬p ∧ ¬q) ∨ (¬r ∨ p); (p ∧ ¬q) ∨ (¬r ∨ p) | ||
3) Convert to CNF by associative and distributive laws: ( | 3) Convert to CNF by associative and distributive laws: (p ∨ ¬r ∨ p) ∧ (¬q ¬r ∨ p) | ||
4) Optionally simplify by commutative and idempotent laws: ( | 4) Optionally simplify by commutative and idempotent laws: (p ∨ ¬r) ∧ (¬q (p ∨ ¬r) | ||
and by commutative and absorption laws: | and by commutative and absorption laws: p ∨ ¬r</pre> | ||
==Predicates and quantifiers== | ==Predicates and quantifiers== | ||
Line 164: | Line 164: | ||
==Logical equivalences for quantifiers== | ==Logical equivalences for quantifiers== | ||
Statements involving predicates and quantifiers are logically equivalent if and only if they have the same truth value no matter which predicates are substituted into these statements and which domain of discourse is used for the variables in these propositional functions. | |||
We use the notation S ≡ T to indicate that two statements S and T involving predicates and quantifiers are logically equivalent. | |||
[https://goo.gl/ZLsWZe Examples] | |||
[https://goo.gl/olHWgn Example where ∀x.∃y.P(x,y) (¬≡) ∃y.∀x.P(x,y) ] | |||
[https://goo.gl/KXLDUR The meaning of the different possible quantifications involving two variables.] | |||
==Propositional calculus (PC)== | ==Propositional calculus (PC)== | ||
Propositional Logic, or the Propositional Calculus, is a formal logic for reasoning about propositions, that is, atomic declarations that have truth values. | |||
=== Derivation in classical logic=== | === Derivation in classical logic=== | ||
Classical propositional logic is a kind of propostional logic in which the only truth values are true and false and the four operators not, and, or, and if-then, are all truth functional. Therefore, by conversing the previous sentence we get, that propositional calculus uses more than four logical operators. | |||
==Semantics of predicate calculus== | ==Semantics of predicate calculus== | ||
=== Validity and satisfiability of predicate statements=== | === Validity and satisfiability of predicate statements=== | ||
<u> Validity</u> | |||
An assertion in predicate calculus is logically valid (or simply valid) if it is true in every interpretation, that is if and only if it is true : | |||
- for all domains | |||
- for every propositional functions substituted for the predicates in the assertion | |||
Valid assertions in predicate logic play a role similar to tautologies in propositional logic. | |||
Example: <pre>∀x.(P(x)v¬P(x))</pre> | |||
<u>Satisfiability</u> | |||
An assertion in predicate calculus is satisfiable iff it is true: | |||
- for some domain | |||
- for some propositional functions that can be substituted for the predicates in the assertion | |||
Valid assertions in predicate logic play a role similar to tautologies in propositional logic. | |||
Example: [https://goo.gl/vgQ9EE link] | |||
== Sequent predicate calculus LK== | == Sequent predicate calculus LK== | ||
Line 178: | Line 210: | ||
Please see yourself to the [http://logitext.mit.edu/tutorial interactive tutorial of the Sequent Calculus (LK)]. | Please see yourself to the [http://logitext.mit.edu/tutorial interactive tutorial of the Sequent Calculus (LK)]. | ||
== Proof techniques. Constructive and non-constructive proofs== | == Proof techniques == | ||
A theorem is a statement that can be shown to be true. Theorem is true with a sequence of statements that form an argument, called a proof. To construct proofs, methods are needed to derive new statements from old ones. Rules of interference are the means used to draw conclusions from other assertions, tie together the steps of a proof. | |||
=== Constructive and non-constructive proofs=== | |||
== Proofs by contraposition and contradiction== | == Proofs by contraposition and contradiction== |
Latest revision as of 09:50, 17 January 2016
I601 Logic and Discrete Math Revision Questions
Propositions, logical operations and compound propositional statements
A proposition is a declarative sentence that is either true or false, but not both. A proposition can also be considered a result of logical operators (logical connectives, AND, OR, XOR, NAND, IF THEN, IFF). New compositions, called compound propositions are formed from existing propositions using logical operators.
Classification of compound propositions
Satisfiability
A proposition is satisfiable if truth table contains True at least once.
Tautology
A proposition is a tautology if is always true (truth table consists of value True).
Contradiction
If the truth table is always false.
Contingency
A proposition is satisfiable but not a tautology.
Logical equivalence
If two propositions, p and q, have the same value in all possible cases are called logically equivalent, p ≡ q, if p↔q.
Equivalence | Name |
---|---|
p ∧ T ≡ p p ∨ F ≡ p |
Identity laws |
p ∨ T ≡ T p ∧ F ≡ F |
Domination laws |
p ∨ p ≡ p p∧p≡p |
Idempotent laws |
¬(¬p) ≡ p | Double negation law |
p ∨ q ≡ q ∨ p p∧q≡q∧p |
Commutative laws |
(p ∨ q) ∨ r ≡ p ∨ (q ∨ r) (p ∧ q) ∧ r ≡ p ∧ (q ∧ r) |
Associative laws |
p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) |
Distributive laws |
¬(p ∧ q) ≡ ¬p ∨ ¬q ¬(p ∨ q) ≡ ¬p ∧ ¬q |
De Morgan's laws |
p ∨ (p ∧ q) ≡ p p ∧ (p ∨ q) ≡ p |
Absorption laws |
p ∨ ¬p ≡ T p ∧ ¬p ≡ F |
Negation laws |
Contrapositive
The negative version of the positive logical proposition, p∨q≡¬p∧¬q.
Converse
The mirror opposite of a logical proposition.
p | q | p→q | q→p |
---|---|---|---|
T | T | T | T |
T | F | F | T |
F | T | T | F |
F | F | T | T |
Algebra of propositions
Laws of Algebra of propositions The table can be found here: Table: Laws of Algebra of Propositions (you can just add this picture and delete this all:D)
About Truth Table:
To be T they have to be: Λ == both True V == at least 1 True p → q == p ≡ False or q ≡ True p ↔ q == both False or True
Identity:
p V p ≡ p p Λ p ≡ p p → p ≡ T p ↔ p ≡ T p V T ≡ T p Λ T ≡ p p → T ≡ T p ↔ T ≡ p p V F ≡ p p Λ F ≡ F p → F ≡ ~p p ↔ F ≡ ~p T → p ≡ p F → p ≡ T
Commutative:
p V q ≡ q V p p Λ q ≡ q Λ p p → q ≠ q → p p ↔ q ≡ q ↔ p
Complement:
p V ~p ≡ T p Λ ~p ≡ F p → ~p ≡ ~p p ↔ ~p ≡ F ~p → p ≡ p
Double Negation:
~(~p) ≡ p
Associative:
p V (q V r) ≡ (p V q) V r p Λ (q Λ r) ≡ (p Λ q) Λ r
Distributive:
p V (q Λ r) ≡ (p V q) Λ (p V r) p Λ (q V r) ≡ (p Λ q) V (p Λ r)
Absorbtion:
p V (p Λ q) ≡ p p Λ (p V q) ≡ p
De Morgan’s:
~(p V q) ≡ ~p Λ ~q ~(p Λ q) ≡ ~p V ~q
Equivalence of Contrapositive:
p → q ≡ ~q → ~p
Others:
p → q ≡ ~p V q p ↔ q ≡ (p → q) Λ (q → p)
Conjunctive and Disjunctive Normal Form of propositional statements
A formula in conjunctive normal form (CNF) is a conjunction of clauses.
Example of CNF: (p ∨ ¬q ∨ r) ∧ (¬p ∨ ¬r) ∧ q
Similarly, one defines formulas in disjunctive normal form (DNF) by swapping the words ’conjunction’ and ’disjunction’ in the definitions above.
Example of DNF: (¬p ∧ q ∧ r) ∨ (¬q ∧ ¬r) ∨ (p ∧ r)
Transformation into CNF : Every propositional formula can be converted into an equivalent formula that is in CNF.
Example: Transform the following formula into CNF: ¬(p → q) ∨ (r → p) 1) Express implication by disjunction and negation: ¬(¬p ∨ q) ∨ (¬r ∨ p) 2) Push implication by disjunction and negation: (¬¬p ∧ ¬q) ∨ (¬r ∨ p); (p ∧ ¬q) ∨ (¬r ∨ p) 3) Convert to CNF by associative and distributive laws: (p ∨ ¬r ∨ p) ∧ (¬q ¬r ∨ p) 4) Optionally simplify by commutative and idempotent laws: (p ∨ ¬r) ∧ (¬q (p ∨ ¬r) and by commutative and absorption laws: p ∨ ¬r
Predicates and quantifiers
A predicate or propositional function is a description of the property (or properties) a variable or subject may have. A proposition may be created from a propositional function by either assigning a value to the variable or by quantification. Propositional logic cannot adequately express the meaning of all statements in mathematics and in natural language.
Example: Having assumptions: • Every computer connected to the school network is functioning properly. • ELVIS is one of the computers connected to the school network. No rules of propositional logic allows us to conclude the truth of the statement ELVIS is functioning properly
Extends propositional logic by • Individuals a, b, ... , ELVIS, ...
• (Individual) variables x,y,...
• Predicates(= propositional functions) P(x), Q(x), R(x,y), ...
• Quantifiers ∀,∃
A propositional function is a generalisation of proposition: • its argument stands for en element from its domain;
• its value is True or False depending on the property of its argument(s).
Bound and free variables
• The quantifiers are said to bind the variable x in the expressions ∀xP(x) and ∃xP(x). Variables in the scope of some quantifier are called bound variables. All other variables in the expression are called free variables.
• A propositional function that does not contain any free variables is a proposition and has a truth value.
Logical equivalences for quantifiers
Statements involving predicates and quantifiers are logically equivalent if and only if they have the same truth value no matter which predicates are substituted into these statements and which domain of discourse is used for the variables in these propositional functions. We use the notation S ≡ T to indicate that two statements S and T involving predicates and quantifiers are logically equivalent.
Example where ∀x.∃y.P(x,y) (¬≡) ∃y.∀x.P(x,y)
The meaning of the different possible quantifications involving two variables.
Propositional calculus (PC)
Propositional Logic, or the Propositional Calculus, is a formal logic for reasoning about propositions, that is, atomic declarations that have truth values.
Derivation in classical logic
Classical propositional logic is a kind of propostional logic in which the only truth values are true and false and the four operators not, and, or, and if-then, are all truth functional. Therefore, by conversing the previous sentence we get, that propositional calculus uses more than four logical operators.
Semantics of predicate calculus
Validity and satisfiability of predicate statements
Validity
An assertion in predicate calculus is logically valid (or simply valid) if it is true in every interpretation, that is if and only if it is true :
- for all domains
- for every propositional functions substituted for the predicates in the assertion
Valid assertions in predicate logic play a role similar to tautologies in propositional logic.
Example:
∀x.(P(x)v¬P(x))
Satisfiability
An assertion in predicate calculus is satisfiable iff it is true:
- for some domain
- for some propositional functions that can be substituted for the predicates in the assertion
Valid assertions in predicate logic play a role similar to tautologies in propositional logic. Example: link
Sequent predicate calculus LK
A way of deducing if a logic statement is true or not. Please see yourself to the interactive tutorial of the Sequent Calculus (LK).
Proof techniques
A theorem is a statement that can be shown to be true. Theorem is true with a sequence of statements that form an argument, called a proof. To construct proofs, methods are needed to derive new statements from old ones. Rules of interference are the means used to draw conclusions from other assertions, tie together the steps of a proof.