Truth and Logic. Brief Introduction to Boolean Variables. INFO-1301, Quantitative Reasoning 1 University of Colorado Boulder

Similar documents
Probability Basics. Part 3: Types of Probability. INFO-1301, Quantitative Reasoning 1 University of Colorado Boulder

CSE 20. Lecture 4: Introduction to Boolean algebra. CSE 20: Lecture4

BOOLEAN ALGEBRA INTRODUCTION SUBSETS

2. Associative Law: A binary operator * on a set S is said to be associated whenever (A*B)*C = A*(B*C) for all A,B,C S.

Introduction to Quantum Logic. Chris Heunen

Equivalence and Implication

Set Theory Basics of Set Theory. 6.2 Properties of Sets and Element Argument. 6.3 Algebraic Proofs 6.4 Boolean Algebras.

Note: The area of logic that deals with propositions is called the propositional calculus or propositional logic.

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

Logic, Sets, and Proofs

CISC-102 Winter 2016 Lecture 17

Axioms of Probability

Computer Organization: Boolean Logic

Logic Synthesis and Verification

Section 2.2 Set Operations. Propositional calculus and set theory are both instances of an algebraic system called a. Boolean Algebra.

Set Theory Basics of Set Theory. mjarrar Watch this lecture and download the slides

6.1 Logic. Statements or Propositions. Negation. The negation of a statement, p, is not p and is denoted by p Truth table: p p

Lecture 2: Axiomatic semantics

Lecture 4: More Boolean Algebra

Boolean algebra. Examples of these individual laws of Boolean, rules and theorems for Boolean algebra are given in the following table.

Solutions to Homework I (1.1)

CprE 281: Digital Logic

ELEC Digital Logic Circuits Fall 2014 Boolean Algebra (Chapter 2)

Doc112: Hardware. Department of Computing, Imperial College London. Doc112: Hardware Lecture 1 Slide 1

Lecture : Set Theory and Logic

CS 173: Discrete Structures. Eric Shaffer Office Hour: Wed. 1-2, 2215 SC

Lecture 3: Semantics of Propositional Logic

Review CHAPTER. 2.1 Definitions in Chapter Sample Exam Questions. 2.1 Set; Element; Member; Universal Set Partition. 2.

Lecture 4. Algebra, continued Section 2: Lattices and Boolean algebras

Background for Discrete Mathematics

Dealing with Uncertainty. CS 331: Artificial Intelligence Probability I. Outline. Random Variables. Random Variables.

Lecture 3: Boolean Algebra

Phil Introductory Formal Logic

CISC-102 Fall 2018 Week 11

3 Boolean Algebra 3.1 BOOLEAN ALGEBRA

cse 311: foundations of computing Spring 2015 Lecture 3: Logic and Boolean algebra

Unit 2 Boolean Algebra

CS61c: Representations of Combinational Logic Circuits

Proving simple set properties...

Math 13, Spring 2013, Lecture B: Midterm

CAIM: Cerca i Anàlisi d Informació Massiva

CM10196 Topic 2: Sets, Predicates, Boolean algebras

Digital Logic Design: a rigorous approach c

What is Binary? Digital Systems and Information Representation. An Example. Physical Representation. Boolean Algebra

2 Truth Tables, Equivalences and the Contrapositive

WEEK 2.1 BOOLEAN ALGEBRA

CS 2336 Discrete Mathematics

Discrete Mathematics

Artificial Intelligence

CS 226: Digital Logic Design

Homework 4 Solutions

4 Switching Algebra 4.1 Axioms; Signals and Switching Algebra

Supplementary Material for MTH 299 Online Edition

University of Sheffield. School of Mathematics & and Statistics. Measure and Probability MAS350/451/6352

Computer Organization I

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

RISK-INFORMED OPERATIONAL DECISION MANAGEMENT (RIODM): RISK, EVENT TREES AND FAULT TREES

CS 331: Artificial Intelligence Probability I. Dealing with Uncertainty

Assignments. Math 215. Fall 2009.

CS 173 Lecture 2: Propositional Logic

