CSRU 1100 Logic. Logic is concerned with determining: Is it True? Is it False?

Slides:



Advertisements
Similar presentations
Chapter 21: Truth Tables.
Advertisements

Truth Tables How to Make and Use. Making a Truth Table To determine the number of rows other than the heading row. To determine the number of rows other.
1 If Control Construct A mechanism for deciding whether an action should be taken JPC and JWD © 2002 McGraw-Hill, Inc.
Conditional Propositions and Logical Equivalence.
 Instructor Nash  Readings: Savitch, Chapter 3 (Section 3)  CSS 161 V2.0.
Boolean Types & Compound Conditionals CSC 1401: Introduction to Programming with Java Lecture 4 – Part 3 Wanda M. Kunkle.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
Today’s Topics n Review Logical Implication & Truth Table Tests for Validity n Truth Value Analysis n Short Form Validity Tests n Consistency and validity.
Meaning and Language Part 1.
Programming – Touch Sensors Intro to Robotics. The Limit Switch When designing robotic arms there is always the chance the arm will move too far up or.
The Language of Propositional Logic The Syntax and Semantics of PL.
Copyright © Cengage Learning. All rights reserved.
Spelling Lists. Unit 1 Spelling List write family there yet would draw become grow try really ago almost always course less than words study then learned.
Adapted from Discrete Math
Propositional Logic Review
SAT Prep- Reading Comprehension Strategies- Short Passages
Positional Number Systems
Welcome to CS/MATH 320L – Applied Discrete Mathematics Spring 2015
Intro to Discrete Structures
14 Days Until CAHSEE!!! 15 February  Essay Revision Questions are based on the text of brief rough drafts, and they appear in two basic forms:
Propositions and Truth Tables
Valid Arguments Decide if each argument is valid. If the stones are rolling, they are not gathering moss. If the stones are not gathering moss, they are.
Section 1-4 Logic Katelyn Donovan MAT 202 Dr. Marinas January 19, 2006.
Boolean Algebra – the ‘Lingua Franca’ of the Digital World The goal of developing an automata is based on the following (loosely described) ‘ideal’: if.
Computers in the real world Objectives Understand what is meant by binary Why do computers use binary? Understand what is meant by a truth table. Be able.
 Predicate: A sentence that contains a finite number of variables and becomes a statement when values are substituted for the variables. ◦ Domain: the.
