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

Similar documents
CSE 20. Final Review. CSE 20: Final Review

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

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

CSE 20 DISCRETE MATH. Fall

CSE 240 Logic and Discrete Mathematics

Logical Structures in Natural Language: Propositional Logic II (Truth Tables and Reasoning

Announcements. CSE 321 Discrete Structures. Counting. Counting Rules. Important cases of the Product Rule. Counting examples.

CSE 1400 Applied Discrete Mathematics Definitions

Lecture 4: Counting, Pigeonhole Principle, Permutations, Combinations Lecturer: Lale Özkahya

Automata Theory and Formal Grammars: Lecture 1

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Section 3.1. Statements and Logical Connectives. Copyright 2013, 2010, 2007, Pearson, Education, Inc.

Theory of Computation

Introduction to Automata

Discrete Mathematics and Its Applications

Discrete Mathematics. Instructor: Sourav Chakraborty. Lecture 4: Propositional Logic and Predicate Lo

CSI30. Chapter 2. Basic Structures: Sets, Functions, Sequences, Sums. 2.1 Sets and subsets 2.2 Sets of sets

A statement is a sentence that is definitely either true or false but not both.

CSE 20 DISCRETE MATH WINTER

CS 2336 Discrete Mathematics

CSE 20 DISCRETE MATH SPRING

Discrete Mathematics. Kenneth A. Ribet. January 31, 2013

CSE 20 DISCRETE MATH. Winter

With Question/Answer Animations. Chapter 2

Welcome to MAT 137! Course website:

Tutorial on Axiomatic Set Theory. Javier R. Movellan

Lecture 4: Proposition, Connectives and Truth Tables

Chapter Summary. Sets The Language of Sets Set Operations Set Identities Functions Types of Functions Operations on Functions Computability

Lecture 3: Semantics of Propositional Logic

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Discrete Mathematics & Mathematical Reasoning Chapter 6: Counting

Theory of Computation Lecture 1. Dr. Nahla Belal

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007)

CPSC 121 Sample Final Examination December 2013

Notes for Lecture Notes 2

CSE 200 Lecture Notes Turing machine vs. RAM machine vs. circuits

Digital Systems and Information Part II

Equational Logic and Term Rewriting: Lecture I

Proving languages to be nonregular

ICS141: Discrete Mathematics for Computer Science I

CSCI3390-Lecture 6: An Undecidable Problem

Background for Discrete Mathematics

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.

Logic Synthesis and Verification

Counting Methods. CSE 191, Class Note 05: Counting Methods Computer Sci & Eng Dept SUNY Buffalo

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

1.2 Inductive Reasoning

CISC-102 Fall 2018 Week 11

MAT2345 Discrete Math

cse541 LOGIC FOR COMPUTER SCIENCE

CS61c: Representations of Combinational Logic Circuits

Compound Propositions

Topic 1: Propositional logic

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

3. Abstract Boolean Algebras

COMP 2600: Formal Methods for Software Engineeing

Math 31 Lesson Plan. Day 2: Sets; Binary Operations. Elizabeth Gillaspy. September 23, 2011

Announcements. Exam 1 Review

Decidable Languages - relationship with other classes.

HW1 graded review form? HW2 released CSE 20 DISCRETE MATH. Fall

Sec$on Summary. Definition of sets Describing Sets

4 Switching Algebra 4.1 Axioms; Signals and Switching Algebra

Computation and Logic Definitions

Lecture 10: Synchronous Sequential Circuits Design

COMP Logic for Computer Scientists. Lecture 16

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

MODULE- 07 : FLUIDICS AND FLUID LOGIC

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

THE LOGIC OF COMPOUND STATEMENTS

THE LOGIC OF COMPOUND STATEMENTS

Predicate Logic: Sematics Part 1

1 Propositional Logic

Outline. EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits) Combinational Logic (CL) Defined

Discrete Mathematics and Applications COT3100

Theory of Computation

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

Topics in Logic and Proofs

Discrete Mathematics: Lectures 6 and 7 Sets, Relations, Functions and Counting Instructor: Arijit Bishnu Date: August 4 and 6, 2009

1. Foundations of Numerics from Advanced Mathematics. Mathematical Essentials and Notation

Digital Logic Design: a rigorous approach c

MATH 114 Fall 2004 Solutions to practice problems for Final Exam

Lecture 8: Sequential Networks and Finite State Machines

Math Lecture 3 Notes

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

NP-Complete Problems. Complexity Class P. .. Cal Poly CSC 349: Design and Analyis of Algorithms Alexander Dekhtyar..

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

Theory of Computation 1 Sets and Regular Expressions

1 Reals are Uncountable

1. Introduction to commutative rings and fields