Outline. Introduction, or what is fuzzy thinking? Fuzzy sets Linguistic variables and hedges Operations of fuzzy sets Fuzzy rules Summary.

3. Abstract Boolean Algebras

UC Berkeley College of Engineering, EECS Department CS61C: Representations of Combinational Logic Circuits

With Question/Answer Animations. Chapter 2

ICS141: Discrete Mathematics for Computer Science I

Adequate set of connectives, logic gates and circuits

AMTH140 Lecture 8. Symbolic Logic

Propositions. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 5.1, Page 1

COSC 243. Introduction to Logic And Combinatorial Logic. Lecture 4 - Introduction to Logic and Combinatorial Logic. COSC 243 (Computer Architecture)

Discrete Mathematics. W. Ethan Duckworth. Fall 2017, Loyola University Maryland

Symbolic Logic Outline

A Primer on Boole s Algebra of Logic for Classes

Nonlinear Classification

Chapter 2: Switching Algebra and Logic Circuits

Chapter 4. Basic Set Theory. 4.1 The Language of Set Theory

Theory of Computation

Maryam Al-Towailb (KSU) Discrete Mathematics and Its Applications Math. Rules Math. of1101 Inference 1 / 13

1.1 Introduction to Sets

MODULE- 07 : FLUIDICS AND FLUID LOGIC

PRINCIPLE OF MATHEMATICAL INDUCTION

Introduction. Foundations of Computing Science. Pallab Dasgupta Professor, Dept. of Computer Sc & Engg INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

A Collection of Problems in Propositional Logic

CHAPTER 6. Copyright Cengage Learning. All rights reserved.

EEE130 Digital Electronics I Lecture #4

Boolean Algebra. The Building Blocks of Digital Logic Design. Section. Section Overview. Binary Operations and Their Representation.

Support Vector Machines

Boolean algebra. Values

Propositional Logic, Predicates, and Equivalence

Sets. Introduction to Set Theory ( 2.1) Basic notations for sets. Basic properties of sets CMSC 302. Vojislav Kecman

Review: Additional Boolean operations

CS21 Decidability and Tractability

Self-reproducing programs. And Introduction to logic. COS 116, Spring 2012 Adam Finkelstein

Boolean Algebra CHAPTER 15

Derivatives. INFO-1301, Quantitative Reasoning 1 University of Colorado Boulder. April 26-28, 2017 Prof. Michael Paul

A Boolean Approach to Qualitative Comparison. A summary by Richard Warnes. Charles Ragin (1987) THE COMPARATIVE METHOD. Chapter 6

Semantics of intuitionistic propositional logic

18.S097 Introduction to Proofs IAP 2015 Lecture Notes 1 (1/5/2015)

. T SHREE MAHAPRABHU PUBLIC SCHOOL & COLLEGE NOTES FOR BOARD EXAMINATION SUBJECT COMPUTER SCIENCE (Code: 083) Boolean Algebra

A B is shaded A B A B

Today s topics. Introduction to Set Theory ( 1.6) Naïve set theory. Basic notations for sets

Transcription:

Truth and Logic Brief Introduction to Boolean Variables INFO-1301, Quantitative Reasoning 1 University of Colorado Boulder February 13, 2017 Prof. Michael Paul Prof. William Aspray

Overview This lecture will introduce boolean variables and operations, provide another way to think about sets, and teach you how to describe what s true in this world. Boolean logic plays an important role in modern information systems and computational design.

Another type of variable The variables we ve seen so far describe properties of the world: ColorOfSky = Blue We can also create variables that correspond to statements about the world The sky is blue = True

Another type of variable A boolean variable represents a statement about the world called a proposition Propositions have values like other variables, usually called truth values Domain of a boolean variable: {True, False} Example: Let P be the proposition the Broncos won Super Bowl 50 P = True

Another type of variable A boolean variable represents a statement about the world called a proposition Propositions have values like other variables, usually called truth values Domain of a boolean variable: {True, False} Example: Let Q be the proposition the Panthers won Super Bowl 50 Q = False

