ICS141: Discrete Mathematics for Computer Science I

Similar documents
Discrete Mathematics and Applications COT3100

Propositional logic ( ): Review from Mat 1348

Introduction Propositional Logic

ARTIFICIAL INTELLIGENCE

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

Compound Propositions

Discrete Mathematics

ICS141: Discrete Mathematics for Computer Science I

CSE 240 Logic and Discrete Mathematics

An Introduction to Logic 1.1 ~ 1.4 6/21/04 ~ 6/23/04

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

Introduction. Applications of discrete mathematics:

EECS 1028 M: Discrete Mathematics for Engineers

CSC Discrete Math I, Spring Propositional Logic

CSE 20 DISCRETE MATH. Fall

The Fundamentals of Logic. Foundations of Logic. Foundations of Logic. CMSC 302 Propositional Logic. In Rosen, ~98 slides, ~3 lectures

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

DISCRETE STRUCTURES WEEK5 LECTURE1

Truth-Functional Logic

MAT2345 Discrete Math

Section 1.1 Propositional Logic. proposition : true = T (or 1) or false = F (or 0) (binary logic) the moon is made of green cheese

Discrete Structures for Computer Science

Overview. 1. Introduction to Propositional Logic. 2. Operations on Propositions. 3. Truth Tables. 4. Translating Sentences into Logical Expressions

Chapter 1, Section 1.1 Propositional Logic

Course Staff. Textbook

CS 340: Discrete Structures for Engineers

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

Sec$on Summary. Propositions Connectives. Truth Tables. Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional

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

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

Today s Topic: Propositional Logic

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Lecture 4: Proposition, Connectives and Truth Tables

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

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

THE LOGIC OF COMPOUND STATEMENTS

Proposition/Statement. Boolean Logic. Boolean variables. Logical operators: And. Logical operators: Not 9/3/13. Introduction to Logical Operators

CS Module 1. Ben Harsha Apr 12, 2017

ICS141: Discrete Mathematics for Computer Science I

15414/614 Optional Lecture 1: Propositional Logic

Packet #1: Logic & Proofs. Applied Discrete Mathematics

1.1 Language and Logic

Chapter 4, Logic using Propositional Calculus Handout

Introduction Propositional Logic. Discrete Mathematics Andrei Bulatov

Foundation of proofs. Jim Hefferon.

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

Discrete Structures & Algorithms. Propositional Logic EECE 320 // UBC

Introduction to Theoretical Computer Science

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

Boolean Logic. CS 231 Dianna Xu

Lecture 7. Logic. Section1: Statement Logic.

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

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

Discrete Mathematics and Its Applications

Logic. Def. A Proposition is a statement that is either true or false.

Propositional Logic, Predicates, and Equivalence

Section A (not in the text) Which of the following are statements? Explain. 3. The President of the United States in 2089 will be a woman.

Logic and Propositional Calculus

ICS141: Discrete Mathematics for Computer Science I

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

ICS141: Discrete Mathematics for Computer Science I

Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9

CSCE 222 Discrete Structures for Computing. Propositional Logic. Dr. Hyunyoung Lee. !!!!!! Based on slides by Andreas Klappenecker

Propositional Logic. Spring Propositional Logic Spring / 32

Math.3336: Discrete Mathematics. Applications of Propositional Logic

Section 1.1: Logical Form and Logical Equivalence

AMTH140 Lecture 8. Symbolic Logic

Logic and Propositional Calculus

a. ~p : if p is T, then ~p is F, and vice versa

Propositional Languages

COMP 2600: Formal Methods for Software Engineeing

Propositional Logic. Fall () Propositional Logic Fall / 30

UNIT-I: Propositional Logic

Topic 1: Propositional logic

ICS141: Discrete Mathematics for Computer Science I

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

Definition 2. Conjunction of p and q

Logic as a Tool Chapter 1: Understanding Propositional Logic 1.1 Propositions and logical connectives. Truth tables and tautologies

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

Section L.1- Introduction to Logic

cis32-ai lecture # 18 mon-3-apr-2006

1.1 Language and Logic

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

DERIVATIONS AND TRUTH TABLES

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

CS70: Discrete Math and Probability. Slides adopted from Satish Rao, CS70 Spring 2016 June 20, 2016

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Chapter 5: Section 5-1 Mathematical Logic

