CSE20: Discrete Mathematics

Similar documents
CSC Discrete Math I, Spring Sets

CMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012

9/19/12. Why Study Discrete Math? What is discrete? Sets (Rosen, Chapter 2) can be described by discrete math TOPICS

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

Section 2.2: Introduction to the Logic of Quantified Statements

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

Chapter 3. Set Theory. 3.1 What is a Set?

1.1 - Introduction to Sets

2.1 Sets 2.2 Set Operations

Lecture 1: Conjunctive Queries

Today s Topics. What is a set?

CPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements


CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F

Chapter 1.3 Quantifiers, Predicates, and Validity. Reading: 1.3 Next Class: 1.4. Motivation

What is Set? Set Theory. Notation. Venn Diagram

Query formalisms for relational model relational calculus

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry.

CSE 20 DISCRETE MATH. Fall

LECTURE 8: SETS. Software Engineering Mike Wooldridge

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2

Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Sets Fall / 31

Range Restriction for General Formulas

Homework 1. Due Date: Wednesday 11/26/07 - at the beginning of the lecture

CSC 501 Semantics of Programming Languages

Practice Problems: All Computer Science majors are people. Some computer science majors are logical thinkers. Some people are logical thinkers.

Lecture 5: Predicate Calculus. ffl Predicate Logic ffl The Language ffl Semantics: Structures

First Order Predicate Logic CIS 32

logic with quantifiers (informally)

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

Formal Specification: Z Notation. CITS5501 Software Testing and Quality Assurance

CSE 20 DISCRETE MATH. Winter

School of Distance Education University of Kerala M.Sc Computer Science Assignment Topics

Introduction II. Sets. Terminology III. Definition. Definition. Definition. Example

Discrete Mathematics Lecture 4. Harper Langston New York University

CS 1200 Discrete Math Math Preliminaries. A.R. Hurson 323 CS Building, Missouri S&T

The set consisting of all natural numbers that are in A and are in B is the set f1; 3; 5g;

Sets. Mukulika Ghosh. Fall Based on slides by Dr. Hyunyoung Lee

Objectives Graph and Analyze Rational Functions Find the Domain, Asymptotes, Holes, and Intercepts of a Rational Function

CS100: DISCRETE STRUCTURES

Sets. Sets. Subset, universe. Specifying sets, membership. Examples: Specifying a set using a predicate. Examples

Mathematics for Computer Scientists 2 (G52MC2)

Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 6 Outline. Unary Relational Operations: SELECT and

CSI30. Chapter 1. The Foundations: Logic and Proofs Rules of inference with quantifiers Logic and bit operations Specification consistency

Higher-Order Logic. Specification and Verification with Higher-Order Logic

A set with only one member is called a SINGLETON. A set with no members is called the EMPTY SET or 2 N

LOGIC AND DISCRETE MATHEMATICS

CPSC 121: Models of Computation. Module 5: Predicate Logic

The Specification Phase