Another type of variable Boolean variables were invented by philosophers to reason about the world If we know that certain statements are true or false, we can make conclusions about the truth value of other statements George Boole, 1815-1864

Boolean operations With numerical variables, we have operations like addition and multiplication With sets, we have operations like union, intersection, and complement Boolean variables have their own operations: AND, OR, NOT

Boolean operations P = the Broncos won Super Bowl 50 Q = the Panthers won Super Bowl 50 = True = False We can combine these two propositions to create a new proposition with its own truth value

Boolean operations: AND P = the Broncos won Super Bowl 50 Q = the Panthers won Super Bowl 50 = True = False Notation: P Q = the Broncos won Super Bowl 50 AND the Panthers won Super Bowl 50 = False AND propositions are only true if every part of the proposition is true P = True AND Q = True

Boolean operations: AND P = the Broncos won Super Bowl 50 = True Q = the Broncos won Super Bowl XXXIII = True Notation: P Q = the Broncos won Super Bowl 50 AND the Broncos won Super Bowl XXXIII = True

Boolean operations: AND P = the Broncos won Super Bowl 50 = True Q = the Broncos won Super Bowl XLVIII = False Notation: P Q = the Broncos won Super Bowl 50 AND the Broncos won Super Bowl XLVIII = False

Boolean operations: OR P = the Broncos won Super Bowl 50 Q = the Panthers won Super Bowl 50 = True = False Notation: P Q = the Broncos won Super Bowl 50 OR the Panthers won Super Bowl 50 = True OR propositions are true if either part of the proposition is true P = True OR Q = True

Boolean operations: OR P = the Broncos won Super Bowl XLVIII = False Q = the Panthers won Super Bowl 50 = False Notation: P Q = the Broncos won Super Bowl XLVIII OR the Panthers won Super Bowl 50 = False

Boolean operations: NOT P = the Broncos won Super Bowl 50 = True Notation: P = NOT the Broncos won Super Bowl 50 = False NOT propositions are the opposite of the original proposition If P = True then P = False If P = False then P = True

Boolean operations You should become familiar with the 3 operations: AND: P Q OR: NOT: P P Q Doing algebra with boolean variables is called boolean logic You can combine the operations to create even longer propositions (P R) (Q S) (P Q R)

Boolean operations You should become familiar with the 3 operations: AND: P Q OR: NOT: P P Q Do these operations look familiar?

Boolean operations Similar to set operations: AND: P Q Intersection: A B OR: P Q Union: A B NOT: P Complement: A

Describing set membership P = the number 1 is in the set of evens, E P = False Q = the number 1 is in the set of odds, O Q = True Is the number 1 in E O? P Q = True Is the number 1 in E O? P Q = False

Describing set membership P = the number 1 is in the set of evens, E P = False Q = the number 1 is in the set of odds, O Q = True Is the number 1 in E? P = True Is the number 1 in O? Q = False

Boolean logic in data Boolean expressions can help you query for data Suppose you have a dataset of cats, and you want to test a theory that male cats that are orange and heavier than 13 lbs are friendlier than all other cats Want to compare average temperament of two sets: Cats that are male, orange, and weight 13 lbs All other cats (the complement of the first set)

Boolean logic in data Want to compare average temperament of two sets: Cats that are male, orange, and weight 13 lbs All other cats (the complement of the first set) The way you typically select subsets of data in software is using boolean expressions Set 1: cat is male AND cat is orange AND cat s weight is 13 lbs

Boolean logic in data Want to compare average temperament of two sets: Cats that are male, orange, and weight 13 lbs All other cats (the complement of the first set) The way you typically select subsets of data in software is using boolean expressions Set 2: NOT (cat is male AND cat is orange AND cat s weight is 13 lbs)

Boolean logic in data Important to understand boolean logic so that you can construct the correct query for what you want For example, understand that these statements all have the same meaning: NOT(cat is male AND cat is orange AND weight 13) cat is not male OR cat is not orange OR weight is not 13 cat is not male OR cat is not orange OR weight is < 13

Some rules to know (P Q) = P Q (P Q) = P Q P Q = ( P Q ) P Q = ( P Q ) P = P (P Q)