Presentation is loading. Please wait.

Presentation is loading. Please wait.

Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.

Similar presentations


Presentation on theme: "Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements."— Presentation transcript:

1 Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements to demonstrate the truth of an assertion premises are assumed to be true conclusion, the last statement of the sequence, is taken to be true based on the truth of the others statements. An argument is valid if the conclusion follows logically from the truth of the premises. Logic is the foundation for expressing formal proofs in all branches of mathematics.

2 Propositional Logic A proposition is
Propositional Logic is the logic of compound statements built from simpler statements using Logical Boolean connectives. The truth value of a proposition is true, denoted by T, if it is true, and false, denoted by F it is false A proposition is a declarative sentence that is either TRUE or FALSE (not both).

3 Logical Operators Exclusive Or – XOR Implication
Compound propositions : built up from simpler propositions using logical operators Negation -- NOT Conjunction -- AND Disjunction –- OR Exclusive Or – XOR Implication

4 Implication Some terminology, for an implication p  q t
Its converse is: q  p. Its inverse is: ¬ p  ¬ q. Its contrapositive is: ¬q  ¬ p t

5 Biconditional Biconditional operator ():
Partly similar to the English usage of “If and only if. The biconditional p  q is true when q and p have the same truth values and false otherwise.

6 Operator Precedence By convention… Logical Operator Precedence  1  2
3 4 5

7 Logic and Bit Operations
A bit is a binary digit: 0 or 1. Bits are usually used to represent truth values. By convention: represents “false”; 1 represents “true”. Bit operations correspond to logical operators, replacing false by 0 and true by 1 A Bit String is an ordered sequence of bits.

8 Propositional Equivalences
A tautology is a proposition that is always true. Ex.: p  Ø p A contradiction is a proposition that is always false. Ex.: p  Ø p A contingency is a proposition that is neither a tautology nor a contradiction. Ex.: p  ¬p F T p  Ø p Ø p p F T p  Ø p Ø p p F T p  Ø p Ø p p

9 Logical Equivalence If p and q are propositions, then p is logically equivalent to q if their truth tables are the same. “p is equivalent to q.” is denoted by p  q p, q are logically equivalent if their biconditional p  q is a tautology.

10 Logical Equivalences p  T  p Identity p  F  p Domination p  T  T
p  F  F Idempotent p  p  p p  p  p Double negation (p)  p

11 Logical Equivalences Commutative: p  q  q  p p  q  q  p
Associative: (p  q )  r  p  ( q  r ) (p  q )  r  p  ( q  r )

12 Logical Equivalences p  (q  r )  (p  q )  (p  r )
Distributive: p  (q  r )  (p  q )  (p  r ) p  (q  r )  (p  q )  (p  r ) De Morgan’s: (p  q )  p  q (De Morgan’s I) (p  q )  p  q (De Morgan’s II)

13 DeMorgan’s Identities
DeMorgan’s can be extended for simplification of negations of complex expressions Conjunctional negation: (p1  p2  …  pn)  (p1  p2  …  pn) Disjunctional negation: (p1p2…pn)  (p1p2…pn)

14 Logical Equivalences p  p  T p  (p  q )  p p  (p  q )  p
Absorption: p  (p  q )  p p  (p  q )  p Negation: p  p  F p  p  T A useful LE involving : p  q  p  q

15 Fallacies  It is Sunday afternoon
Mistakes in proof by applying contingencies instead of tautologies are fallacies. Affirming the conclusion (Common Mistake) If it is Sunday afternoon, then I go to the movies I go to the movies  It is Sunday afternoon It’s Saturday Night!!

16 Fallacies  The animal is not a bird Denying the hypothesis
If an animal flies then the animal is a bird The animal does not fly  The animal is not a bird It’s a penguin!!

17 Predicate Logic A predicate P, or propositional function, is a function that maps objects in the universe of discourse to propositions Predicates can be quantified using the universal quantifier (“for all”)  or the existential quantifier (“there exists”)  Quantified predicates can be negated as follows x P(x)  x P(x) x P(x)  x P(x) Quantified variables are called “bound” Variables that are not quantified are called “free”