02 Propositional Logic

Chapter 4: Classical Propositional Semantics

Logic Overview, I. and T T T T F F F T F F F F

Logic and Proofs. (A brief summary)

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. Introductory Notes in Discrete Mathematics Solution Guide

Proofs. Joe Patten August 10, 2018

Math/EECS 1028M: Discrete Mathematics for Engineers Winter Suprakash Datta

CHAPTER 1. MATHEMATICAL LOGIC 1.1 Fundamentals of Mathematical Logic

PROPOSITIONAL CALCULUS

Transcription:

ICS141: Discrete Mathematics for Computer Science I Dept. Information & Computer Sci., Originals slides by Dr. Baek and Dr. Still, adapted by J. Stelovsky Based on slides Dr. M. P. Frank and Dr. J.L. Gross Provided by McGraw-Hill ICS 141: Discrete Mathematics I (Fall 2011) 1-1

Lecture 1 Course Overview Chapter 1. The Foundations 1.1 Propositional Logic ICS 141: Discrete Mathematics I (Fall 2011) 1-2

Class Information Instructor: Jan Stelovsky (POST 305C) Email: janst@hawaii.edu Skype: havajsky Office hours: M/W 3:00 p.m. 4:00 p.m. or by appointment TA: Christopher Mullins (POST 303 5) Email: cmmullin@hawaii.edu Office hours: TBA Textbook: Discrete Mathematics and Its Applications (6 th Edition), by Kenneth H. Rosen, McGraw-Hill Web site: Lecture: www2.hawaii.edu/~janst/141 Recitation: www2.hawaii.edu/~cmmullin/141 Grading Final exam: 40% Midterm Exam: 25% Homework assignments: 25% Quizzes: 5% Recitation attendance: 5% 1-3

What is Mathematics, really? It s not just about numbers! Mathematics is much more than that: Mathematics is, most generally, the study of any and all absolutely certain truths about any and all perfectly well-defined concepts. These concepts can be about numbers, symbols, objects, images, sounds, anything! It is a way to interpret the world around you. 1-4

So, what s this class about? What are discrete structures anyway? Discrete - Composed of distinct, separable parts. (Opposite of continuous.) discrete:continuous :: digital:analog Structures - Objects built up from simpler objects according to some definite pattern. Discrete Mathematics - The study of discrete, mathematical (i.e. well-defined conceptual) objects and structures. 1-5

Discrete Objects/Concepts and Structures We Study DM PART I Propositions Predicates Proofs Sets Functions Orders of Growth Algorithms Integers Summations Sequences Strings Permutations Combinations Probability DM PART II Relations Graphs Trees Boolean Functions / Logic Circuits Automata 1-6

Why Study Discrete Math? The basis of all of digital information processing is: Discrete manipulations of discrete structures represented in memory. It s the basic language and conceptual foundation for all of computer science. Discrete math concepts are also widely used throughout math, science, engineering, economics, biology, etc., A generally useful tool for rational thought! 1-7

Uses for Discrete Math in Computer Science Advanced algorithms & data structures Programming language compilers & interpreters Computer networks Operating systems Computer architecture Database management systems Cryptography Error correction codes Graphics & animation algorithms, game engines, etc. i.e., the whole field! 1-8

Course Topics Logic and Proofs (Chap. 1) Basic Structures (Chap. 2) Sets, Functions, Sequences and Summations Algorithms, Integers, and Matrices (Chap. 3) Induction and Recursion (Chap. 4) Counting (Chap. 5) Discrete Probability (Chap. 6) 1-9

1.1 Propositional Logic Logic Study of reasoning. Specifically concerned with whether reasoning is correct. Focuses on the relationship among statements, not on the content of any particular statement. Gives precise meaning to mathematical statements. Propositional Logic is the logic that deals with statements (propositions) and compound statements built from simpler statements using so-called Boolean connectives. Some applications in computer science: Design of digital electronic circuits. Expressing conditions in programs. Queries to databases & search engines. 1-10