2/18/14. Uses for Discrete Math in Computer Science. What is discrete? Why Study Discrete Math? Sets and Functions (Rosen, Sections 2.1,2.2, 2.

Quantification. Using the suggested notation, symbolize the statements expressed by the following sentences.

Sets. Margaret M. Fleck. 15 September 2010

Constraint Propagation for Efficient Inference in Markov Logic

CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN. Lecture 1: Introduction

DISCRETE MATHEMATICS

CMSC 330: Organization of Programming Languages. Objects and Abstract Data Types

for all x, the assertion P(x) is false. there exists x, for which the assertion P(x) is true.

About the Tutorial. Audience. Prerequisites. Disclaimer& Copyright. Fuzzy Logic

Summary of Course Coverage

Math Week in Review #5. A proposition, or statement, is a declarative sentence that can be classified as either true or false, but not both.

Plan of the lecture. G53RDB: Theory of Relational Databases Lecture 1. Textbook. Practicalities: assessment. Aims and objectives of the course

CS 671, Automated Reasoning

One of the main selling points of a database engine is the ability to make declarative queries---like SQL---that specify what should be done while

SOFTWARE ENGINEERING DESIGN I

Axiom 3 Z(pos(Z) X(X intersection of Z P(X)))

MAT121: SECTION 2.7 ANALYZING GRAPHS AND PIECEWISE FUNCTIONS

FIPA SL Content Language Specification

Solutions to Selected Exercises

Lee Pike. June 3, 2005

4 Mathematical Data Types

First-Order Logic PREDICATE LOGIC. Syntax. Terms

Algebra Domains of Rational Functions

Fundamentals of Discrete Mathematical Structures

Automatic Reasoning (Section 8.3)

CMPSCI 250: Introduction to Computation. Lecture #1: Things, Sets and Strings David Mix Barrington 22 January 2014

Database Systems CSE 414. Lecture 9-10: Datalog (Ch )

Connecting Statements. Today. First there was logic jumping forward.. ..and then proofs and then induction...

Data types for mcrl2

CSE 215: Foundations of Computer Science Recitation Exercises Set #9 Stony Brook University. Name: ID#: Section #: Score: / 4

CSE 20 DISCRETE MATH WINTER

Automated Reasoning. Natural Deduction in First-Order Logic

The three faces of homotopy type theory. Type theory and category theory. Minicourse plan. Typing judgments. Michael Shulman.

Relational Database: The Relational Data Model; Operations on Database Relations

CS 4700: Artificial Intelligence

This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS

L05 - Negating Statements

COMS 1003 Fall Introduction to Computer Programming in C. Bits, Boolean Logic & Discrete Math. September 13 th

COMP Logic for Computer Scientists. Lecture 17

Announcements. Database Systems CSE 414. Datalog. What is Datalog? Why Do We Learn Datalog? HW2 is due today 11pm. WQ2 is due tomorrow 11pm

Section 2.4: Arguments with Quantified Statements

More Non-logical Features of Prolog

r=1 The Binomial Theorem. 4 MA095/98G Revision

Introduction to Sets and Logic (MATH 1190)

Appendix 1. Description Logic Terminology

Appendix 1. Description Logic Terminology

Set and Set Operations

Semantic Characterizations of XPath

Part I Logic programming paradigm

Lecture 4: examples of topological spaces, coarser and finer topologies, bases and closed sets

About the Author. Dependency Chart. Chapter 1: Logic and Sets 1. Chapter 2: Relations and Functions, Boolean Algebra, and Circuit Design

Transcription:

Spring 2018

Summary Last time: Today: Introduction to Basic Set Theory (Vardy) More on sets Connections between sets and logic Reading: Chapter 2

Set Notation A, B, C: sets A = {1, 2, 3}: finite set with elements 1, 2, 3 2 A: set membership relation ( 2 is in A ) A B, A B: set inclusion relations A B, A B: set operations (intersection, union, etc.)

Set Notation A, B, C: sets A = {1, 2, 3}: finite set with elements 1, 2, 3 2 A: set membership relation ( 2 is in A ) A B, A B: set inclusion relations A B, A B: set operations (intersection, union, etc.) Let A = {1, 2, 3} and B = {2, 3} Question: The statement 5 A is (A) Correct; (B) Wrong; (C) True; (D) None of the above

Set Notation A, B, C: sets A = {1, 2, 3}: finite set with elements 1, 2, 3 2 A: set membership relation ( 2 is in A ) A B, A B: set inclusion relations A B, A B: set operations (intersection, union, etc.) Let A = {1, 2, 3} and B = {2, 3} Question: The statement 5 A is (A) Correct; (B) Wrong; (C) True; (D) None of the above Question: The statement B A is (A) Correct; (B) Wrong; (C) True; (D) None of the above

Typecheck your math! A, B, C: sets

Typecheck your math! A, B, C: sets x, y, z: elements

Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false)

Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false)

Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false) Compound statements:

Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false) Compound statements: (x A) (A B): true or false

Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false) Compound statements: (x A) (A B): true or false A B, A B: sets (result of a set operation)

Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false) Compound statements: (x A) (A B): true or false A B, A B: sets (result of a set operation) (A B) (x / C)

Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false) Compound statements: (x A) (A B): true or false A B, A B: sets (result of a set operation) (A B) (x / C) nonsense: (A B) is a set, not a proposition.

Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false) Compound statements: (x A) (A B): true or false A B, A B: sets (result of a set operation) (A B) (x / C) nonsense: (A B) is a set, not a proposition. A x, A B

