Upcoming SlideShare
×

# discreet mathematics

920 views

Published on

mathematical logics

Published in: Education
3 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
920
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
58
0
Likes
3
Embeds 0
No embeds

No notes for slide

### discreet mathematics

1. 1.  Logic!Introduction to Mathematical Logic: MATH-105 Jan-May 2013 1
2. 2. • Crucial for mathematical reasoning• Important for program design• Used for designing electronic circuitry• (Propositional )Logic is a system based on propositions.• A proposition or statement is a (declarative) sentence that is either true or false (not both).• We say that the truth value of a proposition is either true (T) or false (F).• Corresponds to 1 and 0 in digital circuits Introduction to Mathematical Logic: MATH-105 Jan-May 2013 2
3. 3.  “Elephants are bigger than mice.”Is this a sentence? yesIs this a proposition? yesWhat is the truth valueof the proposition? true Introduction to Mathematical Logic: MATH-105 Jan-May 2013 3
4. 4.  “520 < 111”Is this a sentence? yesIs this a proposition? yesWhat is the truth valueof the proposition? false Introduction to Mathematical Logic: MATH-105 Jan-May 2013 4
5. 5.  “y > 5”Is this a sentence? yesIs this a proposition? noIts truth value depends on the value of y,but this value is not specified.We call this type of sentence apropositional function or open sentence. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 5
6. 6.  “Today is January 27 and 99 < 5.”Is this a sentence? yesIs this a proposition? yesWhat is the truth valueof the proposition? false Introduction to Mathematical Logic: MATH-105 Jan-May 2013 6
7. 7.  “Please do not fall asleep.”Is this a sentence? yesIt’s a request.Is this a proposition? no Introduction to Mathematical Logic: MATH-105 Jan-May 2013 7
8. 8.  “If the moon is made of cheese, then I will be rich.”Is this a sentence? yesIs this a proposition? yesWhat is the truth valueof the proposition? probably true Introduction to Mathematical Logic: MATH-105 Jan-May 2013 8
9. 9. “x < y if and only if y > x.”Is this a sentence? yesIs this a proposition? yes… because its truth value does not depend on specific values of x and y.What is the truth valueof the proposition? true Introduction to Mathematical Logic: MATH-105 Jan-May 2013 9
10. 10. Aswe have seen in the previousexamples, one or more propositions canbe combined to form a single compoundproposition.We formalize this by denotingpropositions with letters such as p, q, r, s,and introducing several logical operatorsor logical connectives. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 10
11. 11. We will examine the following logicaloperators:• Negation (NOT, ¬ )• Conjunction (AND, ∧ )• Disjunction (OR, ∨ )• Exclusive-or (XOR, ⊕ )• Implication (if – then, → )• Biconditional (if and only if, ↔ )Truth tables can be used to show how theseoperators can combine propositions tocompound propositions. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 11
12. 12.  Unary Operator, Symbol: ¬ P  P true (T) false (F) false (F) true (T) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 12
13. 13.  Binary Operator, Symbol: ∧ P Q P Q T T T T F F F T F F F F Introduction to Mathematical Logic: MATH-105 Jan-May 2013 13
14. 14.  Binary Operator, Symbol: ∨ P Q P Q T T T T F T F T T F F F Introduction to Mathematical Logic: MATH-105 Jan-May 2013 14
15. 15.  Binary Operator, Symbol: ⊕ P Q PQ T T F T F T F T T F F F Introduction to Mathematical Logic: MATH-105 Jan-May 2013 15
16. 16.  Binary Operator, Symbol: → P Q PQ T T T T F F F T T F F T Introduction to Mathematical Logic: MATH-105 Jan-May 2013 16
17. 17.  Binary Operator, Symbol: ↔ P Q PQ T T T T F F F T F F F T Introduction to Mathematical Logic: MATH-105 Jan-May 2013 17
18. 18.  Statements and operators can be combined in any way to form new statements. P Q P Q (P)(Q) T T F F F T F F T T F T T F T F F T T T Introduction to Mathematical Logic: MATH-105 Jan-May 2013 18
19. 19.  Statements and operators can be combined in any way to form new statements. P Q PQ (PQ) (P)(Q) T T T F F T F F T T F T F T T F F F T T Introduction to Mathematical Logic: MATH-105 Jan-May 2013 19
20. 20. • Totake discrete mathematics, you must have taken calculus or a course in computer science.• When you buy a new car from Acme Motor Company, you get \$2000 back in cash or a 2% car loan.• School is closed if more than 2 feet of snow falls or if the wind chill is below -100. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 20
21. 21. • To take discrete mathematics, you must have taken calculus or a course in computer science. › P: take discrete mathematics › Q: take calculus › R: take a course in computer science•P →Q∨R• Problem with proposition R Introduction to Mathematical Logic: MATH-105 Jan-May 2013 21
22. 22. • When you buy a new car from Acme Motor Company, you get \$2000 back in cash or a 2% car loan. › P: buy a car from Acme Motor Company › Q: get \$2000 cash back › R: get a 2% car loan•P →Q⊕R• Why use XOR here? – example of ambiguity of natural languages Introduction to Mathematical Logic: MATH-105 Jan-May 2013 22
23. 23. • School is closed if more than 2 feet of snow falls or if the wind chill is below -100. › P: School is closed › Q: 2 feet of snow falls › R: wind chill is below -100•Q ∧R→P• Precedence among operators: ¬, ∧, ∨, →, ↔ Introduction to Mathematical Logic: MATH-105 Jan-May 2013 23
24. 24. P Q (PQ) (P)(Q) (PQ)(P)(Q) T T F F T T F T T T F T T T T F F T T T The statements ¬(P∧Q) and (¬P) ∨ (¬Q) are logically equivalent, since they have the same truth table, or put it in another way, ¬(P∧Q) ↔(¬P) ∨ (¬Q) is always true. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 24
25. 25.  A tautology is a statement that is always true. Examples: › R∨(¬R) › ¬(P∧Q) ↔ (¬P)∨(¬ Q) A contradiction is a statement that is always false. Examples: › R∧(¬R) › ¬(¬(P ∧ Q) ↔ (¬P) ∨ (¬Q)) The negation of any tautology is a contradiction, and the negation of any contradiction is a tautology. If A has the truth value, T for at least one combination of truth values of P1, P2 , P3 ,…, Pn then A is said to be satisfiable. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 25
26. 26.  Definition: two propositional statements S1 and S2 are said to be (logically) equivalent, denoted S1 ≡ S2 if › They have the same truth table, or › S1 ⇔ S2 is a tautology Equivalence can be established by › Constructing truth tables › Using equivalence laws Introduction to Mathematical Logic: MATH-105 Jan-May 2013 26
27. 27.  Equivalence laws › Identity laws, P ∧ T ≡ P, › Domination laws, P ∧ F ≡ F, › Idempotent laws, P ∧ P ≡ P, › Double negation law, ¬ (¬ P) ≡ P › Commutative laws, P ∧ Q ≡ Q ∧ P, › Associative laws, P ∧ (Q ∧ R)≡ (P ∧ Q) ∧ R, › Distributive laws, P ∧ (Q ∨ R)≡ (P ∧ Q) ∨ (P ∧ R), › De Morgan’s laws, ¬ (P∧Q) ≡ (¬ P) ∨ (¬ Q) › Law with implication P → Q ≡ ¬ P ∨ Q Introduction to Mathematical Logic: MATH-105 Jan-May 2013 27
28. 28. • Show that P → Q ≡ ¬ P ∨ Q: by truth table• Showthat (P → Q) ∧ (P → R) ≡ P → (Q ∧ R): by equivalence laws: › Law with implication on both sides › Distribution law on LHS Introduction to Mathematical Logic: MATH-105 Jan-May 2013 28
29. 29. •Proposition › Statement, Truth value, › Proposition, Propositional symbol, Open proposition•Operators › Define by truth tables › Composite propositions › Tautology and contradiction•Equivalence of propositional statements › Definition › Proving equivalence (by truth table or equivalence laws) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 29
30. 30. Propositionalfunction (open sentence):statement involving one or more variables, e.g.: x-3 > 5.Let us call this propositional function P(x),where P is the predicate and x is the variable.What is the truth value of P(2) ? falseWhat is the truth value of P(8) ? falseWhat is the truth value of P(9) ? trueWhen a variable is given a value, it is said to beinstantiatedTruth value depends on value of variable Introduction to Mathematical Logic: MATH-105 Jan-May 2013 30
31. 31. Letus consider the propositional functionQ(x, y, z) defined as:x + y = z.Here,Q is the predicate and x, y, and z arethe variables.What is the truth value of Q(2, 3, 5) ? trueWhat is the truth value of Q(0, 1, 2) ? falseWhat is the truth value of Q(9, -9, 0) ? trueA propositional function (predicate) becomes aproposition when all its variables are instantiated. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 31
32. 32. Other examples of propositional functionsPerson(x), Person(Socrates) = T x is a person which is true if Person(dog) = FCSCourse(x), which is true if x is a computer science course CS Course(C-language) = T CS Course(MATH 102) = F Introduction to Mathematical Logic: MATH-105 Jan-May 2013 32
33. 33. LetP(x) be a predicate (propositionalfunction).Universally quantified sentence:For all x in the universe of discourse P(x) is true.Using the universal quantifier ∀:∀x P(x) “for all x P(x)” or “for every x P(x)”(Note:∀x P(x) is either true or false, so it is aproposition, not a propositional function.) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 33
34. 34. Example: Let the universe of discourse be all people S(x): x is a Mathematics student. G(x): x is a genius.What does ∀x (S(x) → G(x)) mean ?“If x is a mathematics student, then x is a genius.” or“All Mathematics students are geniuses.”Ifthe universe of discourse is all mathematicsstudents, then the same statement can be written as ∀x G(x) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 34
35. 35. Existentiallyquantified sentence:There exists an x in the universe of discourse forwhich P(x) is true.Using the existential quantifier ∃:∃x P(x) “There is an x such that P(x).” “There is at least one x such that P(x).”(Note:∃x P(x) is either true or false, so it is aproposition, but no propositional function.) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 35
36. 36. Example:P(x):x is a Mathematics professor.G(x): x is a genius.What does ∃x (P(x) ∧ G(x)) mean ?“There is an x such that x is a Mathematicsprofessor and x is a genius.” or“At least one Mathematics professor is a genius.” Introduction to Mathematical Logic: MATH-105 Jan-May 2013 36
37. 37. Another example:Let the universe of discourse be the realnumbers.What does ∀x∃y (x + y = 320) mean ?“For every x there exists a y so that x + y = 320.”Is it true? yesIs it true for the natural numbers? no Introduction to Mathematical Logic: MATH-105 Jan-May 2013 37
38. 38. A counterexample to ∀x P(x) is an object c sothat P(c) is false.Statementssuch as ∀x (P(x) → Q(x)) can bedisproved by simply providing acounterexample.Statement: “All birds can fly.”Disproved by counterexample: Penguin. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 38
39. 39.  ¬(∀x P(x)) is logically equivalent to ∃x (¬P(x)). ¬(∃x P(x)) is logically equivalent to ∀x (¬P(x)). This is de Morgan’s law for quantifiers Introduction to Mathematical Logic: MATH-105 Jan-May 2013 39
40. 40.  Examples Not all roses are red ¬∀x (Rose(x) → Red(x)) ∃x (Rose(x) ∧ ¬Red(x))Nobody is perfect x (Person(x)  Perfect(x)) x (Person(x)  Perfect(x)) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 40
41. 41.  A predicate can have more than one variables. › S(x, y, z): z is the sum of x and y › F(x, y): x and y are friends We can quantify individual variables in different ways › ∀x, y, z (S(x, y, z) → (x <= z ∧ y <= z)) › ∃x ∀y ∀z (F(x, y) ∧ F(x, z) ∧ (y != z) → ¬F(y, z) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 41
42. 42.  Exercise: translate the following English sentence into logical expression “There is a rational number in between every pair of distinct rational numbers” Use predicate Q(x), which is true when x is a rational number ∀x,y (Q(x) ∧ Q (y) ∧ (x < y) → ∃u (Q(u) ∧ (x < u) ∧ (u < y))) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 42
43. 43. • Propositional functions (predicates)• Universal and existential quantifiers, and the duality of the two• When predicates become propositions › All of its variables are instantiated › All of its variables are quantified• Nested quantifiers › Quantifiers with negation• Logical expressions formed by predicates, operators, and quantifiers Introduction to Mathematical Logic: MATH-105 Jan-May 2013 43
44. 44. Mathematical ReasoningIntroduction to Mathematical Logic: MATH-105 Jan-May 2013 44
45. 45. We need mathematical reasoning to determinewhether a mathematical argument is correct orincorrect and construct mathematicalarguments. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 45
46. 46. Argument: An argument is an assertion; that agroup of propositions called premises, yields another proposition, called the conclusion.Let P1, P2 , P3 ,…, Pn is the group of propositions thatyields the conclusion Q. Then, it is denoted as P1, P2 ,P3 ,…, Pn |- Q Valid Argument: An argument is called validargument if the conclusion is true whenever all thepremises are true orThe argument is valid iff the ANDing of the group ofpropositions implies conclusion is a tautologyie: P(P1, P2 , P3 ,…, Pn ) Q is a tautology 46 Introduction to Mathematical Logic: MATH-105 Jan-May 2013
47. 47. Fallacy Argument: An argument is calledfallacy or an invalid argument if it is not a validargument. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 47
48. 48.  Translate the following into symbolic form andtest the validity of the argument:1.“If I will select in IAS examination, then I will notbe able to go to London. Since, I am going toLondon, I will not select in IAS examination”.2. “If 6 is even then 2 does not divide 7. Either 5 isnot prime or 2 divides 7. But 5 is prime, therefore,6 is not even”. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 48
49. 49. Ans-1:p: I will select in IAS examinationq: I will go to LondonPremises: 1. p ~q 2. qConclusion: ~pVerify: [(p ~q) ∧(q)] ~p is a tautology Introduction to Mathematical Logic: MATH-105 Jan-May 2013 49
50. 50.  Ans-2:p: 6 is evenq: 2 divides 7r: 5 is primePremises: 1. p ~q 2. ~r ∨ q 3. rConclusion: ~pVerify: [ (1) ∧ (2) ∧ (3) ] ~p is a tautology Introduction to Mathematical Logic: MATH-105 Jan-May 2013 50
51. 51.  The problem of finding whether a given statement is tautology or contradiction or satisfiable in a finite number of steps, is called as decision problem, the construction of truth tables may not be often a practical solution. We therefore consider alternate procedure known as reduction to normal forms. The two such forms are: Disjunctive Normal Form (DNF) Conjunctive Normal Form (CNF) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 51
52. 52.  A compound statement is said to be in dnf if it is disjunction of conjunction of the variables or their negations. Ex:(p ∧ q ∧ r) ∨ (~p ∧q ∧r) ∨ (~p ∧~q ∧ r) A compound statement is said to be in cnf if it is conjunction of disjunction of the variables or their negations. Ex:(p ∨ q ∨ ~r) ∧ (p ∨ ~q ∨ r) ∧ (~p ∨ ~q ∨ r) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 52
53. 53.  The truth table for the given statement is: P Q P Q Q P (P Q)  (Q P) T T T T T T F F T F F T T F F F F F T T Introduction to Mathematical Logic: MATH-105 Jan-May 2013 53
54. 54.  DNF: DNF: (P ∧ Q) ∨ (~P ∧ ~Q) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 54
55. 55.  CNF: CNF: ~(P ∧ ~Q) ∧ ~(~P ∧ Q) ≡ (~P ∨ Q) ∧ (P ∨ ~Q) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 55
56. 56. • Mathematical Reasoning• Terminology (argument, valid argument and fallacy argument)• Examples on valid arguments• Normal forms (DNF and CNF)• Truth table method to express the statements as dnf and cnf forms Introduction to Mathematical Logic: MATH-105 Jan-May 2013 56