Definition of a Proposition Definition: A proposition (denoted p, q, r, ) is simply: a statement (i.e., a declarative sentence) with some definite meaning, (not vague or ambiguous) having a truth value that s either true (T) or false (F) it is never both, neither, or somewhere in between! However, you might not know the actual truth value, and, the truth value might depend on the situation or context. Later, we will study probability theory, in which we assign degrees of certainty ( between T and F) to propositions. But for now: think True/False only! (or in terms of 1 and 0) 1-11

Examples of Propositions It is raining. A fact-based declaration is a proposition, even if no one knows whether it is true 11213 is prime. (In a given situation) Beijing is the capital of China. (T) 2 + 2 = 5. (F) 1 + 2 = 3. (T) There exists an odd perfect number. 1-12

Examples of Non-Propositions The following are NOT propositions: Who s there? (interrogative, question) Just do it! (imperative, command) La la la la la. (meaningless interjection) Yeah, I sorta dunno, whatever... (vague) 1 + 2 (expression with a non-true/false value) x + 2 = 5 (declaration about semantic tokens of non-constant value) 1-13

Truth Tables An operator or connective combines one or more operand expressions into a larger expression. (e.g., + in numeric expressions.) Unary operators take one operand (e.g., 3); Binary operators take two operands (e.g. 3 4). Propositional or Boolean operators operate on propositions (or their truth values) instead of on numbers. The Boolean domain is the set {T, F}. Either of its elements is called a Boolean value. An n-tuple (p 1,,p n ) of Boolean values is called a Boolean n-tuple. An n-operand truth table is a table that assigns a Boolean value to the set of all Boolean n-tuples. 1-14

Some Popular Boolean Operators Formal Name Nickname Arity Symbol Negation operator NOT Unary Conjunction operator AND Binary Disjunction operator OR Binary Exclusive-OR operator XOR Binary Implication operator IMPLIES Binary Biconditional operator IFF Binary 1-15

The Negation Operator The unary negation operator (NOT) transforms a proposition into its logical negation. E.g. If p = I have brown hair. then p = It is not the case that I have brown hair or I do not have brown hair. The truth table for NOT: p p T F F T Operand column Result column 1-16

The Conjunction Operator The binary conjunction operator (AND) combines two propositions to form their logical conjunction. E.g. If p = I will have salad for lunch. and q = I will have steak for dinner. then, p q = I will have salad for lunch and I will have steak for dinner. 1-17

Conjunction Truth Table Operand columns p q p q T T T T F F F T F F F F Note that a conjunction p 1 p 2 p n of n propositions will have 2 n rows in its truth table 1-18

The Disjunction Operator The binary disjunction operator (OR) combines two propositions to form their logical disjunction. E.g. If p = My car has a bad engine. and q = My car has a bad carburetor. then, p q = My car has a bad engine, or my car has a bad carburetor. Meaning is like and/or in informal English. 1-19

Disjunction Truth Table p q p q T T T F F T F F T T T F Note difference from AND Note that p q means that p is true, or q is true, or both are true! So, this operation is also called inclusive or, because it includes the possibility that both p and q are true. 1-20

The Exclusive-Or Operator The binary exclusive-or operator (XOR) combines two propositions to form their logical exclusive or E.g. If p = I will earn an A in this course. and q = I will drop this course., then p q = I will either earn an A in this course, or I will drop it (but not both!) 1-21

Exclusive-Or Truth Table p q p q T T F T F T F T T F F F Note difference from OR. Note that p q means that p is true, or q is true, but not both! This operation is called exclusive or, because it excludes the possibility that both p and q are true. 1-22

Natural Language is Ambiguous Note that the English or can be ambiguous regarding the both case! Pat is a singer or Pat is a writer. - Pat is a man or Pat is a woman. - p q p "or" q T T? T F T F T T F F F Need context to disambiguate the meaning! For this class, assume or means inclusive ( ). 1-23

The Implication Operator The conditional statement (aka implication) p q states that p implies q. I.e., If p is true, then q is true; but if p is not true, then q could be either true or false. E.g., let p = You study hard. q = You will get a good grade. p q = If you study hard, then you will get a good grade. (else, it could go either way) p: hypothesis or antecedent or premise q: conclusion or consequence 1-24

Implication Truth Table p q p q T T T F F T F F T F T T The only False case! p q is false only when p is true but q is not true. p q does not require that p or q are ever true! E.g. (1=0) pigs can fly is TRUE! 1-25