18 Inference Rules for Quantified Statements
Universal Instantiation (for an arbitrary object c from UoD) x P(x)  P(c) Universal Generalization (for any arbitrary element c from UoD) P(c)___  x P(x) x P(x)  P(c) Existential Instantiation (for some specific object c from UoD) P(c)__  x P(x) Existential Generalization (for some object c from UoD)

19 Proofs A theorem is a statement that can be proved to be true.
A proof is a sequence of statements that form an argument.

20 Vacuous & Trivial Proofs
p  q is  vacuously true  if p is false In this case, p  q is a vacuous proof p  q   is trivially true if q is true In this case, we have a trivial proof

21 Proofs Indirect Proof: To prove p  q, we prove its contrapositive,  q   p Indirect Proof: To prove p, we assume  p and derive a contradiction. Based on the tautology (  p  F )  p “if the negation of p implies a contradiction then p must be true” (aka: Reductio ad Absurdum)

22 More Proofs Equivalence: To prove p  q, we prove p  q and q  p
Cases: To prove p1 v p2 v … v pn  q, we prove (p1  q)  (p2  q)  …  (pn  q) Quantifiers: x P(x) : provide a proof, or counterexample. x P(x): Existence Constructive Proof: Find an a in the UoD such that P(a) holds. Existence Non-Constructive Proof: Prove that x P(x) is true without finding an a in the UoD such that P(a) holds

23 Sets A set is an unordered collection of objects.
The empty set, or the set containing no elements.  = {} Note:   {} Singleton is a set S that contains exactly one element Universal Set is the set containing all the objects under consideration. { x | P (x) }: x such that P(x) where x belongs to a universal set U x  S means “x is an element of set S.” x  S means “x is not an element of set S

24 Sets Subset: A  B means “A is a subset of B” x ((x  A)  (x  B))
A subset A of B is said to be a proper subset if A is not equal to B. Denoted A  B. x ((x  A)  (x  B))  x ((x  B)  (x  A)) A = B iff, x ((x  A)  (x  B)). The cardinality of a set is the number of distinct elements in the set. |S | denotes the cardinality of S. A set S is said to be finite if its cardinality is a nonnegative integer. Otherwise, S is said to be infinite.

25 Sets The power set of S is the set of all subsets of S.
P(S) = { x | x  S } Fact: if S is finite, |P(S)| = 2|S|.

26 n-Tuples An ordered n-tuple, n  Z+, is an ordered list
(a1, a2, …, an). Order and length matters: (1, 2)  (2, 1)  (2, 1, 1).

27 Operators The Cartesian Product of two sets A and B is:
A x B = { (a, b) | a  A  b  B} The union of two sets A and B is: A  B = { x | x  A v x  B } |AB| = |A| + |B| - |A  B| The intersection of two sets A and B is: A  B = { x | x  A  x  B} The complement of a set A is: A = { x | x  A} The set difference, A - B, is: A - B = { x | x  A  x  B }

28 Symmetric Difference The symmetric difference, A  B, is:
A  B = { x | (x  A  x  B) v (x  B  x  A)} (i.e., x is in one or the other, but not in both)

29 Set Identities Identity: A   = A , A  U = A Domination:
A  U = U , A   =  Idempotent: A  A = A = A  A Double complement: Commutative: A  B = B  A , A  B = B  A Associative: A  (B  C) = (A  B)  C , A  (B  C) = (A  B)  C A = ) (

30 Set Identities Absorption: A  (A  B) = A A  (A  B) = A Complement:
A  A¯ = U , A  A¯ =  Distributive: A  (B  C) = (A  B)  (A  C) , A  (B  C) = (A  B)  (A  C)

31 De Morgan’s Rules De Morgan’s I DeMorgan’s II (A U B) = A  B
(A  B) = A U B

32 Proving Set Identities
How would we prove set identities of the form S1 = S2 where the S1 and S2 are sets? Prove S1  S2 and S2  S1 separately. Use previously proven set identities. Use logical equivalences to prove equivalent set definitions. Use a membership table. 1 : means x is in the Set 0 : means x is not in the Set

33 Sets as Bit-Strings For a finite universal set U = {a1, a2, …,an}
Assign an arbitrary order to the elements of U. Represent a subset A of U as a string of n bits, B = b1b2…bn Example: U = {a1, a2, …, a5}, A = {a1, a3, a4 } B = 10110


Download ppt "Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements."

Similar presentations


Ads by Google