Discrete Math – Logic Unit

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

CSE 311: Foundations of Computing Fall 2013 Lecture 3: Logic and Boolean algebra.
Discrete Mathematics and applications Autumn 2010 Tôi là Moshe Rosenfeld Tôi sinh ra ở Israel Tôi đã học toán học tại Đại học Hebrew ở Jerusalem Tôi đến.
Goals Determine the true value of statements with AND, OR, IF..THEN. Negate statements with the connectives above Construct truth tables Understand when.
CS128 – Discrete Mathematics for Computer Science
DEDUCTIVE REASONING: PROPOSITIONAL LOGIC Purposes: To analyze complex claims and deductive argument forms To determine what arguments are valid or not.
Discrete Mathematics Lecture 1 Logic of Compound Statements Harper Langston New York University.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
1 Section 1.1 Logic. 2 Proposition Statement that is either true or false –can’t be both –in English, must contain a form of “to be” Examples: –Cate Sheller.
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
Discrete Mathematics Math 6A Instructor: M. Welling.
EE1J2 – Discrete Maths Lecture 5
Discussion #9 1/9 Discussion #9 Tautologies and Contradictions.
Propositional Calculus Math Foundations of Computer Science.
Chapter 2: The Logic of Compound Statements 2.1 Logical Forms and Equivalence 12.1 Logical Forms and Equivalences Logic is a science of the necessary laws.
The Laws of Logic: Boolean Algebra A State High Math Club Presentation START==TRUE.
3.2 – Truth Tables and Equivalent Statements
TRUTH TABLES. Introduction Statements have truth values They are either true or false but not both Statements may be simple or compound Compound statements.
CSCI2110 – Discrete Mathematics Tutorial 8 Propositional Logic Wong Chung Hoi (Hollis)
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
Chapter 1 Section 1.4 More on Conditionals. There are three statements that are related to a conditional statement. They are called the converse, inverse.
Discrete Mathematics and Its Applications
1 CHAPTER 4: PART I ARITHMETIC FOR COMPUTERS. 2 The MIPS ALU We’ll be working with the MIPS instruction set architecture –similar to other architectures.
XOR and XNOR Logic Gates. XOR Function Output Y is TRUE if input A OR input B are TRUE Exclusively, else it is FALSE. Logic Symbol  Description  Truth.
Copyright © Curt Hill Truth Tables A way to show Boolean Operations.
Chapter 1 The Logic of Compound Statements. Section 1.1 Logical Form and Logical Equivalence.
Logic Gates & Boolean Algebra Chin-Sung Lin Eleanor Roosevelt High School.
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
Fall 2012: FCM 708 Foundation I Lecture 2 Prof. Shamik Sengupta
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
Discrete Mathematics and Its Applications.  The English mathematician George Boole ( ) sought to give symbolic form to Aristotle's system of.
Module Code MA1032N: Logic Lecture for Week Autumn.
The Foundations Logic and Proofs by raedRASHEED 2014.
HAWKES LEARNING Students Count. Success Matters. Copyright © 2015 by Hawkes Learning/Quant Systems, Inc. All rights reserved. Section 3.2 Truth Tables.
IT253: Computer Organization Lecture 7: Logic and Gates: Digital Design Tonga Institute of Higher Education.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
MLS 570 Critical Thinking Reading Notes for Fogelin: Propositional Logic Fall Term 2006 North Central College.
Chapter 8 – Symbolic Logic Professor D’Ascoli. Symbolic Logic Because the appraisal of arguments is made difficult by the peculiarities of natural language,
Logic Gates & Boolean Algebra Chin-Sung Lin Eleanor Roosevelt High School.
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
LOGIC.
Logical Form and Logical Equivalence Lecture 1 Section 1.1 Wed, Jan 12, 2005.
Logical Form and Logical Equivalence M Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.
LOGIC AND QUANTIFIERS. INTRODUCTION Many algorithms and proofs use logical expressions such as: “IF p THEN q” or “If p1 AND p2, THEN q1 OR q2” Therefore.
Chapter 1: The Foundations: Logic and Proofs
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
Notes - Truth Tables fun, fun, and more fun!!!!. A compound statement is created by combining two or more statements, p and q.
رياضيات متقطعة لعلوم الحاسب MATH 226. Text books: (Discrete Mathematics and its applications) Kenneth H. Rosen, seventh Edition, 2012, McGraw- Hill.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Assign Yourself and Do Now Thursday, January 10, 2013.
Logic and Truth Tables Winter 2012 COMP 1380 Discrete Structures I Computing Science Thompson Rivers University.
Logic Gates and Boolean Algebra Introduction to Logic II.
Chapter 3 Boolean Algebra and Digital Logic T103: Computer architecture, logic and information processing.
Chapter 1 Logic and proofs
Discrete Structures for Computer Science Presented By: Andrew F. Conn Slides adapted from: Adam J. Lee Lecture #1: Introduction, Propositional Logic August.
DISCRETE MATHEMATICS CHAPTER I.
Discrete Mathematics Logic.
COMP 1380 Discrete Structures I Thompson Rivers University
Classwork/Homework Classwork – Page 90 (11 – 49 odd)
Component 1 – 2A, B, C Binary Logic
Propositional Calculus: Boolean Algebra and Simplification
Information Technology Department
Fundamentals of Computer Systems
Applied Discrete Mathematics Week 1: Logic
Discrete Mathematics Logic.
Truth tables Mrs. Palmer.
COMP 1380 Discrete Structures I Thompson Rivers University
1.2 Propositional Equivalences
Presentation transcript:

Discrete Math – Logic Unit Jill Hubbard Tualatin High School

Oregon Department of Education approved discrete math advanced knowledge and skills D.8 Logic: Understand the fundamentals of propositional logic, arguments, and methods of proof. D.8.1 Use truth tables to determine truth values of compounded propositional statements. D.8.3 Determine whether two propositions are logically equivalent. D.8.5 Construct logical arguments using laws of detachment (modus ponens), syllogism, tautology, and contradiction

Materials Needed Logisim free logic simulator Access to a computer http://sourceforge.net/projects/circuit/ Access to a computer

First some vocabulary we’ll see Proposition Compound Propositions Primitive propositions Logical Operators Truth Table Conjunction (AND) Disjunction (OR) Negation (NOT) What other logical operators do you know? Tautology Contradiction Have students guess what they think these works mean. The goal is to get them thinking about the words apart from math and then add the math definitions on top of that

Propositions A proposition is a statement that is either true or false New York City is in Oregon (false) Today is Friday (its either true or false) Do your homework (not a proposition) It’s raining outside (probably true in Oregon!)

Compound and Primitive Propositions Compound Propositions are propositions that are composed of sub-propositions connected together in various ways roses are red and violets are blue Mark is smart or he studies a lot Primitive propositions can not be broken down into simpler propositions If it’s not a composite proposition, it’s a primitive proposition

What do you think this means? The truth value of a compound proposition id determined by the truth values of it sub-propositions together with the way in which they are connected John is short OR John is tall If either part is true, the entire proposition is true John is short AND John is tall Both parts have to be true for the entire proposition to be true. Open discussion. Try to get to the fact that in order to determine if the compound prop is true, we’ll need to break it up into its pieces and then figure out how we’re connecting the pieces

Basic Logical Operators Conjunction Conjunction: p q / (p * q) Read as p AND q A truth table is used to shows how a logical operator works Use Logisim to model the AND operator and fill in the truth table Based on your truth table, write a definition of how the AND operator works p q p q p * q AND p q p q F T Share out the definitions and give student an official definition If p and q are true, then p AND q is true, otherwise its false

Basic Logical Operators Disjunction Disjunction: p q / (p + q) Read as p OR q A truth table is used to shows how a logical operator works Use Logisim to model the OR operator and fill in the truth table Based on your truth table, write a definition of how the OR operator works p p q p + q OR q p q p q F T Share out the definitions and give student an official definition If either p or q are true, then p OR q is true, otherwise its false OR If p AND q are false, the p OR q is false. Otherwise, its true

Basic Logical Operators Negation Negation: ¬p / !p Read as NOT p Use Logisim to model the NOT operator and fill in the truth table Based on your truth table, write a definition of how the NOT operator works Let p be the statement 2+2 = 5 (true or false) Give an example of a negation of this statement ¬ p !p p p ¬ p F T Share out the definitions and give student an official definition If p is true then not p is false If p is false then not p is true The statement 2+2 = 5 is false. Therefore, its negation must be true 2+2 is not equal to 5 (that’s true) or It is not true that 2+2 = 5 (also true)

Other Logical Operations (NAND, NOR, XOR, XNOR) Use Logisim to model these operators Create a truth table for each operator Based on your truth table, write a definition of how the operator works XOR: read as exclusive OR XNOR: read as exclusive NOR NAND NOR XNOR XOR

Relationships between logical operators People are related to each other right? So are logic gates. But you need to figure them out! What the relationship between the AND gate and the NAND gate What the relationship between the OR gate and the NOR gate What the relationship between the OR gate and the XOR gate. What makes it so exclusive anyway? What the relationship between the XOR gate and the XNOR gate NAND is not AND (hence the bubble on the output of the gate.) The truth table outputs are flipped (notted) NOR is not OR (hence the bubble on the output of the gate.) The truth table outputs are flipped (notted) An XOR looks like an OR operator except the case when both inputs are true results in an false output (its excluded) XNOR is not XOR (hence the bubble on the output of the gate.) The truth table outputs are flipped (notted)

