Mathematics for Computing Lecture 2: Computer Logic and Truth Tables Dr Andrew Purkiss-Trew Cancer Research UK

Slides:



Advertisements
Similar presentations
Logic ChAPTER 3.
Advertisements

TRUTH TABLES Section 1.3.
TRUTH TABLES The general truth tables for each of the connectives tell you the value of any possible statement for each of the connectives. Negation.
Constructing a Truth Table
Logic & Critical Reasoning
Propositional Equivalences
CSE 311: Foundations of Computing Fall 2013 Lecture 3: Logic and Boolean algebra.
Propositional Equivalences. L32 Agenda Tautologies Logical Equivalences.
Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 3.2 Truth Tables for Negation, Conjunction, and Disjunction.
Logic Chapter 2. Proposition "Proposition" can be defined as a declarative statement having a specific truth-value, true or false. Examples: 2 is a odd.
Boolean Algebra Computer Science AND (today is Monday) AND (it is raining) (today is Monday) AND (it is not raining) (today is Friday) AND (it is.
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
Discussion #10 1/16 Discussion #10 Logical Equivalences.
CSE 311 Foundations of Computing I Autumn 2011 Lecture 2 More Propositional Logic Application: Circuits Propositional Equivalence.
Propositional Logic 7/16/ Propositional Logic A proposition is a statement that is either true or false. We give propositions names such as p, q,
Logic Truth Tables, Propositions, Implications. Statements Logic is the tool for reasoning about the truth or falsity of statements. –Propositional logic.
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.
Logic ChAPTER 3.
Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 3.2 Truth Tables for Negation, Conjunction, and Disjunction.
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.
Section 1.5 Implications. Implication Statements If Cara has a piano lesson, then it is Friday. If it is raining, then I need to remember my umbrella.
Section 1-4 Logic Katelyn Donovan MAT 202 Dr. Marinas January 19, 2006.
Course Outline Book: Discrete Mathematics by K. P. Bogart Topics:
Discrete Maths 2. Propositional Logic Objective
Chapter 1 The Logic of Compound Statements. Section 1.1 Logical Form and Logical Equivalence.
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
Chapter 5 – Logic CSNB 143 Discrete Mathematical Structures.
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
Discrete Mathematics Lecture1 Miss.Amal Alshardy.
CSNB143 – Discrete Structure LOGIC. Learning Outcomes Student should be able to know what is it means by statement. Students should be able to identify.
Boolean Algebra. Logical Statements A proposition that may or may not be true:  Today is Monday  Today is Sunday  It is raining.
Conditional Statements
Chapter 3: Introduction to Logic. Logic Main goal: use logic to analyze arguments (claims) to see if they are valid or invalid. This is useful for math.
MAIN TOPIC : Statement, Open Sentences, and Truth Values Negation Compound Statement Equivalency, Tautology, Contradiction, and Contingency Converse, Inverse,
Chapter 8 – Symbolic Logic Professor D’Ascoli. Symbolic Logic Because the appraisal of arguments is made difficult by the peculiarities of natural language,
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
Lecture 9 Conditional Statements CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
How do I show that two compound propositions are logically equivalent?
Chapter 7 Logic, Sets, and Counting Section 1 Logic.
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.
CS203 Discrete Mathematical Structures
Section 1.1. Section Summary Propositions Connectives Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional Truth.
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
Boolean Logic.
Simplifying Boolean Expressions. Boolean Operators (T/F) xyx AND y FFF FTF TFF TTT xyx OR y FFF FTT TFT TTT xyx XOR y FFF FTT TFT TTF xNOT x FT TF.
TRUTH TABLES. Introduction The truth value of a statement is the classification as true or false which denoted by T or F. A truth table is a listing of.
Notes - Truth Tables fun, fun, and more fun!!!!. A compound statement is created by combining two or more statements, p and q.
Joan Ridgway. If a proposition is not indeterminate then it is either true (T) or false (F). True and False are complementary events. For two propositions,
Symbolic Logic The Following slide were written using materials from the Book: The Following slide were written using materials from the Book: Discrete.
رياضيات متقطعة لعلوم الحاسب MATH 226. Text books: (Discrete Mathematics and its applications) Kenneth H. Rosen, seventh Edition, 2012, McGraw- Hill.
Section 1.1. Propositions A proposition is a declarative sentence that is either true or false. Examples of propositions: a) The Moon is made of green.
Conditional Statements Lecture 2 Section 1.2 Fri, Jan 20, 2006.
TRUTH TABLES Edited from the original by: Mimi Opkins CECS 100 Fall 2011 Thanks for the ppt.
Spring 2003CMSC Discrete Structures1 Let’s get started with... Logic !
 2012 Pearson Education, Inc. Slide Chapter 3 Introduction to Logic.
