Discrete Structure Lecture Notes PDF

Document Details

RapidNephrite5737

Uploaded by RapidNephrite5737

University of Engineering and Technology, Lahore

Muhammad Tahir Mumtaz

Tags

discrete mathematics logic mathematical structures mathematics

Summary

These lecture notes cover the fundamentals of discrete structures, a branch of mathematics focusing on objects that are fundamentally discrete rather than continuous. Topics include logic, set theory, and fundamental concepts. The notes also list recommended textbooks and main topics.

Full Transcript

Muhammad Tahir Mumtaz M- Phil in computer science (Image Processing) University of Central Punjab Lahore, Punjab, Pakistan. M- Phil in computer science (Software Engineering) Pir Mehr Ali Shah Arid Agriculture Univer...

Muhammad Tahir Mumtaz M- Phil in computer science (Image Processing) University of Central Punjab Lahore, Punjab, Pakistan. M- Phil in computer science (Software Engineering) Pir Mehr Ali Shah Arid Agriculture University Rawalpindi Islamabad, Punjab, Pakistan Ph. D in computer science (Cont..) (Deep Learning) Unisza, Terengganu, Malaysia. Discrete Structure Background of discrete structure The history of discrete mathematics has involved a number of challenging problems which have focused attention within areas of the field. In graph theory, much research was motivated by attempts to prove the four color theorem, first stated in 1852, but not proved until 1976 (by Kenneth Appel and Wolfgang Haken, using significant computer assistance). Four color Theorem Four color Theorem In mathematics, the four color theorem, or the four color map theorem, states that, producing a figure called a map, no more than four colors are required to color the regions of the map so that no two adjacent regions have the same color. Discrete structure is the study of mathematical structures that are fundamentally discrete rather than continuous. In contrast to real numbers that have the property of varying/changing "smoothly", the objects studied in discrete mathematics – such as integers, graphs, and statements in logic. More formally, discrete structures has been characterized as the branch of mathematics dealing with countable sets. Discrete structure therefore excludes topics in "continuous mathematics" such as calculus or Euclidean geometry What is discrete Structures? Discrete mathematics is the part of mathematics devoted to the study of discrete objects (Kenneth H. Rosen, 6th edition). Discrete mathematics is the study of mathematical structures that are fundamentally discrete rather than continuous (wikipedia) Recommended Books: Discrete Mathematics with Applications (second edition) by Susanna S. Epp Discrete Mathematics and Its Applications (fourth edition) by Kenneth H. Rosen Discrete Mathematics by Ross and Wright MAIN TOPICS: 1. Logic 2. Sets & Operations on sets 3. Relations & Their Properties 4. Functions 5. Sequences & Series 6. Recurrence Relations 7. Mathematical Induction 8. Loop Invariants 10. Combinatorics 11. Probability 12. Graphs and Trees LOGIC: Logic is the study of the principles and methods that distinguish between a valid and an invalid argument. SIMPLE STATEMENT: A statement is a declarative sentence that is either true or false but not both. A statement is also referred to as a proposition Propositional Logic: Proposition A proposition (or Statement) is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both. EXAMPLES a. 2+2 = 4, b. It is Sunday today If a proposition is true, we say that it has a truth value of "true”. If a proposition is false, its truth value is "false". The truth values “true” and “false” are, respectively, denoted by the letters T and F. EXAMPLES: Propositions 1) Grass is green. 2) 4 + 2 = 6 3) 4 + 2 = 7 4) There are four fingers in a hand. Not Propositions 1) Close the door. 2) x is greater than 2. 3) He is very rich x + 2 is positive. Not a statement May I come in? Not a statement Logic is interesting. A statement It is hot today. A statement x + y = 12 Not a statement COMPOUND STATEMENT Simple statements could be used to build a compound statement. LOGICAL CONNECTIVES EXAMPLES: “3 + 2 = 5” and “Lahore is a city in Pakistan” “The grass is green” or “ It is hot today” “Discrete Mathematics is not difficult to me” AND, OR, NOT are called LOGICAL CONNECTIVES. SYMBOLIC REPRESENTATION Statements are symbolically represented by letters such as p, q, r,... EXAMPLES: p = “Islamabad is the capital of Pakistan” q = “17 is divisible by 3” EXAMPLES p = “Islamabad is the capital of Pakistan” q = “17 is divisible by 3” p ∧ q = “Islamabad is the capital of Pakistan and 17 is divisible by 3” p ∨ q = “Islamabad is the capital of Pakistan or 17 is divisible by 3” ~p = “It is not the case that Islamabad is the capital of Pakistan” or simply “Islamabad is not the capital of Pakistan” TRANSLATING FROM ENGLISH TO SYMBOLS Let p = “It is hot”, and q = “ It is sunny” SENTENCE SYMBOLIC FORM 1.It is not hot. ~ p 2.It is hot and sunny. p ∧q 3.It is hot or sunny. p ∨ q 4.It is not hot but sunny. ~ p ∧q 5.It is neither hot nor sunny. ~ p ∧ ~ q EXAMPLE Let h = “Zia is healthy” w = “Zia is wealthy” s = “Zia is wise” Translate the compound statements to symbolic form: 1) Zia is healthy and wealthy but not wise. (h ∧ w) ∧ (~ s) 2) Zia is not wealthy but he is healthy and wise. ~ w ∧ (h ∧ s) 3) Zia is neither healthy, wealthy nor wise.~h∧~w∧~s TRANSLATING FROM SYMBOLS TO ENGLISH: Let m = “Ali is good in Mathematics” c = “Ali is a Computer Science student” Translate the following statement forms into plain English: 1) ~ c : Ali is not a Computer Science student 2) c ∨ m Ali is a Computer Science student or good in Maths. 3) m ∧ ~ c Ali is good in Maths but not a Computer Science student A convenient method for analyzing a compound statement is to make a truth table for it. Truth Table A truth table specifies the truth value of a compound proposition for all possible truth values of its constituent propositions. NEGATION (~): If p is a statement variable, then negation of p, “not p”, is denoted as “~p” It has opposite truth value from p i.e., if p is true, then ~ p is false; if p is false, then ~ p is true. CONJUNCTION (∧) If p and q are statements, then the conjunction of p and q is “p and q”, denoted as “p ∧ q”. Remarks o p ∧ q is true only when both p and q are true. o If either p or q is false, or both are false, then p ∧ q is false. DISJUNCTION (∨) If p & q are statements, then the disjunction of p and q is “p or q”, denoted as “p ∨ q”. Remarks: o p ∨ q is true when at least one of p or q is true. o p ∨ q is false only when both p and q are false. Truth Tables Class Practice 1. ~ p ∧ q 2. ~ p ∧ (q ∨ ~ r) 3. (p∨q) ∧ ~ (p∧q) USAGE OF “OR” IN ENGLISH In English language the word OR is sometimes used in an inclusive sense (p or q or both). Example: I shall buy a pen or a book. In the above statement, if you buy a pen or a book in both cases the statement is true and if you buy both pen and book, then statement is again true. Thus we say in the above statement we use or in inclusive sense. The word OR is sometimes used in an exclusive sense (p or q but not both). As in the below statement Example: Tomorrow at 9, I’ll be in Lahore or Islamabad. Now in above statement we are using OR in exclusive sense because if both the statements are true, then we have F for the statement. While defining a disjunction the word OR is used in its inclusive sense. Therefore, the symbol ∨ means the “inclusive OR” EXCLUSIVE OR: When OR is used in its exclusive sense, The statement “p or q” means “p or q but not both” or “p or q and not p and q” which translates into symbols as (p ∨ q) ∧ ~ (p ∧ q) It is abbreviated as p ⊕ q or p XOR q Class Practice TRUTH TABLE FOR (p∨q) ∧ ~ (p ∧ q) LOGICAL EQUIVALENCE If two logical expressions have the same logical values in the truth table, then we say that the two logical expressions are logically equivalent. In the following example, ~ (~ p ) is logically equivalent p. So it is written as ~(~p) ≡ p Example Rewrite in a simpler form: “It is not true that I am not happy.” Solution: Let p = “I am happy” then ~ p = “I am not happy” and ~ ( ~ p) = “It is not true that I am not happy” Since ~ ( ~ p) ≡ p Hence the given statement is equivalent to “I am happy” Example Show that ~ (p∧q) and ~ p ∧ ~ q are not logically equivalent DE MORGAN’S LAWS 1) The negation of an AND statement is logically equivalent to the OR statement in which each component is negated. Symbolically ~ (p ∧ q) ≡ ~ p ∨ ~ q 2) The negation of an OR statement is logically equivalent to the AND statement in which each component is negated. Symbolically ~ (p ∨ q) ≡ ~ p ∧ ~ q Assignments Show that (p ∧ q) ∧ r ≡ p ∧ (q ∧ r) Are the statements ( p ∧ q ) ∨ r and p ∧ ( q ∨ r ) logically equivalent? TAUTOLOGY A tautology is a statement form that is always true regardless of the truth values of the statement variables. A tautology is represented by the symbol “t”. CONTRADICTION A contradiction is a statement form that is always false regardless of the truth values of the statement variables. A contradiction is represented by the symbol “c”. So if we have to prove that a given statement form is CONTRADICTION, we will make the truth table for the statement form and if in the column of the given statement form all the entries are F, then we say that statement form is contradiction. LOGICAL EQUIVALENCE INVOLVING TAUTOLOGY LOGICAL EQUIVALENCE INVOLVING CONTRADICTION EXERCISE: Use truth table to show that ( p ∧ q ) ∨ (~ p ∨ ( p ∧ ~q )) is a tautology. EXERCISE: Use truth table to show that (p ∧ ~q) ∧(~p∨q) is a contradiction LAWS OF LOGIC 1) Commutative Laws p∧q≡q∧p p∨q≡q∨p 2) Associative Laws (p∧q)∧r≡p∧(q∧r) (p∨q)∨r≡p∨(q∨r) 3) Distributive Laws p∧(q∨r)≡(p∧q)∨(p∧r) p∨(q∧r)≡(p∨q)∧(p∨r) 4) Identity Laws p∧t≡p p∨c≡p 5) Negation Laws p ∨ ∼p ≡ t p ∧ ∼p ≡ c 6) Double Negation Law ∼( ∼p) ≡ p 7) Idempotent Laws p∧p≡p p∨p≡p 8) DeMorgan’s Laws ~ ( p ∧ q ) ≡ ~p ∨ ∼q ~ ( p ∨ q ) ≡ ~p ∧ ∼q 9) Universal Bound Laws p∨t≡t p∧c≡c 10) Absorption Laws p∨(p∧q)≡p p∧(p∨q)≡p 11) Negation of t and c ~t≡c ~c≡t

Use Quizgecko on...
Browser
Browser