MIT School of Computing Department of Computer Science & Engineering Department of Computer Science & Engineering 21BTAS305 -Discrete Mathematics PLD Applicable for Class - S.Y(1-18) (SEM-I) AY 2023-2024 SEM-I Designed By Team : Discrete Mathematics MIT School of Computing Department of Computer Science & Engineering Course Outcomes: • 1. Ability to apply set theory and logic for problem solving and inferencing. • 2. Ability to solve problems using Permutations, combinations, probabilities, relations and functions. • PLD 3. Ability to apply the concepts of graphs and trees for problem solving. DesignedBy ByTeam Team :: Discrete Mathematics Designed Discrete Mathematics MIT School of Computing Department of Computer Science & Engineering 1. SETS AND PROPOSITIONS Sets, Combination of sets, Finite and Infinite sets, Uncountable infinite sets, Principle of inclusion and exclusion, multi-sets, Mathematical Induction. Propositions, Conditional Propositions, Logical Connectivity, Propositional calculus, Universal and Existential Quantifiers, Normal forms, Rules of inference, Predicate calculus, methods of proofs. 2. PERMUTATIONS, COMBINATIONS ANDPLD DISCRETE PROBABILITY Permutations and Combinations: rule of sum and product, Permutations, Combinations, Algorithms for generation of Permutations and Combinations, binomial theorem, Discrete Probability, Conditional Probability, Bayes’ Theorem, Information and Mutual Information. DesignedBy ByTeam Team :: Discrete Mathematics Designed Discrete Mathematics COURSE CONTENTS 3. RELATIONS AND FUNCTIONS A relational model for data bases, Properties of Binary Relations, Closure of relations, Warshall’s algorithm, Equivalence relations and partitions, Partial ordering relations and lattices, Chains and Anti chains, Compatible relations. Functions, Composition of functions, Invertible functions, Pigeonhole Principle, Recursive function. 4. GRAPH THEORY Basic terminology, multi-graphs and weighted graphs, representation of graphs, Subgraphs, Isomorphic graphs, Complete, regular and bipartite graphs, operations on graph, paths and circuits, graph traversals, Hamiltonian and Euler paths and circuits, shortest path in weighted graphs (Dijkstra’s algorithm), factors of a graph, planer graph and Traveling salesman problem, Graph Coloring. Designed By Team : Discrete Mathematics COURSE CONTENTS 5. TREES AND CUT SETS • Basic terminology and characterization of trees, rooted path lengths in rooted trees, Prefix codes and optimal codes, binary search trees, Tree traversal, Spanning Fundamental Trees and cut sets, Minimal Spanning Kruskal’s and Prim’s algorithms for minimal spanning The Max flow-Min Cut Theorem (Transport network). • Note: A student group should make one Mathematical Model and submit it as a part of Tutorial. Designed By Team : Discrete Mathematics trees, prefix trees, trees, trees, Unit 1: SETS AND PROPOSITIONS Sets, Combination of sets, Finite and Infinite sets, Uncountable infinite sets, Principle of inclusion and exclusion, multi-sets, Mathematical Induction. Propositions, Conditional Propositions, Logical Connectivity, Propositional calculus, Universal and Existential Quantifiers, Normal forms, Rules of inference, Predicate calculus, methods of proofs. Designed By Team : Discrete Mathematics Introduction to Set Theory • • • A set is a structure, representing an unordered collection (group, plurality) of zero or more distinct (different) objects. Well / proper defined collection of objects. Set theory deals with operations between, relations among, and statements about sets. Designed By Team : Discrete Mathematics Basic notations for sets • • • For set names, we’ll use capital letters. For set elements / objects, we’ll use small letters. We can denote a set S in writing by listing all of its elements in curly braces: • • {a, b, c} is the set of whatever 3 objects are denoted by a, b, c. Set builder notation: For any proposition P(x) over any universe of discourse, {x |P(x)} is the set of all x such that P(x). e.g., {x | x is an integer where x>0 and x<5 } Designed By Team : Discrete Mathematics Basic properties of sets • Sets are inherently unordered: • • No matter what objects a, b, and c denote, {a, b, c} = {a, c, b} = {b, a, c} = {b, c, a} = {c, a, b} = {c, b, a}. All elements are distinct (unequal); multiple listings make no difference! • • {a, b, c} = {a, a, b, a, b, c, c, c, c}. This set contains at most 3 elements! Designed By Team : Discrete Mathematics Definition of Set Equality • • • Two sets are declared to be equal if and only if they contain exactly the same elements. In particular, it does not matter how the set is defined or denoted. For example: The set {1, 2, 3, 4} = {x | x is an integer where x>0 and x<5 } = {x | x is a positive integer whose square is >0 and <25} Designed By Team : Discrete Mathematics Infinite Sets • • • Conceptually, sets may be infinite (i.e., not finite, without end, unending). Symbols for some special infinite sets: N = {0, 1, 2, …} The natural numbers. Z = {…, -2, -1, 0, 1, 2, …} The integers. R = The “real” numbers, such as 374.1828471929498181917281943125… Infinite sets come in different sizes! Designed By Team : Discrete Mathematics Some Predefined Set • N = { 0, 1, 2, 3, … } is the set of natural numbers. • Z = { …, -2, -1, 0, 1, 2, … } is the set of integers. • Z+ = { 1, 2, 3, … } is the set of positive integers. • Q = { p/q | p, q Z and q 0 } is the set of Rationals. • R = the set of real numbers. Designed By Team : Discrete Mathematics Basic Set Relations: Member of • xS (“x is in S”) is the proposition that object x is an lement or member of set S. • • • e.g. 3N, “a”{x | x is a letter of the alphabet} Can define set equality in terms of relation: S,T: S=T (x: xS xT) “Two sets are equal iff they have all the same members.” xS : (xS) “x is not in S” Designed By Team : Discrete Mathematics The Empty Set • • • (“null”, “the empty set”) is the unique set that contains no elements whatsoever. = {} = {x|False} No matter the domain of discourse, we have the axiom x: x. Designed By Team : Discrete Mathematics Subset and Superset Relations ST (“S is a subset of T”) means that every element of S is also an element of T. • ST x (xS xT) • S, SS. • ST (“S is a superset of T”) means TS. • Note S=T ST ST. • S / T means (ST), i.e. x(xS xT) • Designed By Team : Discrete Mathematics Proper (Strict) Subsets & Supersets • ST (“S is a proper subset of T”) means that ST but Similar for ST. T / S Example: {1,2} {1,2,3} S T Venn Diagram equivalent of ST Designed By Team : Discrete Mathematics Sets Are Objects, Too! • • • The objects that are elements of a set may themselves be sets. E.g. let S={x | x {1,2,3}} then S={, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}} Note that 1 {1} {{1}} !!!! Designed By Team : Discrete Mathematics Cardinality and Finiteness • • • • |S| (read “the cardinality of S”) is a measure of how many different elements S has. E.g., ||=0, |{1,2,3}| = 3, |{a,b}| = 2, |{{1,2,3},{4,5}}| = ____ We say S is infinite if it is not finite. What are some infinite sets we’ve seen? Designed By Team : Discrete Mathematics The Power Set Operation • • • • The power set P(S) of a set S is the set of all subsets of S. P(S) = {x | xS}. E.g. P({a,b}) = {, {a}, {b}, {a,b}}. Sometimes P(S) is written 2S. Note that for finite S, |P(S)| = 2|S|. It turns out that |P(N)| > |N|. There are different sizes of infinite sets! Designed By Team : Discrete Mathematics Ordered n-tuples • • • • For nN, an ordered n-tuple or a sequence of length n is written (a1, a2, …, an). The first element is a1, etc. These are like sets, except that duplicates matter, and the order makes a difference. Note (1, 2) (2, 1) (2, 1, 1). Empty sequence, singlets, pairs, triples, quadruples, quintuples, …, n-tuples. Designed By Team : Discrete Mathematics Cartesian Products of Sets • • • • • For sets A, B, their Cartesian product AB : {(a, b) | aA bB }. E.g. {a,b}{1,2} = {(a,1),(a,2),(b,1),(b,2)} Note that for finite A, B, |AB|=|A||B|. Note that the Cartesian product is not commutative: AB: AB =BA. Extends to A1 A2 … An... Designed By Team : Discrete Mathematics The Union Operator • • • For sets A, B, their union AB is the set containing all elements that are either in A, or (“”) in B (or, of course, in both). Formally, A,B: AB = {x | xA xB}. Note that AB contains all the elements of A and it contains all the elements of B: A, B: (AB A) (AB B) Designed By Team : Discrete Mathematics Union Examples • • {a,b,c}{2,3} = {a,b,c,2,3} {2,3,5}{3,5,7} = {2,3,5,3,5,7} ={2,3,5,7} Designed By Team : Discrete Mathematics The Intersection Operator • • • For sets A, B, their intersection AB is the set containing all elements that are simultaneously in A and (“”) in B. Formally, A,B: AB{x | xA xB}. Note that AB is a subset of A and it is a subset of B: A, B: (AB A) (AB B) Designed By Team : Discrete Mathematics Intersection Examples • • {a,b,c}{2,3} = ___ {4} {2,4,6}{3,4,5} = ______ Designed By Team : Discrete Mathematics Disjointedness • • Two sets A, B are called disjoint (i.e., unjoined) iff their intersection is empty. (AB=) Example: the set of even integers is disjoint with the set of odd integers. Designed By Team : Discrete Mathematics Help, I’ve been disjointed! Set Difference • • • For sets A, B, the difference of A and B, written AB, is the set of all elements that are in A but not B. A B : x xA xB x xA xB Also called: The complement of B with respect to A. Designed By Team : Discrete Mathematics Set Difference Examples • • {1,2,3,4,5,6} {2,3,5,7,9,11} = {1,4,6} ___________ Z N {… , -1, 0, 1, 2, … } {0, 1, … } = {x | x is an integer but not a nat. #} = {x | x is a negative integer} = {… , -3, -2, -1} Designed By Team : Discrete Mathematics Set Difference - Venn Diagram • A-B is what’s left after B “takes a bite out of A” Chomp! Set AB Set A Set B Designed By Team : Discrete Mathematics Set Complements • • • The universe of discourse can itself be considered a set, call it U. The complement of A, written A, is the complement of A w.r.t. U, i.e., it is UA. E.g., If U=N, {3,5} {0,1,2,4,6,7,...} Designed By Team : Discrete Mathematics More on Set Complements • An equivalent definition, when U is clear: A {x | x A} A A U Designed By Team : Discrete Mathematics Set Identities • • • • • • Identity: A=A AU=A Domination: AU=U A= Idempotent: AA = A = AA Double complement: ( A ) A Commutative: AB=BA AB=BA Associative: A(BC)=(AB)C A(BC)=(AB)C Designed By Team : Discrete Mathematics DeMorgan’s Law for Sets • Exactly analogous to (and derivable from) DeMorgan’s Law for propositions. A B A B A B A B Designed By Team : Discrete Mathematics Proving Set Identities To prove statements about sets, of the form E1 = E2 (where Es are set expressions), here are three useful techniques: • Prove E1 E2 and E2 E1 separately. • Use logical equivalences. • Use a membership table. Designed By Team : Discrete Mathematics Method 1: Mutual subsets Example: Show A(BC)=(AB)(AC). • Show A(BC)(AB)(AC). • • Assume xA(BC), & show x(AB)(AC). We know that xA, and either xB or xC. • • • • • Case 1: xB. Then xAB, so x(AB)(AC). Case 2: xC. Then xAC , so x(AB)(AC). Therefore, x(AB)(AC). Therefore, A(BC)(AB)(AC). Show (AB)(AC) A(BC). … Designed By Team : Discrete Mathematics Method 2: Membership Tables • • • • • Just like truth tables for propositional logic. Columns for different set expressions. Rows for all combinations of memberships in constituent sets. Use “1” to indicate membership in the derived set, “0” for non-membership. Prove equivalence with identical columns. Designed By Team : Discrete Mathematics Membership Table Example Prove (AB)B = AB. A 0 0 1 1 B AB (AB)B AB 0 0 0 0 1 1 0 0 0 1 1 1 1 1 0 0 Designed By Team : Discrete Mathematics Membership Table Exercise Prove (AB)C = (AC)(BC). A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C A B ( AB ) C A C 0 1 0 1 0 1 0 1 B C Designed By Team : Discrete Mathematics (AC)(BC) Inclusion-Exclusion Principle • How many elements are in AB? |AB| = |A| |B| |AB| • |AB C | = |A| |B| |C| |AB| |BC| |AC|+ |AB C | Designed By Team : Discrete Mathematics Inclusion-Exclusion Principle • In a town of 10000 families it was found that 40% of families buy newspaper A, 20% family buy newspaper B, 10% family buy newspaper C, 5% family buy newspaper A and B, 3% family buy newspaper B and C and 4% family buy newspaper A and C. If 2% family buy all the newspaper. Find the number of families which buy Designed By Team : Discrete Mathematics 1. 2. 3. 4. 5. 6. Number of families which buy all three newspapers. Number of families which buy newspaper A only Number of families which buy newspaper B only Number of families which buy newspaper C only Number of families which buy exactly only one newspaper Number of families which buy None of A, B, C Designed By Team : Discrete Mathematics Designed By Team : Discrete Mathematics Designed By Team : Discrete Mathematics Designed By Team : Discrete Mathematics Mathematical Induction: • Mathematical Induction is a mathematical technique which is used to prove a statement, a formula or a theorem is true for every natural number. • The technique involves two steps to prove a statement, as stated below − • Step 1(Base step) − It proves that a statement is true for the initial value. • Step 2(Inductive / induction step) − As step 1 is true so put n=k and consider it true, and put n= k+1 in given expression. Designed By Team : Discrete Mathematics Mathematical Induction: • Eg: 1+2+3+…….+n=n(n+1)/2 where n>=1 prove this expression by mathematical induction. • 1+2+22+ ….. + 2n = 2n+1 – 1 prove using mathematical induction principal where n >=0 • 2+4+6 ….. + 2n = n(n+1) prove using mathematical induction principal where n >=1 Designed By Team : Discrete Mathematics Propositions • A statement or expression which is either true or false but not both. Some valid Eg: Invalid Proposition 2+2=5 The earth is flat. X+3=5 Bring the book. There are 7 days in week. When is your interview? Will there be holiday tomorrow? What a beautiful painting. Designed By Team : Discrete Mathematics Propositions True value is denoted by T or 1 False value is denoted by F or 0 Designed By Team : Discrete Mathematics Propositions :Connectives • In propositional logic generally we use five connectives which are − • OR (∨) : Disjunction AND (∧) : Conjunction Negation / NOT (¬) Implication / if-then (→) conditional If and only if (⇔) biconditional. • • • • Designed By Team : Discrete Mathematics Propositions :Connectives • • If and only if (⇔) − A⇔ is bi-conditional logical connective which is true when p and q are same, i.e. both are false or both are true. The truth table is as follows − A B A⇔B True True True True False False False True False False False True Designed By Team : Discrete Mathematics Propositions :Connectives • • OR (∨) − The OR operation of two propositions A and B (written as A∨B) is true if at least any of the propositional variable A or B is true. The truth table is as follows − A B A∨B True True True True False True False True True False False False Designed By Team : Discrete Mathematics Propositions :Connectives • • AND (∧) − The AND operation of two propositions A and B (written as A∧B) is true if both the propositional variable A and B is true. The truth table is as follows − A B A∧B True True True True False False False True False False False False Designed By Team : Discrete Mathematics Propositions :Connectives • • Negation (¬) − The negation of a proposition A (written as ¬A) is false when A is true and is true when A is false. The truth table is as follows − A ¬A True False False True Designed By Team : Discrete Mathematics Propositions :Connectives • • Implication / if-then (→) − An implication A→B is the proposition “if A, then B”. It is false if A is true and B is false. The rest cases are true. The truth table is as follows − A B A→B True True True True False False False True True False False True Designed By Team : Discrete Mathematics Propositions :Connectives • Product: This is nothing but same like biconditional. The product is represented by symbol x. its value is true when both the expressions are equal. A B AxB True True True True False False False True False False False True Designed By Team : Discrete Mathematics A B A⇔B A B A→B True True True True True True True False False True False False False True False False True True False False True False False True A B A∨B A B A∧B True True True True True True True False True True False False False True True False True False False False False False False False Designed By Team : Discrete Mathematics Propositional Decisions A Tautology is a formula which is always true for every value of its propositional variables. A Contradiction is a formula which is always false for every value of its propositional variables. A Contingency is a formula which has both some true and some false values for every value of its propositional variables. Designed By Team : Discrete Mathematics Propositional Decisions Example − Prove [(A→B)∧A]→B is a tautology The truth table is as follows − A B A→B (A → B) ∧ A [( A → B ) ∧ A] → B True True True True True True False False False True False True True False True False False True False True As we can see every value of [(A→B)∧A]→B is "True", it is a Designed By Team : Discrete Mathematics tautology. Propositional Decisions Example − Prove (A∨B)∧[(¬A)∧(¬B)] is a contradiction The truth table is as follows − . A B A∨B ¬A ¬B (¬ A) ∧ ( ¬ B) (A ∨ B) ∧ [( ¬ A) ∧ (¬ B)] True True True False False False False True False True False True False False False True True True False False False False False False True True True False As we can see every value of (A∨B)∧[(¬A)∧(¬B)] is “False”, it is a contradiction Designed By Team : Discrete Mathematics Propositional Decisions Example − Prove (A∨B)∧(¬A) a contingency The truth table is as follows − A B A∨B ¬A (A ∨ B) ∧ (¬ A) True True True False False True False True False False False True True True True False False False True False As we can see every value of (A∨B)∧(¬A) has both “True” and Designed By Team : Discrete Mathematics “False”, it is a contingency. Designed By Team : Discrete Mathematics Designed By Team : Discrete Mathematics Prove following expressions are logically equivalent using truth table. • • • 1. p-> q = ~ p v q 2. p <-> q = (p->q) ∧ (q->p) 3. p-> (q->r) = (p∧~r)->~q Designed By Team : Discrete Mathematics Designed By Team : Discrete Mathematics Designed By Team : Discrete Mathematics Designed By Team : Discrete Mathematics Designed By Team : Discrete Mathematics Designed By Team : Discrete Mathematics Designed By Team : Discrete Mathematics Designed By Team : Discrete Mathematics Normal Forms • • • • One of the major problem of logical expression is that to find whether the given statement is tautology or contradiction using truth table so it can be done by another way to desired result considering expression only in conjunction and disjunction using logical identities is called as Normal forms. Types: DNF (Disjunctive Normal form) CNF (Conjunctive Normal form) Designed By Team : Discrete Mathematics Normal Forms • DNF (Disjunctive Normal form): • • • • • • • Disjunction is placed in between the conjunction. Or (∨) is placed in between the And (∧). Eg (~p ∧ q ) v (p ∧ q) (p ∧ q) v ~p (p ∧ ~q ) v (p ∧ q) v (~p ∧ q) (p ∧ q ∧ r ) v ~r p ->ByqTeam = ~p vq Designed : Discrete Mathematics Normal Forms • CNF (Conjunctive Normal form): • • • • • • Conjunction is placed in between the disjunction. And (∧) is placed in between the Or (v). Eg (p ∧ q) ~p ∧ (p v q) (p v q) ∧ (~p v ~q) p ->ByqTeam = ~p vq Designed : Discrete Mathematics Predicates It is the verbal statement which describes the property of a variable. • • • • • Usually represented by the letter The notation P(x) is used to represent some unspecified property or predicate that x may have. – P(x) = x has 30 days. – P(April) = April has 30 days. Designed By Team : Discrete Mathematics Predicates One or more statements with some common properties, we call that common property as predicate. • Eg: a(x) = x is cleaver. x = Ram is cleaver. Here x is called as place holder, after placing value in place holder we can say that predicate become proposition. • Designed By Team : Discrete Mathematics Predicates • • • • • • Predicates can have n number of placeholders. Eg: (2 place holder) A(x,y) = x is greater than y. x= 7 , y= 5 7 is bigger than 5 (x >y), Q(x,y) Here Q(x , y) shows the relation that x is greater than y. Designed By Team : Discrete Mathematics Predicates • • • • • Eg: (3 place holders) A(x,y,z) = y lies in between x and z . x= 23 , y= 45 , z= 92 45 lies in between 23 and 92. Q(x,y,z) Here Q(x , y , z) shows the relation that y lies in x and z. Designed By Team : Discrete Mathematics Predicates • • • Universe of Discourse: The values which the variables may be assume constitute set called as to make required condition true, is universe of discourse. Eg: p(x,y): x+y=10 , Let universe be set of natural numbers. By putting x=1 we get one place predicate p(1,y):1+y=10. further setting y=9 we obtain the proposition p(1,9) which is true for given condition. Designed By Team : Discrete Mathematics Predicates • Universe of Discourse: set of all values which makes the given predicate true. • Eg: p(x,y): x+y=10 , Let universe bet set of natural numbers. However if we set y=10, x=1 then p(1,10) is false proposition. so here we can say for all x and y the predicate can not be true. • • Designed By Team : Discrete Mathematics The second method of binding the variable in predicate is by quantification of the variables. Designed By Team : Discrete Mathematics Quantifiers • • It consist of special words which deals with quantities such as some , all , few, etc. It tells us about how much certain element is present in given set. It is an operator use to create the proposition from propositional function . Types: Universal Quantifiers (∀ : for all) Existential Quantifiers (∃ : there exist) Designed By Team : Discrete Mathematics Quantifiers Universal Quantifiers (∀ : for all) Existential Quantifiers The statement starts with ∀ is called universal quantifier & statement ∀x f(x) is called universally quantified statement. It consist of statement that begins with some, there exist, at least one, etc. It is denoted by ∃ ∀(x)p(x) for every value of x is true. ∃(x) p(x) for some values of x is true. Designed By Team : Discrete Mathematics Quantifiers • ∀(x) {M(x) -> H(x) ∀(x) {A(x) -> R(x) Designed By Team : Discrete Mathematics Quantifiers • ∃(x){S(x) ∧ I(x)} ∃(x){A(x) ∧ H(x)} Designed By Team : Discrete Mathematics Existential Quantifier • • • Let P(x) be the predicate “x+3=5” Then proposition ∃x p(x) is true if x=2 but ∀x p(x) is false. Possible Combination s of two place holder predicate using quantifiers: • ∃x ∀y p(x,y) • ∀ y ∃x p(x,y) • ∃x ∃y p(x,y) • ∀ x ∀ y p(x,y) Designed By Team : Discrete Mathematics Existential Quantifier • • • • • Let , p(x,y) be the two place predicate, then ∃x ∀y p(x,y) is the proposition : There exist value of x such that for all values of y p(x,y) is true. ∀ y ∃x p(x,y) is the proposition: for each value of y there exist x such that p(x,y) is true. ∃x ∃y p(x,y) is the proposition: There exist value of x & y such that p(x,y) is true. ∀ x ∀ y p(x,y) is the proposition: For all values of x & y, p(x,y) is true. Designed By Team : Discrete Mathematics Negation of Quantified Statement • • • • • • Consider example: All invited guest were present for dinner: ∀x p(x). The negation: All invited guest were not present for dinner. It means that some guest were not present for dinner. ∃x [~p(x)] where, x: x is a guest P(x) : x was present for dinner. ∃x [~p(x)] and ∀x p(x) are equivalent. Designed By Team : Discrete Mathematics Negation of Quantified Statement • • • • Consider example: There is student in class who is not familiar with c programming. ∃x [~p(x)] The negation: All students in class are familiar with c programming. Hence symbolically, ∃x [~p(x)] and ∀x p(x) are logically equivalent. ∃x [~p(x)] and ∀x p(x) are equivalent. Statement Negation ∀x p(x) ∃x [~p(x)] ∃x [~p(x)] ∀x p(x) ∀x [~p(x)] ∃x [p(x)] ∃x [p(x)]Designed By Team : Discrete Mathematics ∀x [~p(x)] Rules of Inference (Deriving Conclusion from evidences) Every Theorem in Mathematics, or any subject for that matter, is supported by underlying proofs. These proofs are nothing but a set of arguments that are conclusive evidence of the validity of the theory. Designed By Team : Discrete Mathematics Rules of Inference (Deriving Conclusion from evidences) • • • • Structure of an argument An argument can be defined as a sequence of statements we call these statements as premises or assumptions. The conclusion is used to indicate the last statement, and premises are used to indicate all the remaining statements. Before the conclusion, the symbol ∴ will be placed. Designed By Team : Discrete Mathematics Rules of Inference Rules of Inference (Deriving Conclusion from evidences) • Structure of an argument First premises Second premises Third premises Fourth premises . . Nth premises ______________ ∴ Conclusion Valid Argument: It can be described as an argument where if all their premises are true, then their conclusions will also be true. Designed By Team : Discrete Mathematics Rules of Inference Rules of Inference (Deriving Conclusion from evidences) Structure of an argument • For example: "If tomorrow is holiday, I will go to mall." "tomorrow is holiday". “therefore, I will go to mall." P: tomorrow is holiday Q: I will go to mall • P→Q P ____________ ∴Q Designed By Team : Discrete Mathematics Rules of Inference Rules of Inference (Deriving Conclusion from evidences) Modus Ponens (Law of Detachment) Suppose there are two premises, P and P → Q. Now, we will derive Q with the help of Modules Ponens like this: P→Q P ____________ ∴Q • Example: • Suppose P → Q = "If we have a bank account, then we can take advantage of this new policy.“ • • P = "We have a bank account." Therefore, Q = "We canDesigned take advantage of this new policy." By Team : Discrete Mathematics Rules of Inference • Modus Tollens ( Law of Contraposition) Suppose there are two premises, P → Q and ¬Q. Now, we will derive ¬P with the help of Modules Tollens like this: P→Q • ¬Q ____________ ∴ ¬P • Example: • Suppose P → Q = "If we have a bank account, then we can take advantage of this new policy." • ¬Q = "We cannot take advantage of this new policy." Designed By Team : Discrete • Therefore, ¬P = "We don't have a Mathematics bank account." Rules of Inference Rules of Inference (Deriving Conclusion from evidences) • • Hypothetical Syllogism Suppose there are two premises, p → q and q → r. Now, we will derive p → r with the help of Hypothetical Syllogism like this: p→q q→r ____________ ∴p→r Example: • Suppose P → Q = "If my fiancé comes to meet me, I will not go to office." • Q → R = "If I will not go to office, I won't require to do office work." • Therefore, P → R = "If my fiancé come to meet me, I won't require to do Designed By Team : Discrete Mathematics office work." Rules of Inference Rules of Inference (Deriving Conclusion from evidences) • • Disjunction Syllogism (Rule of Presentation) Suppose there are two premises ¬P and P ∨ Q. Now, we will derive Q with the help of Disjunction Syllogism like this: ¬P P∨Q ____________ ∴Q • Example: • Suppose P ∨ Q = “I will make a tea or coffee." ¬P = “I will not make a tea." Therefore, Q = “Therefore, I will make a coffee." • • Designed By Team : Discrete Mathematics Rules of Inference Rules of Inference (Deriving Conclusion from evidences) • • Addition Suppose there is a premise P. Now, we will derive P ∨ Q with the help of Addition like this: P ____________ ∴P∨Q Example: • Suppose P be the proposition, "Harry is a hard working employee" is true • Here Q has the proposition, "Harry is a bad employee". • Therefore, "Either Harry is a hard working employee Or Harry is a bad employee". Designed By Team : Discrete Mathematics Rules of Inference Rules of Inference (Deriving Conclusion from evidences) Simplification: •Suppose there is a premise P ∧ Q. Now, we will derive P with the help of Simplification like this: P∧Q __________ ∴P Example: •Suppose P ∧ Q = "Harry is a hard working employee, and he is the best employee in the office". •Therefore, "Harry is a hard working employee". Designed By Team : Discrete Mathematics Rules of Inference Rules of Inference (Deriving Conclusion from evidences) Conjunction •Suppose there are two premises P and Q. Now, we will derive P ∧ Q with the help of conjunction like this: P Q ___________ ∴P∧Q Example: •Suppose P = "Harry is a hard working employee". •Suppose Q = "Harry is the best employee in the office". •Therefore, "Harry is a hard working employee and Harry is the best employee in the office". Designed By Team : Discrete Mathematics Rules of Inference Rules of Inference (Deriving Conclusion from evidences) Resolution •Suppose there are two premises P ∨ Q and ¬P ∨ R. Now, we will derive Q ∨ R with the help of a resolution like this: P∨Q ¬P∨R ____________ ∴Q∨R •Example: •P ∨ Q = "my friend come to meet me, I will not go to office ". •¬ P ∨ R = "my friend did not come to met me, I won't require to do office work". •Therefore, Q ∨ R = "I will not go to office or I won't require to do office work". Designed By Team : Discrete Mathematics Designed By Team : Discrete Mathematics Arya Studies hard, if Arya study hard then he is dull. If Arya is dull he will not get good job. Hence Arya will not get the job. For solving such problems consider any two premise first and add the conclusion of two premise with the third premise. Sol: Let, p: Arya studies hard. q: He is dull. r: He will get the job. 1. P 2. q p→q q→~r p --------------p→q q (MP) ~r (MP) q→~r -----------Statement is valid Designed By Team : Discrete Mathematics ~r Designed By Team : Discrete Mathematics • Find weather the given statements are valid • Eg 1. if my health is good, I will study My health is good. Therefore, I will study 2. If I am 18+ then I can vote. I can’t vote. Therefore, I am 18+. 3. I will work or sleep. I will not work Therefore, I will sleep. 4. If I know English then I can write an essay. If I write essay, I will get grades. Hence, if I know English, I will get grades. Designed By Team : Discrete Mathematics For practice Designed By Team : Discrete Mathematics Determine whether the following argument is valid or not. Eg: if eva wakes up, she can watch sunrise. But eva is slept, she will therefore miss the sunrise. Sol: p: eva wakes up. q: she watch sunrise. The rule of inference is • p→q ~P ------------- hence its INVALID ∴ ~q Designed By Team : Discrete Mathematics Methods of Proof Direct Method of Proof: • Direct method of proof p->q is logical valid which start with assumption that p is true & using this assumption we consider q is true. 1. Get the direct proof that product of two odd integer is odd. Sol: Let, x and y be the odd integers. X=2n+1 & y=2m+1 Since, by putting any value in m and n we get x,y odd. x.y= (2n+1)(2m+1) = 4mn+2n+2m+1 =2(2mn+n+m)+1 ∵ 2mn+n+m = a =2.a + 1___odd integer. Hence, the result follows. • Designed By Team : Discrete Mathematics Methods of Proof Direct Method of Proof: • Direct method of proof p->q is logical valid which start with assumption that p is true & using this assumption we consider q is true. 2. Show that square of even number is even. Sol: Let, x be an even number. x=2n Now, X2 = 4n2 = 2.(2n2) • =2. a ∵ n^2= a ->Hence, Result follows Designed By Team : Discrete Mathematics Methods of Proof Direct Method of Proof: • Direct method of proof p->q is logical valid which start with assumption that p is true & using this assumption we consider q is true. 3. Show that sum of two odd numbers is even. Sol: Let, x & y be the two odd numbers. y=2n+1, y= 2m+1 x+y= 2n+1 +2m+1 = 2n+2m+2 =2(m+n+1) = 2.a ∵ (m+n+1)= a • =Even Number =Hence, Result Follows. Designed By Team : Discrete Mathematics Methods of Proof Indirect method: Method of contrapositive • P->Q = ~Q -> ~P 1. Show that if n2 is odd then n is odd Sol: Let, p:n2is odd, q: n is odd ~p : n2 is even, ~q: n is even n=2x, x ∈ z n2 = 4x2 =2.2.n2 = 2.a } hence, n2 is even It means, ~Q->~P is true, which is logically equivalent with p->q • Designed By Team : Discrete Mathematics For In class Practice Que 1. Prove that, If n is even, n2 is also even. Solve using direct and contrapositive method. Que 2. for all integers if both m and n are even, then m.n is even. Solve using direct method. Rewrite the following statements in symbolic form using quantifiers 1. All students have taken SHD Course. 2. There is boy student in the class who is sports person. 3. Some students are intelligent but not hardworking. Designed By Team : Discrete Mathematics For In class Practice • Que 1. Prove that n3+2n is divisible by 3 using mathematical induction. • Sol: • Step 1: Base: Consider given expression is true for n=1 • 13+2.1 =3 -------its divisible by 3. • Step 2: Induction: Put n=k in given expression & consider its true. (k3+2k) • Now put n=k+1 in given expression, • (k+1) 3 + 2(k+1) = k3 + 3k2+3k+1 +2k+2 = k3 + 3k2+5k +3 • = k3 + 3k2+2k + 3k +3 • = k3 +2k+ 3k2+ 3k +3 = Assume that, yellow highlighted part is divisible by 3 and green part can be written as 3(k2+ k +1) so anything multiple of 3 is also divisible by 3. Designed By Team : Discrete Mathematics For In class Practice • Que 2. Prove that (ab)n=anbn is true for every natural number using mathematical induction • Sol: • Step 1: Base: Consider given expression is true for n=1 • (ab)1=a1b1 --------- Hence step 1 is satisfied. • Step 2: Induction: Put n=k in given expression & consider its true. • (ab)K=akbk ……………(i) • Now put n=k+1 in given expression, • (ab)k+1= a(k+1)b(k+1) • (ab)k (ab) = a(k+1)b(k+1) • akbk (ab) = a(k+1)b(k+1) • a(k+1)b(k+1) = a(k+1)b(k+1) • = Hence Step 2 is verified. Designed By Team : Discrete Mathematics For In class Practice (Mathematical Induction) • Que 3. Prove that 5n-1 is divisible by 4 for n>=1 • Que 4. Prove that (n-1) 3+ n3+(n+1) 3 is divisible by 9. • Que 5. Prove that 8n- 3n is multiple of 5 for n>=1 Designed By Team : Discrete Mathematics MIT School of Computing Department of Computer Science & Engineering PLD DesignedBy ByTeam Team :: Discrete Mathematics Designed Discrete Mathematics MIT School of Computing Department of Computer Science & Engineering PLD DesignedBy ByTeam Team :: Discrete Mathematics Designed Discrete Mathematics MIT School of Computing Department of Computer Science & Engineering PLD DesignedBy ByTeam Team :: Discrete Mathematics Designed Discrete Mathematics MIT School of Computing Department of Computer Science & Engineering PLD DesignedBy ByTeam Team :: Discrete Mathematics Designed Discrete Mathematics MIT School of Computing Department of Computer Science & Engineering PLD DesignedBy ByTeam Team :: Discrete Mathematics Designed Discrete Mathematics MIT School of Computing Department of Computer Science & Engineering PLD DesignedBy ByTeam Team :: Discrete Mathematics Designed Discrete Mathematics