3/6/20161 Let’s get started with... Logic !. 3/6/20162 Logic Crucial for mathematical reasoningCrucial for mathematical reasoning Used for designing electronic.
Conditional statement or implication IF p then q is denoted p ⇒ q p is the antecedent or hypothesis q is the consequent or conclusion ⇒ means IF…THEN.
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.
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
Chapter 1 Logic and proofs
Logical Operators (Connectives) We will examine the following logical operators: Negation (NOT,  ) Negation (NOT,  ) Conjunction (AND,  ) Conjunction.
Mathematics for Computing
Propositional Equivalences
Information Technology Department
Presentation transcript:

Mathematics for Computing Lecture 2: Computer Logic and Truth Tables Dr Andrew Purkiss-Trew Cancer Research UK

Logic Propositions Connective Symbols / Logic gates Truth Tables Logic Laws

Propositions Definition: A proposition is a statement that is either true or false. Which ever of these (true or false) is the case is called the truth value of the proposition.

Connectives Compound proposition e.g. ‘If Brian and Angela are not both happy, then either Brian is not happy or Angela is not happy’ Atomic proposition: ‘Brian is happy’ ‘Angela is happy’ Connectives: and, or, not, if-then

Connective Symbols ConnectiveSymbol and ٨ or ٧ not ~ or ¬ if-then → if-and-only-if ↔

Conjugation Logical ‘and’ Symbol ٨ Written p ٨ q Alternative forms p & q, p. q, pq Logic gate version p q pq

Disjunction Logical ‘or’ Symbol ٧ Written p ٧ q Alternative form p + q Logic gate version p q p + q

Negation Logical ‘not’ Symbol ~ Written ~p Alternative forms ¬p, p’, p Logic gate version p~p

Truth Tables p~p TF FT pqp ٨ qp ٨ q TTT TFF FTF FFF pqp ٧ qp ٧ q TTT TFT FTT FFF

Compound Propositions pq~q TTF TFT FTF FFT ~(p ٨ ~q) pq~qp ٨~q TTFF TFTT FTFF FFTF pq~qp ٨~q ~(p ٨ ~q) TTFFT TFTTF FTFFT FFTFT pq TT TF FT FF

Tautologies Always true p~pp ٧ ~p TFT FTT p~pp ٧ ~p TFT FTT

Contradictions Always false p~pp ٨ ~p TFF FTF

Website for Lecture Notes

End of First Logic 1? Place marker

Mathematics for Computing Lecture 3: Computer Logic and Truth Tables 2 Dr Andrew Purkiss-Trew Cancer Research UK

Logical Equivalence Logical ‘equals’ Symbol ≡ Written p ≡ p pq~p~q~p ٨ ~q~(~p ٨ ~q) TTFFFT TFFTFT FTTFFT FFTTTF p ٧ q T T T F

Conditional Logical ‘if-then’ Symbol → Written p → q pqp → q TTT TFF FTT FFT

Biconditional Logical ‘if and only if’ Symbol ↔ Written p ↔ q pqp ↔ q TTT TFF FTF FFT

converse and contrapositive The converse of p → q is q → p The contrapositive of p → q is ~q → ~p

Laws of Logic Laws of logic allow use to combine connectives and simplify propositions.

Double Negative Law ~ ~ p ≡ p

Implication Law p → q ≡ ~ p ٧ q

Equivalence Law p ↔ q ≡ (p → q) ٨ ( q → p)

Idempotent Laws p ٨ p ≡ p p ٧ p ≡ p

Commutative Laws p ٨ q ≡ q ٨ p p ٧ q ≡ q ٧ p

Associative Laws p ٨ (q ٨ r) ≡ ( p ٨ q) ٨ r p ٧ (q ٧ r) ≡ ( p ٧ q) ٧ r

Distributive Laws p ٨ (q ٧ r) ≡ ( p ٨ q) ٧ (p ٨ r) p ٧ (q ٨ r) ≡ ( p ٧ q) ٨ (p ٧ r)

Identity Laws p ٨ T ≡ p p ٧ F ≡ p

Annihilation Laws p ٨ F ≡ F p ٧ T ≡ T

Inverse Laws p ٨ ~p ≡ F p ٧ ~p ≡ T

Absorption Laws p ٨ (p ٧ q) ≡ p p ٧ (p ٨ q) ≡ p

de Morgan’s Laws ~(p ٨ q) ≡ ~p ٧ ~q ~(p ٧ q) ≡ ~p ٨ ~q