CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.

Slides:



Advertisements
Similar presentations
Constructing a Truth Table
Advertisements

CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Prof. Shachar Lovett Clicker frequency: CA CSE 20 Discrete math Prof. Shachar Lovett
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Software Testing Logic Coverage. Introduction to Software Testing (Ch 3) © Ammann & Offutt 2 Logic Coverage Four Structures for Modeling Software Graphs.
Tutorial 1: Logic Peter Poon. Self Introduction You can call me Peter Office: SHB117 Office hour:
Logic ChAPTER 3 1. Truth Tables and Validity of Arguments
Snick  snack CPSC 121: Models of Computation 2011 Winter Term 1 Propositional Logic, Continued Steve Wolfman, based on notes by Patrice Belleville and.
2/17/2008Sultan Almuhammadi1 ICS Logic & Sets (An Overview) Week 1.
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.
Snick  snack CPSC 121: Models of Computation 2010/11 Winter Term 2 Propositional Logic, Continued Steve Wolfman, based on notes by Patrice Belleville.
EE1J2 – Discrete Maths Lecture 5
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Introduction to Software Testing Chapter 8.2
Propositional Logic Lecture 1: Sep 2. Content 1.Mathematical proof (what and why) 2.Logic, basic operators 3.Using simple operators to construct any operator.
Homework 3.
Logic Truth Tables, Propositions, Implications. Statements Logic is the tool for reasoning about the truth or falsity of statements. –Propositional logic.
Truth Tables for Negation, Conjunction, and Disjunction.
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.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Normal or Canonical Forms Rosen 1.2 (exercises). Logical Operators  - Disjunction  - Conjunction  - Negation  - Implication p  q   p  q  - Exclusive.
The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
Discrete Maths 2. Propositional Logic Objective
Chapter 1 The Logic of Compound Statements. Section 1.1 Logical Form and Logical Equivalence.
Propositional Logic Dr. Yasir Ali. Formal or propositional logic was first developed by the ancient Greeks, who wanted to be able to reason carefully.
Valid and Invalid Arguments
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Chapter 5 – Logic CSNB 143 Discrete Mathematical Structures.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
1 Boolean Logic CS 202, Spring 2007 Epp, sections 1.1 and 1.2 Aaron Bloomfield.
Discrete Mathematics Lecture1 Miss.Amal Alshardy.
DISCRETE STRUCTURE Bs (IT).
CSNB143 – Discrete Structure LOGIC. Learning Outcomes Student should be able to know what is it means by statement. Students should be able to identify.
Introduction to Software Testing Chapter 3.6 Disjunctive Normal Form Criteria Paul Ammann & Jeff Offutt
3.3: Truth Tables. Types of Statements Negation: ~p Conjunction: p ˄ q (p and q) Disjunction: p V q (p or q, or both) Conditional: p → q (if p, then q)
Boolean Algebra. Logical Statements A proposition that may or may not be true:  Today is Monday  Today is Sunday  It is raining.
Boolean Logic. Boolean Operators (T/F) xyx AND y FFF FTF TFF TTT xyx OR y FFF FTT TFT TTT xNOT x FT TF.
Chapter 7 Logic, Sets, and Counting
Conditional Statements
CS1022 Computer Programming & Principles Lecture 1 Logic and Proof.
Warmup Answer the following True/False questions in your head: I have brown hair AND I am wearing glasses I am male OR I am wearing sneakers I am NOT male.
How do I show that two compound propositions are logically equivalent?
Chapter 7 Logic, Sets, and Counting Section 1 Logic.
Logical Form and Logical Equivalence Lecture 1 Section 1.1 Wed, Jan 12, 2005.
Boolean Algebra Monday/Wednesday 7th Week. Logical Statements Today is Friday AND it is sunny. Today is Friday AND it is rainy. Today is Monday OR it.
Formal Test for Validity. EVALUATIONS Evaluations An evaluation is an assignment of truth-values to sentence letters. For example: A = T B = T C = F.
Boolean Logic.
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.
Introduction to Software Testing Chapter 3.6 Disjunctive Normal Form Criteria Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 3.6 Disjunctive Normal Form Criteria Paul Ammann & Jeff Offutt
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,
1 Boolean Logic CS/APMA 202, Spring 2005 Rosen, section 1.1 Aaron Bloomfield.
MATH 110 Sec 12-1 Lecture: Intro to Counting Introduction to Counting: Just how many are there?
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
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.
Mathematics for Computing Lecture 2: Computer Logic and Truth Tables Dr Andrew Purkiss-Trew Cancer Research UK
Welcome to Interactive Chalkboard Glencoe Geometry Interactive Chalkboard Copyright © by The McGraw-Hill Companies, Inc. Developed by FSCreations, Inc.,
Assign Yourself and Do Now Thursday, January 10, 2013.
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.
Introduction to Software Testing Chapter 8.2
LOGICAL EQUIVALENCES - DISCRETE MATHEMATICS.
Presentation transcript:

CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA

Todays topics Algorithms: number systems, binary representation Boolean logic Sections 1.3, in Jenkyns, Stephenson

Operations on binary numbers Add, subtract, multiply,… … first, how do we add? A. 111 B. 100 C D E. None of the above

One bit addition

One bit addition

One bit addition Carry: 0 1 1

One bit addition Carry:

How to add binary numbers? ? ? ? ? ?

How to add binary numbers? ? ? ? ? ? ? ? ? (carry) ? ? ? ? ?

How to add binary numbers? Two basic operations: One-Bit-Addition(bit1, bit2, carry) Next-carry(bit1, bit2, carry) ? ? ? ? ? ? ? ? (carry) ? ? ? ? ?

Numbers … logic … circuits

One bit addition One-Bit-Addition(bit1, bit2, carry) Bit1bit2carryOne-Bit-Addition FFFF FFTT FTFT FTTF TFFT TFTF TTFF TTTT T=1 F=0 Can we build this from “basic primitives”?

Logical operators JS pp Truth table is the definition of the operator! PQ P  QP  Q TTT TFF FTF FFF PQP v Q TTT TFT FTT FFF P~P TF FT

Logical operators JS pp PQ P  QP  Q TTT TFF FTF FFF PQP v Q TTT TFT FTT FFF P~P TF FT PQP XOR Q TT? TF? FT? FF? A.T, T, T, F B.T, F, F, T C.F, T, F, T D.F, F, F, T E.None of the above.

OR vs XOR A OR B: Either A, or B, or both A XOR B: Either A, or B, but not both In spoken language, we sometimes confuse them In mathematics, we needs to be precise

OR vs XOR A OR B: Either A, or B, or both A XOR B: Either A, or B, but not both In spoken language, we sometimes confuse them In mathematics, we needs to be precise You are at a restaurant. The menu says you can have either a salad or a soup. Mathematically, this is: A. OR B. XOR C. Both D. Neither

OR vs XOR A OR B: Either A, or B, or both A XOR B: Either A, or B, but not both In spoken language, we sometimes confuse them In mathematics, we needs to be precise You are at a birthday. The host asks: do you want ice-cream or cake (you can have both). Mathematically, this is: A. OR B. XOR C. Both D. Neither

Boolean expressions JS p. 83 How to translate to a truth table? Is there a unique way? A. Yes B. No (P  Q)  (~R)

Boolean expressions How to translate to a truth table? How many rows (not including header)? A. 2 B. 3 C. 4 D. 8 (P  Q)  (~R)

Boolean expressions PQR PQPQ ~R (P  Q)  (~R) FFF FFT FTF FTT TFF TFT TTF TTT

Boolean expressions PQR PQPQ ~R (P  Q)  (~R) FFFF FFTF FTFF FTTF TFFF TFTF TTFT TTTT

Boolean expressions PQR PQPQ ~R (P  Q)  (~R) FFFFT FFTFF FTFFT FTTFF TFFFT TFTFF TTFTT TTTTF

Boolean expressions PQR PQPQ ~R (P  Q)  (~R) FFFFTT FFTFFF FTFFTT FTTFFF TFFFTT TFTFFF TTFTTT TTTTFT

Truth table to expression PQR??? TTTT TTFT TFTT TFFF FTTF FTFF FFTT FFFF

DNFs DNF = Disjunctive Normal Form Literal: variable or its negation: P, ~P Term: AND of literals: P  ~Q DNF: OR of terms: (P  ~Q)  (R  P)  ~P Theorem: any Boolean expression can be written as a DNF

Truth table to expression PQR??? TTTT TTFT TFTT TFFF FTTF FTFF FFTT FFFF

Truth table to expression PQR??? TTTT TTFT TFTT TFFF FTTF FTFF FFTT FFFF PQRPQR P  Q  ~R P  ~Q  R ~P  ~Q  R (P  Q  R)  (P  Q  ~R)  (P  ~Q  R)  (~P  ~Q  R)

Truth tables and Circuits T“1”High voltage F“0”Low voltage

4 bit adder

Next class Quantifiers and paradoxes Read sections in Jenkyns, Stephenson Google “liar’s paradox”