Typecheck your math! A, B, C: sets x, y, z: elements (x A), (y / B): propositions, (true or false) (A B), (B = C): propositions (true or false) Compound statements: (x A) (A B): true or false A B, A B: sets (result of a set operation) (A B) (x / C) nonsense: (A B) is a set, not a proposition. A x, A B nonsense, unless x is a set, of B is a set of sets

Quiz Time Let A, B, C be sets (of numbers), x, y, z (numerical) values, and P(x), Q(x) predicates. Which of the following expressions are meaningful? (choose the best possible answer.) 1. (x A) (A B) 2. (A B) {x} 3. {x, y} (A B) 4. {x} (A B) 5. x.(x A) (x B) 6. A, B, C.(A B) (B C) (A C) 7. ({x : P(x)} {y : Q(y)}) ( x.p(x) Q(x)) (A) 1,2,3,6,7; (B) 1,2,3,4,5; (C) 1,2,3,5,6,7; (D) 1,3,5,6,7;

Set vs Predicates Each set A defines a corresponding predicate: set membership predicate P(x) = (x A)

Set vs Predicates Each set A defines a corresponding predicate: set membership predicate P(x) = (x A) Each predicate Q defines a corresponding set: the set of all values satisfying the predicate B = {x Q(x)}

Set vs Predicates Each set A defines a corresponding predicate: set membership predicate P(x) = (x A) Each predicate Q defines a corresponding set: the set of all values satisfying the predicate B = {x Q(x)} Notice: for any set A and predicate P If Q(x) = (x A), and B = {x : Q(x)}, then A = B If B = {x : P(x)} and Q(x) = (x B), then P(x) = Q(x), i.e., x.p(x) Q(x).

Set operations vs Logican operations A = {x : P(x)} B = {x : Q(x)} C = {x : R(x)}

Set operations vs Logican operations A = {x : P(x)} B = {x : Q(x)} C = {x : R(x)} A B = {x : P(x) Q(x)} A B = {x : P(x) Q(x)} A \ B = A B = {x : P(x) Q(x)} A c = A = {x : P(x)}

Set operations vs Logican operations A = {x : P(x)} B = {x : Q(x)} C = {x : R(x)} A B = {x : P(x) Q(x)} A B = {x : P(x) Q(x)} A \ B = A B = {x : P(x) Q(x)} A c = A = {x : P(x)} (A B) C = {x : (P(x) Q(x)) R(x)} ((x A) (x B) (x C)) (x (A B) C)

Quantifying over a set Quantification over the universe of discourse U: x.p(x) : P(x) is true for all x in U x.p(x) : P(x) is true for some x in U Universe U usually implicit, but clear from the context

Quantifying over a set Quantification over the universe of discourse U: x.p(x) : P(x) is true for all x in U x.p(x) : P(x) is true for some x in U Universe U usually implicit, but clear from the context Can use set notation to quantify over a specific set: x S.P(x) : P(x) is true for all x in set S x S.P(x) : P(x) is true for some x in set S Examples: 1. x Z. y Z.x + y = 0 2. x Q.x 2 = 2 3. x R.x 2 = 2

Quantifying over a set using logical connectives Which of the following logical statements corresponds to x S.P(x)? (A) x.((x S) P(x))) (B) x.((x S) P(x))) (C) x.((x S) P(x))) (D) x.(p(x) (x S))