Functions based on sin ( π. and cos

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

CS3110 Fall 2013 Lecture 11: The Computable Real Numbers, R (10/3)

Adequate set of connectives, logic gates and circuits

COMP1002 exam study sheet

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

1.2 The Role of Variables

CSCI 2670 Introduction to Theory of Computing

3F1 Information Theory, Lecture 3

CSE 20: Discrete Mathematics

Chapter 4: Classical Propositional Semantics

Transcription:

CSE 20 Lecture 4: Introduction to Boolean algebra

Reminder First quiz will be on Friday (17th January) in class. It is a paper quiz. Syllabus is all that has been done till Wednesday. If you want you may bring a calculator

Base b representation

Base b representation Digits: 0, 1,..., b 1

Base b representation Digits: 0, 1,..., b 1 Represented as [x] b. (Like [22001] 3 )

Base b representation Digits: 0, 1,..., b 1 Represented as [x] b. (Like [22001] 3 ) Base b representation of a number x is the unique way of writing x = x 0 b 0 + x 1 b 1 + + x k b k, where x 0, x 1,..., x k {0, 1,..., (b 1)}

Algorithm for finding representaation in base b We can find a representation in base b using GREEDY METHOD.

Unique representation in base b Can an integer be written in base b in two different ways? Answer may be obvious but we need to prove it mathematically.

Mathematical formulation of the unique representation in base b problem Let N be a number that be write in base b.

Mathematical formulation of the unique representation in base b problem Let N be a number that be write in base b. Let there be two different representation in base b: N = x 0 b 0 + x 1 b 1 + + x k b k,

Mathematical formulation of the unique representation in base b problem Let N be a number that be write in base b. Let there be two different representation in base b: N = x 0 b 0 + x 1 b 1 + + x k b k, N = y 0 b 0 + y 1 b 1 + + y k b k. Is it possible that there exists ( ) i such that x i y i?

Proof style We prove by contradiction.

Proof style We prove by contradiction. We assume that a number can be written in two different ways

Proof style We prove by contradiction. We assume that a number can be written in two different ways Then using this assumption we conclude that something seriously wrong happens, like 2 l < 2 l

Proof style We prove by contradiction. We assume that a number can be written in two different ways Then using this assumption we conclude that something seriously wrong happens, like 2 l < 2 l So we conclude that the original assumption was wrong.

Mathematical logic

Mathematical logic Every statement (proposition) is either TRUE or FALSE.

Mathematical logic Every statement (proposition) is either TRUE or FALSE. A statement can have an unspecified term, called variable. Statements are connected to each other by 5 connectives: AND, OR, NOT, IMPLIES and IFF.

The IMPLIES ( = ) p q p = q F F T F T T T F F T T T

The AND ( ) p q p q F F F F T F T F F T T T

The OR ( ) p q p q F F F F T T T F T T T T

The IMPLIES ( = ) p q p = q F F T F T T T F F T T T

The IFF ( ) p q p q F F T F T F T F F T T T

The NOT ( ) p p F T T F

Universality Every logical sentance can be written using the AND, OR, NOT, IMPLIES, IFF and two more symbols: There exists, For all,

Proof by contradiction p q p = q F F T F T T T F F T T T

Base b representation

Base b representation Digits: 0, 1,..., b 1

Base b representation Digits: 0, 1,..., b 1 Represented as [x] b. (Like [22001] 3 )

Base b representation Digits: 0, 1,..., b 1 Represented as [x] b. (Like [22001] 3 ) Base b representation of a number x is the unique way of writing x = x 0 b 0 + x 1 b 1 + + x k b k, where x 0, x 1,..., x k {0, 1,..., (b 1)}

Binary Representation When one represent a number in base 2 it is called binary representation.

Binary Representation When one represent a number in base 2 it is called binary representation. Sometimes called Boolean representation after English mathematician George Boole.

Binary Representation When one represent a number in base 2 it is called binary representation. Sometimes called Boolean representation after English mathematician George Boole. Computer talks in this language.

The world of the computers

The world of the computers Every number is stored in binary

The world of the computers Every number is stored in binary Every number has a certain length (depending of the register size). For example: If the register size is 8 then 1 is stored as 00000001.

The world of the computers Every number is stored in binary Every number has a certain length (depending of the register size). For example: If the register size is 8 then 1 is stored as 00000001. Cannot store more than a certain number of digits.

Computer Addition Let the register size in a computer is 8 bits. Let x = 11111111 and y = 00000001

Computer Addition Let the register size in a computer is 8 bits. Let x = 11111111 and y = 00000001 What is x + y?

Computer Addition Let the register size in a computer is 8 bits. Let x = 11111111 and y = 00000001 What is x + y? Ans: x + y = 100000000.

Computer Addition Let the register size in a computer is 8 bits. Let x = 11111111 and y = 00000001 What is x + y? Ans: x + y = 100000000. But the computer sees only the last 8 digits. So it sees 00000000.

Boolean Algebra

Boolean Algebra Boolean Algebra has two basic digit: 1 and 0.

Boolean Algebra Boolean Algebra has two basic digit: 1 and 0. One can think of these as T rue and F alse

Boolean Algebra Boolean Algebra has two basic digit: 1 and 0. One can think of these as T rue and F alse Used to represent data and used in logic.

Representing Data as sets Sets

Representing Data as sets Sets For example: Set of names of all students

Representing Data as sets Sets For example: Set of names of all students Set of letters in the english alphabet

Representing Data as sets Sets For example: Set of names of all students Set of letters in the english alphabet Set of digits. {0, 1,..., 9} or {0, 1}

Representing Data as sets Sets For example: Set of names of all students Set of letters in the english alphabet Set of digits. {0, 1,..., 9} or {0, 1} Unordered Sets

Representing Data as sets Sets For example: Set of names of all students Set of letters in the english alphabet Set of digits. {0, 1,..., 9} or {0, 1} Unordered Sets Ordered Sets (Also called LIST/STRINGS/VECTORS)

Cartesian Product

Cartesian Product Let A be a set A n is the set of all ordered subsets (with repetitions) A of size n

Cartesian Product Let A be a set A n is the set of all ordered subsets (with repetitions) A of size n {0, 1} n the set of all strings of 0 and 1 of length n.

A little bit of counting Q: How many elements are there in the set {0, 1} n?

A little bit of counting Q: How many elements are there in the set {0, 1} n? Ans: 2 n.