Background for Discrete Mathematics

Similar documents
Propositional Logic, Predicates, and Equivalence

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

Chapter 1 : The language of mathematics.

CSCE 222 Discrete Structures for Computing. Review for Exam 1. Dr. Hyunyoung Lee !!!

Chapter Summary. Sets (2.1) Set Operations (2.2) Functions (2.3) Sequences and Summations (2.4) Cardinality of Sets (2.5) Matrices (2.

2.1 Sets. Definition 1 A set is an unordered collection of objects. Important sets: N, Z, Z +, Q, R.

Discrete Mathematics. (c) Marcin Sydow. Sets. Set operations. Sets. Set identities Number sets. Pair. Power Set. Venn diagrams

Mathematics Review for Business PhD Students

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Sets McGraw-Hill Education

Automata Theory and Formal Grammars: Lecture 1

Mathematics Review for Business PhD Students Lecture Notes

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

Review 1. Andreas Klappenecker

CS2742 midterm test 2 study sheet. Boolean circuits: Predicate logic:

With Question/Answer Animations. Chapter 2

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

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

CSE 20 DISCRETE MATH. Winter

A set is an unordered collection of objects.

MATH 215 Sets (S) Definition 1 A set is a collection of objects. The objects in a set X are called elements of X.

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

Theorem. For every positive integer n, the sum of the positive integers from 1 to n is n(n+1)

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

HANDOUT AND SET THEORY. Ariyadi Wijaya

Chapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60

0 Logical Background. 0.1 Sets

Equivalence of Propositions

Today s Topics. Methods of proof Relationships to logical equivalences. Important definitions Relationships to sets, relations Special functions

586 Index. vertex, 369 disjoint, 236 pairwise, 272, 395 disjoint sets, 236 disjunction, 33, 36 distributive laws

Math Fall 2014 Final Exam Solutions

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

4. Sets The language of sets. Describing a Set. c Oksana Shatalov, Fall Set-builder notation (a more precise way of describing a set)

Chapter 2 - Basics Structures

Review 3. Andreas Klappenecker

Sets, Functions and Relations

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

THE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3.

Sets and Functions. MATH 464/506, Real Analysis. J. Robert Buchanan. Summer Department of Mathematics. J. Robert Buchanan Sets and Functions

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

POL502: Foundations. Kosuke Imai Department of Politics, Princeton University. October 10, 2005

SETS AND FUNCTIONS JOSHUA BALLEW

Introduction to Proofs

Topics in Logic and Proofs

CS 514, Mathematics for Computer Science Mid-semester Exam, Autumn 2017 Department of Computer Science and Engineering IIT Guwahati

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

A Semester Course in Basic Abstract Algebra

CSCE 222 Discrete Structures for Computing. Review for the Final. Hyunyoung Lee

Sets and Functions. (As we will see, in describing a set the order in which elements are listed is irrelevant).

ADVANCED CALCULUS - MTH433 LECTURE 4 - FINITE AND INFINITE SETS

CSCE 222 Discrete Structures for Computing

Math 4603: Advanced Calculus I, Summer 2016 University of Minnesota Notes on Cardinality of Sets

Math 13, Spring 2013, Lecture B: Midterm

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

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

0 Sets and Induction. Sets

Logic, Sets, and Proofs

9 FUNCTIONS. 9.1 The Definition of Function. c Dr Oksana Shatalov, Fall

Solutions to Homework Set 1

Exclusive Disjunction

Math 42, Discrete Mathematics

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

Numbers, sets, and functions

Discrete Mathematics

Section 2.1: Introduction to the Logic of Quantified Statements

CM10196 Topic 2: Sets, Predicates, Boolean algebras

Recall that the expression x > 3 is not a proposition. Why?

Exercises for Unit VI (Infinite constructions in set theory)

Propositional Logic. What is discrete math? Tautology, equivalence, and inference. Applications

4. Sets The language of sets. Describing a Set. c Oksana Shatalov, Fall

Principles of Real Analysis I Fall I. The Real Number System

Tutorial on Axiomatic Set Theory. Javier R. Movellan

Sec$on Summary. Definition of sets Describing Sets

MATH 13 FINAL EXAM SOLUTIONS

Contents Propositional Logic: Proofs from Axioms and Inference Rules

Notation Index. gcd(a, b) (greatest common divisor) NT-16

1. (B) The union of sets A and B is the set whose elements belong to at least one of A

Sets. We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth

MATH 3300 Test 1. Name: Student Id:

5 Set Operations, Functions, and Counting

INFINITY: CARDINAL NUMBERS

1.4 Cardinality. Tom Lewis. Fall Term Tom Lewis () 1.4 Cardinality Fall Term / 9

Problem 1: Suppose A, B, C and D are finite sets such that A B = C D and C = D. Prove or disprove: A = B.

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Discrete Mathematical Structures: Theory and Applications

CS Discrete Mathematics Dr. D. Manivannan (Mani)

1 Basic Combinatorics

CSE 20 DISCRETE MATH WINTER

Florida State University Course Notes MAD 2104 Discrete Mathematics I

CSE 20 DISCRETE MATH SPRING

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

CHAPTER 1. Preliminaries. 1 Set Theory

Solutions to Problem Set 1

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

ICS141: Discrete Mathematics for Computer Science I

Chapter 2: The Logic of Quantified Statements

Math 10850, fall 2017, University of Notre Dame

Section 0. Sets and Relations

5 FUNCTIONS. 5.1 Definition and Basic Properties. c Dr Oksana Shatalov, Fall

Transcription:

Background for Discrete Mathematics Huck Bennett Northwestern University These notes give a terse summary of basic notation and definitions related to three topics in discrete mathematics: logic, sets, and functions. The notes target students taking Northwestern University s EECS 212 course. 1 Logic 1.1 Propositional logic Boolean variables (also called propositional variables) are variables which are Boolean-valued, i.e., are either true or false. (Sometimes these values are shortened to T and F, or to 0 and 1. ) logical connective is a function that takes one or more Boolean values as arguments, and outputs a Boolean value. For example, ND, OR, and NOT (written in symbols as,, and ) are logical connectives. Table 1 summarizes these and several other of the most commonly used logical connectives. Name Notation Description OR x y x y is true if and only if at least one of x and y is true. ND x y x y is true if and only if both x and y are true. NOT x x is true if and only if x is false. XOR x y x y is true if and only if exactly one of x and y is true. IMPLIES x y x y is true if and only if y is true or x is false. IFF (if and only if) x y x is true if and only if x = y. Table 1: Standard logical connectives. The truth tables for these functions appear in Table 2. propositional formula is either a Boolean variable, or a logical connective applied to the correct number of arguments, each of which is itself a propositional formula. For example, x ( y z) is a propositional formula over the Boolean variables x, y, and z since takes two arguments, and x and y z are themselves propositional formulas. If the variables in a propositional formula are instantiated with Boolean values, then the formula evaluates to either true or false. truth table is a list of what values a propositional formula evaluates to for each possible setting of its input variables. Table 2 gives truth tables for commonly used logical connectives, which match their descriptions in Table 1. 1

x y x y F F F T F T F T T x y x y F F F T F T F T T T T F x y x y F F F T F F F T F x y x y F F T T F F F T T x x F T T F x y x y F F T T F F F T F Table 2: Truth tables for the logical connectives in Table 1. Top row: OR (left), ND (center), and NOT (right). Bottom row: XOR (left), IMPLIES (center), and IFF (right). 1.2 First-order logic 1 Formulas in first-order logic include all propositional formulas, and also include formulas that contain quantifiers and predicates. The two main quantifiers are the universal quantifier for all, written as, and the existential quantifier there exists, written as. predicate P is a function whose output is Boolean-valued. If P (x) is true for some input x, then we say that x satisfies P. typical formula in first-order logic uses quantifiers and predicates to assert which elements in a set meet a given condition. Syntactically, if X is a set and P (x) is a predicate, then we write x X, P (x) to assert that P (x) is true for all x X, and similarly write x X, P (x) to assert that there exists x X for which P (x) is true. The equality, disequality, and inequality symbols =,, <, >,, and are all predicates that take two real numbers as input. So, for example, the formula n N, n 0 asserts that all natural numbers are at least zero, and the formula z Z, z 0 asserts that there exists an integer that is at least 0. Both of these formulas are true. On the other hand, the formula z Z, z 0 is a valid formula in first-order logic, but is false because it incorrectly asserts that all integers are nonnegative. Formulas may also contain multiple quantifiers. For example, we can assert that there exists a real number strictly between any two distinct integers z 1, z 2 with z 1 < z 2 as follows: z 1 Z, z 2 Z, (z 1 < z 2 ) ( r R, (r > z 1 ) (r < z 2 )). (1) To understand this formula, it may be helpful to think about what it is saying for a particular instantiation of its variables. For example, it asserts that if we pick integers z 1 = 4 and z 2 = 5, then because z 1 < z 2 we can always find a real number, such as r = 4.237, which satisfies r > z 1 and r < z 2. It is always possible to write a formula in first-order logic with the quantifiers at the beginning, and this will often be most convenient. Indeed, the formula in Equation (1) is equivalent to the the following formula, which has all of its quantifiers at the beginning: z 1 Z, z 2 Z, r R, (z 1 < z 2 ) ((r > z 1 ) (r < z 2 )). Given predicates P and Q, we define the contrapositive of the formula P (x) Q(x) to be Q(x) P (x). given value x satisfies P (x) Q(x) if and only if it satisfies Q(x) P (x). In other words, if the domain of P and Q is X, it holds that x X, (P (x) Q(x)) ( Q(x) P (x)). It is straightforward to prove this by treating P and Q as propositional variables and observing that the truth tables of P Q and Q P are the same. 1 This section depends on Sections 2 and 3. 2

2 Sets set is an unordered collection of elements in which each element appears at most once. set may be empty, finite, or infinite. One may define a set in several ways: 1. Explicitly. We write a set explicitly as a comma-delimited list of elements between curly braces. For example, the set of schools in the Big Ten West Division is Y := {Illinois, Iowa, Minnesota, Nebraska, Northwestern, Purdue, Wisconsin}. 2 2. In terms of operations such as union, intersection, and complement applied to other sets (see the operations in Table 4). For example, if Y is the set of schools in the Big Ten West Division defined above, and Z is the set of private universities in the United States, then the set of private universities in the Big Ten West Division is Y Z = {Northwestern}. 3. Using set builder notation. Set builder notation is a way to define a set as the subset of elements in a larger set that satisfy some predicate. Given a set X and a predicate P (x), we denote the set of all elements x X that satisfy P (x) by {x X : P (x)}, which we read as the set of elements x in X such that P (x) is true. Set builder notation is closely related to the concept of list comprehension in Python and other programming languages. We give two examples of set builder notation. s a straightforward first example, we can use set builder notation to specify the set of all schools in the Big Ten West Division that start with an I : {y Y : y starts with an I } = {Illinois, Iowa}. We can also use set builder notation to define the set of prime numbers by using a slightly more complicated predicate: {p Z : p 2 a Z, (a > 1 a < p) p a} = {2, 3, 5, 7, 11,...}. Here x y, read as x divides y, means that x is a factor of y, and x y, read as x does not divide y, means that x is not a factor of y. So, the above formula uses set builder notation to define the set of prime numbers as the set of integers p greater than or equal to 2 such that no integer a strictly between 1 and p divides p. 2.1 Important sets and set operations We define a number of important sets in Table 3, and define a number of important operations on sets in Table 4. There are a number of containment relationships between sets in Table 3. For any n Z +, [n] N and N Z Q R. There is a close correspondence between several of the basic set operations in Table 4 and logical connectives in propositional logic. Namely, union, intersection, and complement correspond to,, and, respectively. 2 The symbol := means is defined to be, which we sometimes use instead of =, which can also mean logical equality. This usage is analogous to the difference between = and == in programming. 3

Name Notation Description Empty set The unique set containing no elements. Counting sets [n] = {1,..., n} The set of integers from 1 to n, inclusive. Natural numbers N = {0, 1, 2,...} The counting numbers, starting at 0. Integers Z = {..., 2, 1, 0, 1, 2,...} ll whole numbers. Positive integers Z + = {1, 2, 3,...} The counting numbers, starting at 1. Rational numbers Q = {0, 1, 3, 1 2, 4 9, 22 7,...} The set of ratios of integers with non-zero denominator. Real numbers R = {0, 1, 4 9, e, π,...} The set of all distances between points on a line. Open ranges (a, b) = {x R : a < x < b} The set of real numbers between a and b, exclusive. Closed ranges [a, b] = {x R : a x b} The set of real numbers between a and b, inclusive. Table 3: Some important sets. 4

Name Notation Description Picture/Example Union B The set of all elements in or B. B Intersection B The set of all elements in and B. B Complement or c The set of all elements not in. Difference \ B The set of all elements in but not in B. B Symmetric difference B The set of all elements in exactly one of and B. B Subset B is a subset of B. B Containment a The element a is in the set. a Non-containment a / The element a is not in the set. a Cartesian product B The set of all ordered pairs (a, b) where a and b B. {x, y} {1, 2} = {(x, 1), (x, 2), (y, 1), (y, 2)}. Power set P() The set of all subsets of. P({1, 2, 3}) = {, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}. Cardinality The number of elements in. {a, b, c} = 3. Table 4: Operations on sets. 5

3 Functions function f is a mapping of each element in a set X, called the domain, to a unique element in another set Y, called the codomain or range. In symbols, f : X Y denotes this relationship, which we read as, f is a function that maps elements from X to elements of Y. The familiar notation f(x) = y specifies that f maps the element x X to the element y Y. It is possible that two elements in the domain map to the same element in the codomain (i.e., f(x 1 ) = f(x 2 ) where x 1 x 2 ), but not that a single element in the domain maps to two elements in the codomain (i.e., if f(x 1 ) = y 1 and f(x 2 ) = y 2 then it must be that y 1 = y 2 ). function is called Boolean-valued or a predicate if its codomain is {0, 1}, is called integer-valued if its codomain is Z, and is called real-valued if its codomain is R. 3.1 Images and preimages Given a function f : X Y and a subset S X, we define the image of S under f to be f(s) := {f(x) : x S}. We define the image of f to be Im(f) := f(x), i.e., the image of the domain X of f under f. We define the preimage of an element y Y under f to be f 1 (y) := {x X : f(x) = y}, and similarly define the preimage of a set T Y to be f 1 (T ) := {x X : y T, f(x) = y}. In other words, the image f(s) of a set S X is the set of all elements in Y to which f maps some element in S, and the preimage f 1 (T ) of a set T Y is the set of all elements in X that f maps to elements in T. See Figure 1. S f(s) Im(f) f 1 (y) y X Y X Y X Y Figure 1: Three visual depictions of the same function f with different subsets of the domain and codomain highlighted in gray: the image f(s) of a set S X under f (left), the image Im(f) of f (equivalent to the image f(x) of the domain X under f) (center), and the preimage of y Y (right). 6

3.2 Injective, surjective, and bijective functions function f : X Y is called injective or 1-to-1 if for all y Y, f 1 (Y ) 1, i.e., if for every y Y there exists at most one element in X that maps to Y. function f is called surjective or onto if Im(f) = Y, i.e., if for every element y Y there exists an element x X such that f(x) = y. function that is both injective and surjective is called bijective. See Figure 2. X Y X Y X Y Figure 2: visual representation of injective (left), surjective (center), and bijective (right) functions with domain X and codomain Y (X and Y differ in each case). The function on the left is injective because no two distinct elements in X map to the same element in Y, but not surjective because no element in X maps to the bottom element in Y. The function in the center is surjective because some element in X maps to every element in Y, but not injective because two distinct elements map to the the top element in Y. The function on the right is bijective because it is both injective and surjective. 7