Truth Functions Relationships A function is a relation that links members of sets. The set of all x which are in relation R with some y is called the.
Review I Rosen , 3.1 Know your definitions!
Dr. Amer Rasheed COMSATS Institute of Information Technology
Chapter 1 Section 1.2 Symbolic Logic. Sentences vs Statements A truth value is one of two words either true (T) or false (F). A statement is a particular.
F22H1 Logic and Proof Week 6 Reasoning. How can we show that this is a tautology (section 11.2): The hard way: “logical calculation” The “easy” way: “reasoning”
Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 3.7 Switching Circuits.
Collecting Things Together - Lists 1. We’ve seen that Python can store things in memory and retrieve, using names. Sometime we want to store a bunch of.
5 BASIC CONCEPTS OF ANY PROGRAMMING LANGUAGE Let’s get started …
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Logic Disjunction A disjunction is a compound statement formed by combining two simple sentences using the word “OR”. A disjunction is true when at.
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Chapter 7 Review Important Terms, Symbols, Concepts 7.1. Logic A proposition is a statement (not a question.
1 Compound Assignment C++ has a large set of operators for applying an operation to an object and then storing the result back into the object Examples.
Lecture #6 OPERATORS AND ITS TYPES By Shahid Naseem (Lecturer)
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
Activity 1-19: The Propositional Calculus
22/11/ Selection If selection construct.
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
1 Chapter 4, Part 1 If Control Construct A mechanism for deciding whether an action should be taken JPC and JWD © 2002 McGraw-Hill, Inc. Modified by S.
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
Artificial Intelligence 7. Making Deductive Inferences Course V231 Department of Computing Imperial College, London Jeremy Gow.
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
By: Mr. Baha Hanene Chapter 6. LEARNING OUTCOMES This chapter will cover the learning outcome 02 i.e. 2.Use basic data-types and input / output in C programs.
Boolean values Gateway to decision making. Background Our problem-solving solutions so far have the straight-line property –They execute the same statements.
1 Propositional Logic: Fundamental Elements for Computer Scientists 0. Motivation for Computer Scientists 1. Propositions and Propositional Variables 2.
31/01/ Selection If selection construct.
1 CS161 Introduction to Computer Science Topic #6.
Activity 1 Revise/research what the word binary means Revise/research what the word logic means 5 minutes.
Models of Computation: Automata and Formal Languages Sam M. Kim.
Learning Objectives  To define a proposition  To form a compound proposition using connectives  To determine the truth values of compound propositions.
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.
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 15, 2004 Lecture Number: 11.
Symbolic Logic and Rules of Inference. whatislogic.php If Tom is a philosopher, then Tom is poor. Tom is a philosopher.
Propositional and predicate logic
Notions & Notations - 1ICOM 4075 (Fall 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Fall 2010 ICOM.
Logic.
Conditional Statements
DISCRETE MATHEMATICS CHAPTER I.
Lecture 1 – Formal Logic.
Programming – Touch Sensors
Truth Functions.
If selection construct
The Logic of Declarative Statements
Section 3.7 Switching Circuits
Compounding.
Presentation transcript:

CSRU 1100 Logic

Logic is concerned with determining: Is it True? Is it False?

Statements we could make Some statements are obviously true 1. Barack Obama is the President of the United States 2. We live on the planet Mars Some statements are obviously false

Some statements we don’t know one way or the other (but we know that have to be one or the other) 3. The integer x is an even number.

Some statements we actually can’t give a value of true or false to… How are you feeling? So these types of statements are not going to interest us.

Using a compact representation Sometimes we don’t want to get bogged down with sentences from a language like English… or perhaps we don’t even know what sentence we would use. In these cases we can refer generically to such sentences with one letter place holders

We could represent a sentence as: p

or q

So what does the symbol p represent? It refers to one of the English logic statements we saw earlier. It could be the logical statement “Pigs are blue” or it could be “There are 50 states in the US”

Now we don’t know very much about these generic statements that we just learned to represent (we certainly don’t know what they mean) But since these all represent logical statements we do know something Each one of these must have a value that is either TRUE or FALSE

So if I ask you the value of p You would say that it is either TRUE or FALSE And that’s good enough, we really don’t care so much about which one it actually is (at least not yet)

What if we give you more than one generic statement? p q What are their values? Well p is either TRUE or FALSE. and q is either TRUE or FALSE.

So what are their values when they are together? p could be TRUE and q could be TRUE p could be FALSE and q could be FALSE p could be TRUE and q could be FALSE p could be FALSE and q could be TRUE

So there are 4 different scenarios to think about when there are 2 generic statements.

What if I have 3 things? abc Ok, each of them individually could be TRUE or FALSE, so what are all of the possibilities when they get together?

Keeping track of all possibilities Going back to just p and q for a moment we could make a small table to show all of the possibilities PQ Option #1 TRUETRUE Option #2 TRUEFALSE Option #3 FALSETRUE Option #4 FALSEFALSE

For 3 generic variables we would then have ABC Option #1 TRUETRUETRUE Option #2 TRUETRUEFALSE Option #3 TRUEFALSETRUE Option #4 TRUEFALSEFALSE Option #5 FALSETRUETRUE Option #6 FALSETRUEFALSE Option #7 FALSEFALSETRUE Option #8 FALSEFALSEFALSE

When we arrange things this way it is called a truth table. Truth tables allow us to organize our logical statements so that we can examine all of the possible values in an easy to write and easy to read format.

Logical Connectives Logic wouldn’t be any fun if we didn’t have any way of combining different logical statements Logic wouldn’t be any fun if we didn’t have any way of combining different logical statements I could say I could say –“I am going to the movies” –“I am going to the grocery store” Each of these on their own would certainly have its own logical value but when we add in logical connectives we have a way of discovering other things Each of these on their own would certainly have its own logical value but when we add in logical connectives we have a way of discovering other things

Things I could say It is NOT the case that “I am going to the movies” It is NOT the case that “I am going to the movies” “I am going to the movies” AND “I am going to the grocery store” “I am going to the movies” AND “I am going to the grocery store” “I am going to the movies” OR “I am going to the grocery store” “I am going to the movies” OR “I am going to the grocery store” IF “I am going to the movies” THEN “I am going to the grocery store” IF “I am going to the movies” THEN “I am going to the grocery store”

The connective NOT NOT reverses the meaning of whatever statement it is put in front of Unfortunately there are lots of different notations for NOT… some of these are

More NOT So I could make a really simple truth table for p and describe what the NOT of it would be p TRUEFALSE TRUE

The Connective AND And connects things in logic just the way it does in English. And connects things in logic just the way it does in English. If I ask you whether the statement “I am going to the movies AND I am going to the grocery store” is TRUE or FALSE, you would look at the TRUE and FALSE values for each part of the statement. If I ask you whether the statement “I am going to the movies AND I am going to the grocery store” is TRUE or FALSE, you would look at the TRUE and FALSE values for each part of the statement. If both parts were true then the whole this is TRUE otherwise it is FALSE If both parts were true then the whole this is TRUE otherwise it is FALSE

Truth Table for AND pq TRUE FALSE TRUEFALSE

The Connective OR It doesn’t work exactly the way English does. It doesn’t work exactly the way English does. Two statements that are connected with OR are FALSE if both statements are FASLE, otherwise it is TRUE Two statements that are connected with OR are FALSE if both statements are FASLE, otherwise it is TRUE

Truth Table for OR pq TRUE FALSETRUE FALSETRUE FALSE

The Connective IMPLIES IMPLIES is basically creating a rule that if something occurs then something else will happen. IMPLIES is basically creating a rule that if something occurs then something else will happen. Just because it sounds like a rule does not mean it actually is a true rule. Just because it sounds like a rule does not mean it actually is a true rule. Think about the rule “If you kill someone then you will go to jail.” Think about the rule “If you kill someone then you will go to jail.” It sounds pretty good but it actually is not a true rule. It sounds pretty good but it actually is not a true rule. Rules are FALSE if the first part of the statement is TRUE and yet the second part of the statement is FALSE. All other circumstances mean that the rule is true. Rules are FALSE if the first part of the statement is TRUE and yet the second part of the statement is FALSE. All other circumstances mean that the rule is true.

Truth Table for IMPLIES pq TRUE FALSE TRUE FALSE TRUE

Now we can put it all together and ask questions such as What is the value of You can create a corresponding truth table.

Results of Truth Tables Sometimes you find out that regardless of which TRUE/FALSE scenario you are dealing with, the answer is always TRUE. These types of logical statements are known as tautologies. Sometimes you find out that regardless of which TRUE/FALSE scenario you are dealing with, the answer is always TRUE. These types of logical statements are known as tautologies. Sometimes all the possibilities end up being FALSE. These are called contradictions. Sometimes all the possibilities end up being FALSE. These are called contradictions.

However Most of the time, you end up with all kinds of different possibilities when you complete the truth table Most of the time, you end up with all kinds of different possibilities when you complete the truth table That’s perfectly normal and to be expected That’s perfectly normal and to be expected

Hints on completing truth tables Break each column of your table into dealing with only one logical connective at a time… this will reduce logic errors Break each column of your table into dealing with only one logical connective at a time… this will reduce logic errors Use the parentheses as your guide for how to break the statement down. Use the parentheses as your guide for how to break the statement down. Do not try to perform any transformations on the logic statement outside of those that have been taught. Do not try to perform any transformations on the logic statement outside of those that have been taught.

One more thing People and problems often use the phrase “show two statements are equivalent” People and problems often use the phrase “show two statements are equivalent” All this means is that when you complete the truth table for both of them then the have the same values all the way down the column in the truth table. All this means is that when you complete the truth table for both of them then the have the same values all the way down the column in the truth table.

Practice