Quantifying over a set using logical connectives Which of the following logical statements corresponds to x S.P(x)? (A) x.((x S) P(x))) (B) x.((x S) P(x))) (C) x.((x S) P(x))) (D) x.(p(x) (x S)) Which of the following logical statements corresponds to x S.P(x)? (A) x.((x S) P(x))) (B) x.((x S) P(x))) (C) x.((x S) P(x))) (D) x.(p(x) (x S))

Negating quantifiers over a set Which of the following statements is equivalent to ( x S.P(x))? (A) x S c. P(x) (B) x S c. P(x) (C) x S.P(x) (D) x S. P(x)

Negating quantifiers over a set Which of the following statements is equivalent to ( x S.P(x))? (A) x S c. P(x) (B) x S c. P(x) (C) x S.P(x) (D) x S. P(x) Which of the following statements is equivalent to ( x S.P(x))? (A) x S c. P(x) (B) x S c. P(x) (C) x S.P(x) (D) x S. P(x)

Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x))

Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x)))

Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x)))

Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x))) x.( (x S) P(x))

Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x))) x.( (x S) P(x)) x.((x S) P(x))

Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x))) x.( (x S) P(x)) x.((x S) P(x)) x S. P(x))

Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x))

Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x)))

Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x)))

Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x))) x. ( (x S) P(x))

Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x))) x. ( (x S) P(x)) x.( (x S) P(x))

Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x))) x. ( (x S) P(x)) x.( (x S) P(x)) x.((x S) P(x))

Let s use the definitions! Recall the definitions x S.P(x) x.((x S) P(x)) x S.P(x) x.((x S) P(x)). Then we have the following chain of equivalences: ( x S.P(x)) ( x.((x S) P(x))) x. ((x S) P(x))) x. ( (x S) P(x)) x.( (x S) P(x)) x.((x S) P(x)) x S. P(x))

Existentially quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined.

Existentially quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. x.p(x)

Existentially quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. x.p(x) x.((x ) P(x))

Existentially quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. x.p(x) x.((x ) P(x)) x.(false P(x))

Existentially quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. x.p(x) x.((x ) P(x)) x.(false P(x)) x.false

Existentially quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. x.p(x) x.((x ) P(x)) x.(false P(x)) x.false False

Universally quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined.

Universally quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. This is the negation of x. P(x) False. x.p(x)

Universally quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. This is the negation of x. P(x) False. x.p(x) x.((x ) P(x))

Universally quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. This is the negation of x. P(x) False. x.p(x) x.((x ) P(x)) x.(false P(x))

Universally quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. This is the negation of x. P(x) False. x.p(x) x.((x ) P(x)) x.(false P(x)) x.true

Universally quantifying over an empty set x.p(x) (A) True; (B) False; (C) Depends on P; (D) Undefined. This is the negation of x. P(x) False. x.p(x) x.((x ) P(x)) x.(false P(x)) x.true True

Union and Intersection of set families Let A be a collection of sets The union of all sets in A is X = {v : X A.v X} X A

Union and Intersection of set families Let A be a collection of sets The union of all sets in A is X = {v : X A.v X} X A The intersection of all sets in A is X = {v : X A.v X} X A

Union and Intersection of set families Let A be a collection of sets The union of all sets in A is X = {v : X A.v X} X A The intersection of all sets in A is X = {v : X A.v X} X A Empty unions and intersections: If A =, then X A X = X A X = U

Counting Subsets Powerset of a set A P(A) = 2 A = {B : B A} Example: P({1, 2, 3}) = {, {1}, {2}, {3}, {1, 2, }, {1, 3}, {2, 3}, {1, 2, 3}}. What s the size of P(A)? For every element x A, there are two possibilities (x A or x / A) A subset of A can be selected in 2 A possible ways If A = n, then A has 2 n possible subsets Ok, so P(A) = 2 A. But how many subsets of A have size 3?

Binomial Coefficients The Binomial Coefficient ( n k) expresses the number of subsets of a set of n, that have size precisely k. ( ) n = k ( ) n = 1 n ( ) n = 1 0 ( ) n = n 1 ( ) n 1 + k 1 ( ) n 1 k