Lecture 1: Discrete Structures (PDF)

Document Details

KnowledgeablePointillism9807

Uploaded by KnowledgeablePointillism9807

Information Technology University, Lahore

2024

Dr. Mudassir Shabbir

Tags

discrete structures computer science discrete mathematics introduction

Summary

This lecture introduces discrete structures, a fundamental topic in computer science. The content covers the basics of the subject, including an overview of the course and the instructor's background.

Full Transcript

Discrete Structures Introduction Dr. Mudassir Shabbir, Dr. Waseem Abbas, Hafsa Batool, Hasnain Haider, Zahra Zulfiqar Information Technology University...

Discrete Structures Introduction Dr. Mudassir Shabbir, Dr. Waseem Abbas, Hafsa Batool, Hasnain Haider, Zahra Zulfiqar Information Technology University August 21, 2024 Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 1 / 42 About Your Instructor Hi there! I’m Dr. Mudassir Shabbir. I am an Associate Professor at ITU. Before that... Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 2 / 42 About Your Instructor Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 3 / 42 About Your Instructor Punjab University, Lahore Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 3 / 42 About Your Instructor Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 4 / 42 About Your Instructor LUMS University, Lahore Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 4 / 42 About Your Instructor Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 5 / 42 About Your Instructor Rutgers University, NJ USA Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 5 / 42 About Your Instructor Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 6 / 42 About Your Instructor Rutgers University, NJ USA Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 6 / 42 About Your Instructor Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 7 / 42 About Your Instructor LANL, NM USA Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 7 / 42 About Your Instructor Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 8 / 42 About Your Instructor Bloomberg, NY USA Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 8 / 42 About Your Instructor Hi there! I’m Dr. Mudassir Shabbir. I did my Ph.D. (and M.S.) in computer science from Rutgers University in NJ, USA in 2014. My area of research is Discrete Mathematics, Graph Neural Networks, and Discrete Geometry. Most recently, I was Research Assistant Professor at Vanderbilt University, Nashville, TN. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 9 / 42 About Teaching Staff Raveed Ullah Usmani Narmeen Humayon Abdul Rafay M Hamza Naveed Bareera Hanif Butt Mehreen Mehmood Sara Noor Saleha Shoaib Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 10 / 42 Reaching Out Office Hours: On Slack (make sure you have an appointment). Email: [email protected]. ALWAYS write Discrete Structures in the subject line alongwith the main subject matter. 📧 Email: ALWAYS follow below format for emails. Subject: Question Regarding HW 3 Problem 1 | Discrete Structures Dear Dr. Mudassir, My name is Sophie (ID: BSCS23439), and I am student in your Discrete class section A. I am writing to ask for your guidance on a problem I encountered while working on the homework 3 Problem 1. Specifically, I am having difficulty with [briefly describe the problem or the specific part of the problem you’re struggling with]. I have reviewed the course materials and attempted to approach the problem in various ways, but I am still uncertain about [what exactly you are unsure about—e.g., the method, the concept, or the solution]. Could you please provide some clarification or suggest any resources that might help me better understand this issue? I would greatly appreciate any advice or direction you could offer. Thank you for your time and assistance. Office Location: 6th floor Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 11 / 42 Rules of the Game You can either call me Dr. Mudassir or you can call me Professor or just Mudassir. Turn off your phones and other electronic stuff. Be on Time. DONOT enter classroom if you are late. No whispering; talk to me instead. Be honest. Be courteous in the class. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 12 / 42 Textbook 📚 Title: Discrete Mathematics and Its Applications Author: Kenneth H. Rosen Edition: 7th Edition Publisher: McGraw-Hill ISBN-13: 978-0073383095 A few copies are available in the library! Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 13 / 42 Google Classroom 🎓 We will use Google Classroom as our online platform. https://tinyurl.com/f24class Class materials, assignments, and assessments will be posted there. We will use Slack as our online discussion and announcement portal. https://tinyurl.com/f24slack Stay updated by checking both regularly. Post your introduction in slack for 2 points towards Quiz 1 - at min. three sentences: a name, a surprising fact about you, and what you learnt in the first class. (Only valid for today.) If you have any questions (or answers), feel free to ask (and answer) on slack. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 14 / 42 Grading 💯 Component Weight Homework Assignments (4 @ 0% each) 0% Final Exam 30% Quizzes 20% Classroom Worksheets 15% Midterm Exam 15% Show n Tell 10% Group Activity 6% Classroom Participation 4% Total 100% Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 15 / 42 Show n Tell Activity 10 Points Three sessions distributed over the term. Max five presentations per session. Presentations in groups of 4-5. Each group will present only once. Volunteering/Random Ordering. About 10-15 minutes per presentation. Activity owned by Saleha Shoaib, feel free to reach out on slack. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 16 / 42 Grading Scale 📊 The following table should only give you an idea of a typical grade distribution. Note that final cutoff points will be determined at the end of the semester. Average Assigned Grade ≥ 90 A category 80 – 89.9 B category 70 – 79.9 C category 60 – 69.9 D category < 60 F Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 17 / 42 What is this Course About? Discrete + Structures Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 18 / 42 Applications of Discrete Structures 🌐 Example: Company wants to market a new product, say a cell phone. Strategy: Give away free cell phones to few individuals, who will in turn advertise the product to their friends. Goal: Give away minimum number of cell phones, while ensuring that the whole community knows about the phone. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 19 / 42 Applications of Discrete Structures 🌐 Example: Company wants to market a new product, say a cell phone. Strategy: Give away free cell phones to few individuals, who will in turn advertise the product to their friends. Goal: Give away minimum number of cell phones, while ensuring that the whole community knows about the phone. Is this a Discrete Math problem? If yes, where are Graphs? Computation? Counting? Sets? Proofs? Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 19 / 42 Applications of Discrete Structures 🌐 Question: How can we model individuals and their friendships? Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 20 / 42 Applications of Discrete Structures 🌐 Question: How can we model individuals and their friendships? We can use graphs (this is how Facebook does it). Modeling friendships: Represent individuals as nodes Represent friendships as edges Use graph theory Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 20 / 42 Applications of Discrete Structures 🌐 Question: Question: How many free cell phones are needed to cover the graph? 3? 4? 5? Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 21 / 42 Applications of Discrete Structures 🌐 Question: Question: How many free cell phones are needed to cover the graph? 3? 4? 5? Five free phones should be sufficient? (computation). Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 21 / 42 Applications of Discrete Structures 🌐 Question: Question: How many free cell phones are needed to cover the graph? 3? 4? 5? Five free phones should be sufficient? (computation). Can we do better?. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 21 / 42 Applications of Discrete Structures 🌐 Question: Question: Can we do any better than five phones? Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 22 / 42 Applications of Discrete Structures 🌐 Question: Question: Can we do any better than five phones? Yes! Four phones are sufficient (sets). Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 22 / 42 Applications of Discrete Structures 🌐 Question: Question: Can we do any better than five phones? Yes! Four phones are sufficient (sets). Question: Can you prove that is the best we can do? (proof) Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 22 / 42 Applications of Discrete Structures Keep Big Picture in View Question: Connect: Interact: What? and Why? Information. Be part of Dialog. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 23 / 42 Some Tips The course is mile wide and foot deep. There will be a lot Participate, do not be shy to Often students say “I of new concepts/topic almost ask questions, So, Be active understood everything in every week. So, Do not fall class, but am unable to solve and interactive. behind. problems”. The secret is Practice, practice, and more practice. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 24 / 42 Drawing Conclusions from Given Information Logic involves inferring truth from given statements. For example if: 1. One of them is a theif. 2. Exactly one of them is speaking the truth. A: I am not the theif B: A is the theif C: I am not the theif Who is the theif? Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 25 / 42 Drawing Conclusions from Given Information Suppose A is the theif. Then both B and C are speaking the truth. However, 2. Exactly one of them is speaking the truth. A: I am not the theif B: A is the theif C: I am not the theif Conclusion: A is not the theif. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 26 / 42 Drawing Conclusions from Given Information Suppose B is the theif. Then both A and C are speaking the truth. However, 2. Exactly one of them is speaking the truth. A: I am not the theif B: A is the theif C: I am not the theif Conclusion: B is not the theif. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 27 / 42 Drawing Conclusions from Given Information Suppose C is the theif. Then only A is speaking the truth. We know that A and B are not theives. So, A: I am not the theif B: A is the theif C: I am not the theif Conclusion: C is the theif. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 28 / 42 Drawing Conclusions from Given Information What if we have n persons, and exactly k of them are speaking the truth? Who is the thief? Takeaways: We can infer new statements (conclusions) by carefully considering the given statements and premise. Things can get complex quickly, so we need to formalize and systemize our method of reasoning. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 29 / 42 Example - How to Reason? Lets look at another example. Our focus now is on the process of reasoning. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 30 / 42 Example - How to Reason? Lets look at another example. Our focus now is on the process of reasoning. It is snowing in New York. If it snows in a city, then its schools are closed. If it snows in New York, then it snows in Boston. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 30 / 42 Example - How to Reason? Lets look at another example. Our focus now is on the process of reasoning. It is snowing in New York. If it snows in a city, then its schools are closed. If it snows in New York, then it snows in Boston. Can I conclude that: Schools in Boston are closed. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 30 / 42 Example - How to Reason? Lets look at another example. Our focus now is on the process of reasoning. It is snowing in New York. If it snows in a city, then its schools are closed. If it snows in New York, then it snows in Boston. Can I conclude that: Schools in Boston are closed. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 30 / 42 Example - How to Reason? Lets look at another example. Our focus now is on the process of reasoning. It is snowing in New York. If it snows in a city, then its schools are closed. If it snows in New York, then it snows in Boston. Can I conclude that: Schools in Boston are closed. Statements Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 30 / 42 Example - How to Reason? Lets look at another example. Our focus now is on the process of reasoning. It is snowing in New York. If it snows in a city, then its schools are closed. If it snows in New York, then it snows in Boston. Can I conclude that: Schools in Boston are closed. Statements Relation between statements (structure) Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 30 / 42 Example - How to Reason? Lets look at another example. Our focus now is on the process of reasoning. It is snowing in New York. If it snows in a city, then its schools are closed. If it snows in New York, then it snows in Boston. Can I conclude that: Schools in Boston are closed. Statements Relation between statements (structure) Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 30 / 42 Formalize - How to Reason? Do you realize anything about the form of statements and the conclusions? Statements Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 31 / 42 Formalize - How to Reason? Do you realize anything about the form of statements and the conclusions? Statements They are all Yes/No statements. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 31 / 42 Formalize - How to Reason? Do you realize anything about the form of statements and the conclusions? Statements They are all Yes/No statements. How does that help? Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 31 / 42 Formalize - How to Reason? Do you realize anything about the form of statements and the conclusions? Statements They are all Yes/No statements. How does that help? Our goal will be to formalize the process of reasoning. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 31 / 42 Formalize - How to Reason? Do you realize anything about the form of statements and the conclusions? Statements They are all Yes/No statements. How does that help? Our goal will be to formalize the process of reasoning. What do we mean by statements (mathematically)? What can be a good way to capture relations between statements? How can we write new statements from known ones, such as by performing some operations on them? Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 31 / 42 Why - Need to Reason? This formalization is key to Constructing precise mathematical arguments, Proving (disproving) complex statements, Verifying correctness of computer programs, Designing computer circuits, … Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 32 / 42 Why - Need to Reason? This formalization is key to Constructing precise mathematical arguments, Proving (disproving) complex statements, Verifying correctness of computer programs, Designing computer circuits, … And to pass this course. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 32 / 42 Why - Need to Reason? This formalization is key to Constructing precise mathematical arguments, Proving (disproving) complex statements, Verifying correctness of computer programs, Designing computer circuits, … And to pass this course. Now we are going to formally start Chapter 1. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 32 / 42 1.1 Propositions and Logical Operations Proposition: A statement that is either true or false, but not both. Statement Proposition Truth Value 29 is a prime number Open the door x + y > 5, Earth is the only planet where life exists ?? For every positive integer n, there is a prime number larger than n Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 33 / 42 1.1 Propositions and Logical Operations Proposition: A statement that is either true or false, but not both. Statement Proposition Truth Value 29 is a prime number 3 Yes Open the door x + y > 5, Earth is the only planet where life exists ?? For every positive integer n, there is a prime number larger than n Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 33 / 42 1.1 Propositions and Logical Operations Proposition: A statement that is either true or false, but not both. Statement Proposition Truth Value 29 is a prime number 3 Yes Open the door 7 x + y > 5, Earth is the only planet where life exists ?? For every positive integer n, there is a prime number larger than n Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 33 / 42 1.1 Propositions and Logical Operations Proposition: A statement that is either true or false, but not both. Statement Proposition Truth Value 29 is a prime number 3 Yes Open the door 7 x + y > 5, 7 Earth is the only planet where life exists ?? For every positive integer n, there is a prime number larger than n Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 33 / 42 1.1 Propositions and Logical Operations Proposition: A statement that is either true or false, but not both. Statement Proposition Truth Value 29 is a prime number 3 Yes Open the door 7 x + y > 5, 7 Earth is the only planet where life exists 3 ?? For every positive integer n, there is a prime number larger than n Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 33 / 42 1.1 Propositions and Logical Operations Proposition: A statement that is either true or false, but not both. Statement Proposition Truth Value 29 is a prime number 3 Yes Open the door 7 x + y > 5, 7 Earth is the only planet where life exists 3 ?? For every positive integer n, there is a prime 3 Yes number larger than n Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 33 / 42 1.1 Propositions and Logical Operations Proposition: A statement that is either true or false, but not both. Statement Proposition Truth Value 29 is a prime number 3 Yes Open the door 7 x + y > 5, 7 Earth is the only planet where life exists 3 ?? For every positive integer n, there is a prime 3 Yes number larger than n Why we defined our basic building block this particular way? Simplest, concise, and the most un-ambiguous way of declaring a fact / information Has a definite truth value Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 33 / 42 1.1 Propositions and Logical Operations Sometimes simple statements are not enough (to express complicated ideas). Combine propositions to get compound propositions using certain composition rules called logical operations. It is raining It is cold Proposition. It is raining and it is cold Compound Proposition. What determines the truth value of a compound proposition? Let’s see some basic logical operations. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 34 / 42 Conjunction Operator Conjunction Operator: Represents logical ”and” operation between two propositions. The conjunction of propositions P and Q is conjunction of p and q is a new proposition, whose truth value is true when both P and Q are true, and false otherwise. P Q P ∧Q Notation: True True True P ∧Q Truth Table: True False False Read as P and Q False True False False False False Example: If P represents ”It is sunny” and Q represents ”I go to the beach,” then P ∧ Q represents ”It is sunny and I go to the beach.” Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 35 / 42 Disjunction Operator Disjunction Operator: Represents logical ”or” operation between two proposi- tions. The disjunction of propositions P and Q is a new proposition, whose truth value is true when either P or Q or both are true, and false otherwise. P Q P ∨Q Notation: True True True P ∨Q Truth Table: True False True Read as P or Q False True True False False False Example: If P represents ”I found a unicorn” and Q represents ”I won the lottery,” then P ∨ Q represents ”Either I found a unicorn, or I won the lottery” Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 36 / 42 Exclusive-Or Operator Exclusive-Or Operator (XOR): Represents logical ”exclusive-or” operation between two propositions. The exclusive-or of propositions P and Q is a new proposition, whose truth value is true when either P or Q is true, but not both, and false when both P and Q are either true or false. P Q P ⊕Q Notation: True True False P ⊕Q Truth Table: True False True Read as P exclusive-or Q False True True False False False Example: If P represents ”I’m in the mood for pizza” and Q represents ”I’m in the mood for sushi,” then P ⊕ Q represents ”Either I’m in the mood for pizza or sushi, but not both!” Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 37 / 42 Negation Operator Negation Operator (¬): Represents the logical ”not” operation on a proposi- tion. Given a proposition P , its negation ¬P is a new proposition whose truth value is the opposite of P. Truth Table: Notation: ¬P P ¬P Read as ”not P ” True False False True Example: If P represents ”It’s a weekday,” then ¬P represents ”It’s not a weekday (i.e., it’s the weekend).” Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 38 / 42 Logical Operator Problems Problem 1: If ”I find my keys” is represented by P , and ”I’m late for work” is represented by Q, write the proposition ”I’m not late for work and I found my keys.” Problem 2: Let P be ”It’s raining” and Q be ”I forgot my umbrella.” Write the proposition ”It’s not raining or I forgot my umbrella.” Problem 3: Suppose P is ”I have cookies” and Q is ”I have milk.” Write the proposition ”I have cookies and milk.” Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 39 / 42 Logical Operator Problems Problem 1: If ”I find my keys” is represented by P , and ”I’m late for work” is represented by Q, write the proposition ”I’m not late for work and I found my keys.” Problem 2: Let P be ”It’s raining” and Q be ”I forgot my umbrella.” Write the proposition ”It’s not raining or I forgot my umbrella.” Problem 3: Suppose P is ”I have cookies” and Q is ”I have milk.” Write the proposition ”I have cookies and milk.” Solutions Problem 1: ¬Q ∧ P Problem 2: ¬P ∨ Q Problem 3: P ∧ Q Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 39 / 42 1.1 Propositions and Logical Operations Let p and q be propositions, then under what conditions 1 p ⊕ q 6= p ∨ q 2 p∨q =p∧q 3 p⊕q =p∧q Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 40 / 42 1.1 Propositions and Logical Operations Let p and q be propositions, then under what conditions 1 p ⊕ q 6= p ∨ q 2 p∨q =p∧q 3 p⊕q =p∧q Solutions: 1 p = T, q = T 2 p = T, q = T 3 p = F, q = F Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 40 / 42 Evaluating Compound Propositions When evaluating compound propositions with logical operators, the order of operations is as follows: 1 Evaluate expressions inside parentheses. 2 Apply the negation (¬) operator. 3 Apply the conjunction (∧) operator. 4 Apply the disjunction (∨) operator. Example Evaluate P ∧ ¬Q ∨ R given P = ”Sunny”, Q = ”Beach”, R = ”Umbrella”. 1 ¬Q is ”Not at Beach”. 2 P ∧ ¬Q is ”Sunny and Not at Beach”. 3 P ∧ ¬Q ∨ R is ”Sunny and Not at Beach, or Umbrella”. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 41 / 42 Solving Compound Proposition Example Proposition: s = (p ∨ q) ∧ ¬(p ∧ q) p q p∨q p∧q ¬(p ∧ q) (p ∨ q) ∧ ¬(p ∧ q) Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 42 / 42 Solving Compound Proposition Example Proposition: s = (p ∨ q) ∧ ¬(p ∧ q) p q p∨q p∧q ¬(p ∧ q) (p ∨ q) ∧ ¬(p ∧ q) True True True True True False True False False True True False False False False False Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 42 / 42 Solving Compound Proposition Example Proposition: s = (p ∨ q) ∧ ¬(p ∧ q) p q p∨q p∧q ¬(p ∧ q) (p ∨ q) ∧ ¬(p ∧ q) True True True True False True False True False True False True True False True False False False False True Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 42 / 42 Solving Compound Proposition Example Proposition: s = (p ∨ q) ∧ ¬(p ∧ q) p q p∨q p∧q ¬(p ∧ q) (p ∨ q) ∧ ¬(p ∧ q) True True True True False False True False True False True True False True True False True True False False False False True False Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 42 / 42 Solving Compound Proposition Example Proposition: s = (p ∨ q) ∧ ¬(p ∧ q) p q p∨q p∧q ¬(p ∧ q) (p ∨ q) ∧ ¬(p ∧ q) True True True True False False True False True False True True False True True False True True False False False False True False Solution: The truth values of s for all possible truth values of p and q are shown in the table. Therefore, the simplified proposition is: s = p ⊕ q. Mudassir/Waseem/Hafsa/Hasnain/Zahra (ITU) Discrete Structures August 21, 2024 42 / 42

Use Quizgecko on...
Browser
Browser