Truth Tables for Compound Propositional Statements Create a truth table for the following compound propositional statement: (p q) (¬ p q) (p * q) + (!p * q) Use Logisim to model this statement Run the simulator to make it matches your truth table. If it doesn’t, you made a mistake and must figure out how to fix it! From here on out, let’s use an engineer’s nomenclature mathematicians nomenclature engineers nomenclature

What the model looks like File name of source: combo logic

The Mathematicians Method p q !p p * q !p * q (p * q) + (!p * q) F T

The Engineers Method (p * q) + (!p * q) Sum of products form Each term produces a true expression So, the expression is true when p is true AND q is true OR p is false (!p) AND q is true Everywhere else, the expression is false Engineers are lazy!

Tautologies Tautologies are propositions that are always true no matter what the truth values if their variables are (p + !p) is a tautology Why? If p is true, then !p is false and visa versa The OR logical operator states that if either p or !p is true, the result is true. One of those MUST be true Use the simulator to build this and test it.

Contradictions Contradictions are propositions that are always false no matter what the truth values if their variables are (p * !p) is a tautology Why? If p is true, then !p is false and visa versa The AND logical operator states that if either p or !p is false, the result is false. One of those MUST be false Use the simulator to build this and test it.

Simulate & Fill In the Truth Table p p * !p F T p p + !p F T

Tautologies & Contradictions Let p stand for the statement “It is cold outside” Then !p means it is not cold outside The proposition, p * !p would mean that it is cold outside and it is not cold outside. Clearly, always false and therefore a contradiction The proposition, p + !p would mean that it is cold outside or it is not cold outside. Clearly, always true and therefore a tautology

Tautologies & Contradictions Is the following proposition a tautology or a contradiction? p + !(p * q) Prove using a truth table Prove using the Logisim simulator

Logical Equivalence Two propositions are logically equivalent if they have identical truth tables How is it possible that two propositions can have the same truth table? Take for example the following 2 propositions: !(p * q) !p + !q

Logical Equivalence F T F T !(p * q) !p + !q p q p * q !(p * q) p q !p

Logical Equivalence When engineers design circuits, the goal is to create designs that work robustly and are cheap The fewer gates engineers use, the cheaper the design will be Therefore, it is critical that engineers simplify their design to create cheap but equivalent logic Engineers use logic synthesizers to help them do the task of logic simplification.

Engineering Applications Engineers use 1’s and 0’s instead of True and False 1 means True and 0 means False All truth tables therefore use 1’s and 0’s Computers use the binary number system When engineers create a design, their first job is to determine the interface for their design (the inputs and outputs needed to get the job done).

Number Systems Decimal – base 10 Remember back a long time ago when you were learning how to count? Our number system only has 10 symbols (0-9). So how do we represent the number after 9? Each number had a place value (Each place value is a power of 10 (base 10) You multiply each number with its place value and then added them all together. Now you just take it for granted!

Decimals Numbers - Base 10 10,000’s Place 1000’s Place 100’s Place 10’s 1’s Place Number 3 3*1 = 3 2 (2*10+3*1)= 23 1 (1*100)+(2*10)+(3*1)= 123

Number Systems Binary – Base 2 Computers use the binary number system or base 2. Base 2 uses only 2 numbers (1 and 0). This makes things very simple. But how do we represent numbers greater then 1? Just like base 10(decimal), each number had a place value. Each place value is a power of 2 (base 2) You multiply each number with its place value and then added them all together.

Binary Numbers - Base 2 1 (1*4)+ (1*2) = 6 (1*16) + (1*4)+ (1*2) 16’s Place 8’s Place 4’s Place 2’s 1’s Place Number 1 (1*4)+ (1*2) = 6 (1*16) + (1*4)+ (1*2) Or simply 16+4+2 = 22 16+8+4+2+1 = 31

Counting in Binary is EASY! Binary Number Decimal Equivalent zero 1 one two three four five six seven

Applications of logic – 7 segment display project outA YOUR LOGIC outB in2 outC in1 outD outE in0 outF outG Note: A “1” on outA turn on the A segment of the 7 segment display, and a “0” on outA turns segment A off. The same is true for segments B through G

Applications of logic – 7 segment display project Let’s use what we know to design logic that drives a 7-segment display. All inputs and outputs are binary numbers (1’s and 0’s) If your inputs are all 000, your 7 segment display should display the number 0 If your inputs are all 111, your 7 segment display should display the number 7 All input number encodings should work (0-7)

Let’s Make Truth Tables Demo the truth table for outA Let students figure out equations for outB-outG Review your equations with your instructor

Lets’ Simplify our logic Show students how to create K-Maps to create equivalent logic with less gates

Let’s use the logic simulator to make and test our design Students must test their design to make sure they work If they do not work, they must debug their design