Generating Permutations and Combinations

Size: px
Start display at page:

Download "Generating Permutations and Combinations"

Transcription

1 Generating Permutations and Combinations March 0, 005 Generating Permutations We have learned that there are n! permutations of {,,, n} It is important in many instances to generate a list of such permutations For example, for the permutation of {,,, }, we may insert 5 in to generate five permutations of {,,,, 5} as follows: 5, 5, 5, 5, 5 If we have a complete list of permutations for {,,, n }, then we can obtain a complete list of permutations for {,,, n} by inserting n in n ways to each permutation of the list for {,,, n } For n =, the list is just For n =, the list is For n =, the list is = = To generate a complete list of permutations for the set {,,, n}, we assign a direction to each integer k {,,, n} by writing an arrow above it pointing to the left or to the right: k or k We consider permutations of {,,, n} in which each integer is given a direction; such permutations are called directed permutations An integer k in a directed permutation is called mobile of its arrow points to a smaller integer adjacent to it For example, for 5 6, the integers, 5, and 6 are mobile It follows that can never be mobile since there is no integer in {,,, n} smaller than The integer n is mobile, except two cases: (i n is the first integer and its arrow points to the left, ie, n ; (ii n is the last integer and its arrow points to the right, ie, n

2 For n =, we have the list = Algorithm Algorithm for Generating Permutations of {,,, n}: Step 0 Begin with n Step Find the largest mobile integer m Step Switch m and the adjacent integer its arrow points to Step Switch the directions for all integers p > m Step Write down the resulting permutation with directions and return to Step For example, for n =, we have and For n =, we have,,,,, For n =, the algorithm produces the list Proof Observe that when n is not the largest mobile the direction of n must be either like n or n

3 in the permutation When the largest mobile m (with m < n is switched with its target integer to produce a new permutation, the direction of n will be changed simultaneously, and the permutation with direction becomes n or n Now n is the largest mobile Switching n with its target integer for n times to produce n more permutations, we obtain exactly n new permutations (including the one before switching n The algorithm stops at the permutation n Inversions of Permutations Let u u u n be a permutation of S = {,,, n} We can view u u u n as as a bijection π : S S defined by π( = u, π( = u,, π(n = u n If u i > u j for some i < j, then (u i, u j is called an inversion of π The number of inversions of π is denoted by inv(π For example, the permutation 765 of {,,, 7} has the inversions: (,, (,, (,, (,, (6, 5, (7, 5, (7, 6 For k {,,, n} and u j = k, let a k be the number of integers that precede k in the permutation u u u n but greater than k, ie, a k = #{u i : u i > u j = k, i < j} = #{π(i : π(i > π(j = k, i < j} It measures how much k is out of order by counting the numbers of integers larger than k but located before k The tuple (a, a,, a n is called the inversion sequence (or inversion table of the permutation π = u u u n The sum a + a + + a n measures the total disorder of a permutation Example The inversion sequence of the permutation 765 of {,,, 7} is (,, 0, 0,,, 0 It is clear that for any permutation π of {,,, n}, the inversion sequence (a, a,, a n of π satisfies 0 a n, 0 a n,, 0 a n, a n = 0 ( It is easy to see that the number of sequences (a, a,, a n satisfying ( equals n (n = n! This suggests that the inversion sequences may be characterized by ( Theorem Let (a, a,, a n be an integer sequence satisfying 0 a n, 0 a n,, 0 a n, a n = 0 Then there is a unique permutation π of {,,, n} whose inversion sequence is (a, a,, a n Proof We give two algorithms to uniquely construct the permutation whose inversion sequence is (a, a,, a n Algorithm I Construction of a Permutation from Its Inversion Sequence: Step 0 Write down n Step If a n = 0, place n before n; if a n =, place n after n Step If a n = 0, place n before the two members n and n ; if a n =, place n between n and n ; if a n =, place n after both n and n Step k If a n k = 0, place n k to the left of the first position; if a n k =, place n k to the right of the st existing number; if a n k =, place n k to the right of the nd existing number; ; if a n k = k, place n k to the right of the last existing number In general, insert n k to the right of the a n k th existing number

4 Step n If a = 0, place before all existing numbers; otherwise, place to the right of the a th existing number For example, for the inversion sequence (a, a,, a 8 = (, 6,, 0,,,, 0, its permutation can be constructed by Algorithm I as follows: 8 Write down 8 87 Since a 7 =, insert 7 to the right of the first number Since a 6 =, insert 6 to the right of the first number Since a 5 =, insert 5 to the right of the third number Since a = 0, insert to the left of the first number Since a =, insert to the right of the first number 8675 Since a = 6, insert to the right of the sixth number Since a =, insert to the right of the fifth number 6 Algorithm II Construction of a Permutation from Its Inversion Sequence: Step 0 Mark down n empty spaces Step Put into the (a + th empty space from left Step Put into the (a + th empty space from left Step k Put k into the (a k + th empty space from left Step n Put n into the (a n + th empty space (the last empty box from left For example, the permutation for the inversion sequence (a, a,, a 8 = (, 6,, 0,,,, 0 can be constructed by Algorithm II as follows: Mark down 8 empty spaces Since a =, put into the 5th empty space Since a = 6, put into the 7th empty space Since a =, put into the nd empty space Since a = 0, put into the st empty space 5 Since a 5 =, put 5 into the th empty space 6 5 Since a 6 =, put 6 into the nd empty space 675 Since a 7 =, put 7 into the nd empty space 8675 Since a 8 = 0, put 8 into the st empty space Generating Combinations Let S be an n-set For convenience of generating combinations of S, we take S to be the set S = {x n, x n,, x, x, x 0 } Each subset A of S can be identified as a function χ A : S {0, }, called the characteristic function of A, defined by { if x A χ A (x = 0 if x A In practice, χ A is represented by a 0- sequence or a base numeral For example, for S = {x 7, x 6, x 5, x, x, x, x, x 0 }, {x 7, x 5, x, x } 0000 {x 6, x 5, x, x, x 0 } 000 {x 7, x 6, x 5, x, x, x, x, x 0 }

5 Algorithm The algorithm for Generating Combinations of {x n, x n,, x, x, x 0 }: Step 0 Begin with a n a a 0 = 0 00 Step If a n a a 0 =, stop Step If a n a a 0, find the smallest integer j such that a j = 0 Step Change a j, a j,, a 0 (from 0 to or from to 0, write down a n a a 0, and return to Sept For n =, the algorithm produces the list The unit n-cube Q n is a graph whose vertex set is the set of all 0- sequences of length n, and two sequences are adjacent if they differ in only one place A Gray code of order n is a path of Q n that visits every vertex of Q n exactly once, ie, a Hamilton path of Q n For example, is a Gray code of order It is obvious that this Gray code can not be a part of any Hamilton cycle since 000 and are not adjacent A cyclic Gray code of order n is a Hamilton cycle of Q n For example, the closed path is a cyclic Gray code of order For n =, we have the Gray code 0 For n =, we use 0 to produce the path 00 0 by adding a 0 in the front, and use 0 to produce 0 by adding a in the front, then combine the two paths to produce the Gray code For n =, we use the Gray code (of order to produce the path by adding 0 in the front, and use the Gray code (the reverse of to produce the path Combine the two paths to produce the Gray code of order The Gray codes obtained in this way are called reflected Gray codes Algorithm Algorithm for Generating reflected Gray codes of order n: Step 0 Begin with a n a n a 0 = 00 0 Step If a n a n a 0 = 0 0, stop Step If a n + a n + + a 0 = even, then change a 0 (from 0 to or to 0 Step If a n + a n + a 0 = odd, find the smallest j such that a j = and change a j+ (from 0 to or to 0 Step Write down a n a n a 0 and return to Step We note that if a n a n a and a n + a n + + a 0 = odd, then j n so that j + n and a j+ is defined We also note that the smallest number j in Step may be 0, ie, a 0 = ; if so there is no i < j such that a i = 0 and we change a j+ = a as instructed in Step Proof We proceed by induction on n For n =, it is obviously true For n =, we have Let n and assume that it is true for,,, n ( When the algorithm is applied, by the induction hypothesis the first resulted n words form the reflected Gray code of order n with a 0 attached to each word; the n th word is 00 0 ( Continuing the algorithm, we have

6 Now for each word of the form b n b 0, the parity of b n b 0 is the same as the parity of b n b 0 Continuing the algorithm, the next n words (including 0 0 form a reflected Gray code (of order n with a attached at the beginning; the last word is 0 0 ( Continuing the algorithm, we have The next n words (including 00 0 form a reflected Gray code (of order n with a 0 attached at the beginning; the last word is 00 0 ( ; there are n words with 00 attached at the beginning (n Continuing the algorithm, we have The next words (including form a reflected Gray code (of order with 0 0 attached at the beginning; the last word is 0 00 (n ; there are words and 0 00 (of order with 0 00 attached at the beginning (n The algorithm produces only word (n + Finally, the algorithm ends at Note that all words produced in Steps (k (n + are distinct from the words produced in Step (k, where k n + Thus the words produced by the algorithm are distinct and the total number of words is n = n This implies that the sequence of the words produced forms the reflected Gray code of order n Generating r-combinations Let S = {,,, n} When an r-combination or r-subset A = {a, a,, a r } of S is given, we always assume that a < a < < a r For two r-combinations A = {a, a,, a r } and B = {b, b,, b r } of S, if there is an integer k ( k r such that a = b, a = b,, a k = b k, a k < b k, we say that A precedes B in the lexicographic order, written A < B Then the set P r (S of all r-subsets of S is linearly ordered by the lexicographic order For simplicity, we write an r-combination {a, a,, a r } as an r-permutation a a a r with a < a < < a r Theorem Let a a a r be an r-combination of {,,, n} The first r-combination in lexicographic order is r, and the last r-combination in lexicographic order is (n r + (n n If a a a k a r (n r + (n n and k is the largest integer such that a k n r + k, then the successor of a a a r is a a a k (a k + (a k + (a k + r k + Proof Since a i (n r + i for all i r, then a k n r + k implies a k < n r + k Algorithm Algorithm for Generating r-combinations of {,,, n} in Lexicographic Order: Step 0 Begin with the r-combination a a a r = r Step If a a a r = (n r + (n n, stop Step If a a a r (n r + (n n, find the largest k such that a k < n r + k Step Change a a a r to a a k (a k + (a k + (a k + r k +, write down a a a r, and return back to Step 6

7 Example The collection of all -combinations of {,,,, 5, 6} are listed by the algorithm: Theorem Let a a a r be an r-combination of {,,, n} Then the number of r-combinations up to the place a a a r in lexicographic order equals ( ( ( ( ( n n a n a n ar n ar r r r Proof The r-combinations b b b r after a a a r can be classified into r kinds: ( b > a ; there are ( n a r such ( r-combinations ( b = a, b > a ; there are n a r such r-combinations ( b = a, b = a, b > a ; there are such r-combinations ( n a r (r b = a,, b r = a r, b r > a r ; there are ( n a r such r-combinations (r b = a,, b r = a r, b r > a r ; there are ( n a r such r-combinations Since the number of r-combinations of {,,, n} is ( n r, the conclusion follows immediately Example The -combinations of {,,,, 5} are as follows:,, 5,, 5, 5,, 5, 5, 5 The -permutations of {,,,, 5} can be obtained by making! permutations for each -combination: 5 Partially Ordered Sets Definition 5 A relation on a set X is a subset R of the product set X X A relation R on X is called reflexive if xrx for all x X; irreflexive if x Rx for all x X; symmetric provided that if xry for some x, y X then yrx; antisymmetric provided that if xry and yrx for some x, y X then x = y; 5 transitive provided that if xry and yrz for some x, y, z X then xrz Example 5 ( The relation of subset,, is a reflexive and transitive relation on the power set P (X ( The relation of divisibility,, is a reflexive and transitive relation on the set of positive integers A partial order on a set X is a reflexive, antisymmetric, and transitive relation A strict partial order on a set X is an irreflexive, antisymmetric, and transitive relation If a relation R is a partial order, we usually denote R by ; the relation < is defined by a < b if and only if a b but a b Conversely, for a strict partial order < on a set X, the relation defined by a b if and only if a < b or a = b is a partial order A set X with a partial order is called a partially ordered set (or poset for short and is denoted by (X, A linear order or total order on a set X is a strict order < such that for any two distinct elements a and b, either a < b or b < a 7

8 Let and be two partial orders on a set X The poset (X, is called an extension of the poset (X, if, whenever a b, then a b In particular, an extension of a partial order has more compatible pairs We show that every finite poset has a linear extension, that is, an extension which is a linearly ordered set Theorem 5 Let (X, be a finite partially ordered set Then there is a linear order such that (X, is an extension of (X, Proof We need to show that the elements of X can be listed in some order x, x,, x n in such a way that if x i x j then x i comes before x j in this list, ie, i j The following algorithm does the job Algorithm 5 Algorithm for a Linear Extension of an n-poset: Step Choose a minimal element x from X (with respect to the ordering Step Delete x from X; choose a minimal element x from X {x } Step Delete x from X {x }; choose a minimal element x from X {x, x } Step n Delete x n from X {x,, x n } and choose the only element x n in X {x,, x n } A relation R on X is called an equivalence relation if R is reflexive, symmetric, and transitive For an equivalence relation R on a set X and an element x X, we call the set [x] = {y X : xry} an equivalence class of R and x a representative of the equivalence class [x] Theorem 5 Let R be an equivalence relation on a set X Then for any x, y X, the following are logically equivalent: (i [x] [y] ; (ii [x] = [y]; and (iii xry A collection P = {A, A,, A k } of nonempty subsets of a set X is called a partition of X if A i A j = for i j and X = k i= A i We will show below that if R is an equivalence relation on a set X, then the collection P R = {[x] : x X} is a partition of X Conversely, if P = {A, A,, A k } is a partition of X, then the relation is an equivalence relation on X R P = k A i A i i= Theorem 55 Let R be an equivalence relation on a set X, and let P = {A, A,, A k } be a partition of X Then ( P R is a partition of X; ( R P is an equivalence relation on X; ( R PR = R, P RP = P 8

Week 4-5: Generating Permutations and Combinations

Week 4-5: Generating Permutations and Combinations Week 4-5: Generating Permutations and Combinations February 27, 2017 1 Generating Permutations We have learned that there are n! permutations of {1, 2,...,n}. It is important in many instances to generate

More information

MATH 433 Applied Algebra Lecture 14: Functions. Relations.

MATH 433 Applied Algebra Lecture 14: Functions. Relations. MATH 433 Applied Algebra Lecture 14: Functions. Relations. Cartesian product Definition. The Cartesian product X Y of two sets X and Y is the set of all ordered pairs (x,y) such that x X and y Y. The Cartesian

More information

Relations MATH Relations. Benjamin V.C. Collins, James A. Swenson MATH 2730

Relations MATH Relations. Benjamin V.C. Collins, James A. Swenson MATH 2730 MATH 2730 Benjamin V.C. Collins James A. Swenson among integers equals a = b is true for some pairs (a, b) Z Z, but not for all pairs. is less than a < b is true for some pairs (a, b) Z Z, but not for

More information

3. R = = on Z. R, S, A, T.

3. R = = on Z. R, S, A, T. 6 Relations Let R be a relation on a set A, i.e., a subset of AxA. Notation: xry iff (x, y) R AxA. Recall: A relation need not be a function. Example: The relation R 1 = {(x, y) RxR x 2 + y 2 = 1} is not

More information

9 RELATIONS. 9.1 Reflexive, symmetric and transitive relations. MATH Foundations of Pure Mathematics

9 RELATIONS. 9.1 Reflexive, symmetric and transitive relations. MATH Foundations of Pure Mathematics MATH10111 - Foundations of Pure Mathematics 9 RELATIONS 9.1 Reflexive, symmetric and transitive relations Let A be a set with A. A relation R on A is a subset of A A. For convenience, for x, y A, write

More information

Sets. A set is a collection of objects without repeats. The size or cardinality of a set S is denoted S and is the number of elements in the set.

Sets. A set is a collection of objects without repeats. The size or cardinality of a set S is denoted S and is the number of elements in the set. Sets A set is a collection of objects without repeats. The size or cardinality of a set S is denoted S and is the number of elements in the set. If A and B are sets, then the set of ordered pairs each

More information

Economics 204 Summer/Fall 2017 Lecture 1 Monday July 17, 2017

Economics 204 Summer/Fall 2017 Lecture 1 Monday July 17, 2017 Economics 04 Summer/Fall 07 Lecture Monday July 7, 07 Section.. Methods of Proof We begin by looking at the notion of proof. What is a proof? Proof has a formal definition in mathematical logic, and a

More information

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products Chapter 3 Cartesian Products and Relations The material in this chapter is the first real encounter with abstraction. Relations are very general thing they are a special type of subset. After introducing

More information

Relations and Equivalence Relations

Relations and Equivalence Relations Relations and Equivalence Relations In this section, we shall introduce a formal definition for the notion of a relation on a set. This is something we often take for granted in elementary algebra courses,

More information

Week 4-5: Binary Relations

Week 4-5: Binary Relations 1 Binary Relations Week 4-5: Binary Relations The concept of relation is common in daily life and seems intuitively clear. For instance, let X be the set of all living human females and Y the set of all

More information

Relations (3A) Young Won Lim 3/27/18

Relations (3A) Young Won Lim 3/27/18 Relations (3A) Copyright (c) 2015 2018 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later

More information

CIS 375 Intro to Discrete Mathematics Exam 3 (Section M004: Blue) 6 December Points Possible

CIS 375 Intro to Discrete Mathematics Exam 3 (Section M004: Blue) 6 December Points Possible Name: CIS 375 Intro to Discrete Mathematics Exam 3 (Section M004: Blue) 6 December 2016 Question Points Possible Points Received 1 12 2 14 3 14 4 12 5 16 6 16 7 16 Total 100 Instructions: 1. This exam

More information

CIS 375 Intro to Discrete Mathematics Exam 3 (Section M001: Green) 6 December Points Possible

CIS 375 Intro to Discrete Mathematics Exam 3 (Section M001: Green) 6 December Points Possible Name: CIS 375 Intro to Discrete Mathematics Exam 3 (Section M001: Green) 6 December 2016 Question Points Possible Points Received 1 12 2 14 3 14 4 12 5 16 6 16 7 16 Total 100 Instructions: 1. This exam

More information

Week 4-5: Binary Relations

Week 4-5: Binary Relations 1 Binary Relations Week 4-5: Binary Relations The concept of relation is common in daily life and seems intuitively clear. For instance, let X be the set of all living human females and Y the set of all

More information

a + b = b + a and a b = b a. (a + b) + c = a + (b + c) and (a b) c = a (b c). a (b + c) = a b + a c and (a + b) c = a c + b c.

a + b = b + a and a b = b a. (a + b) + c = a + (b + c) and (a b) c = a (b c). a (b + c) = a b + a c and (a + b) c = a c + b c. Properties of the Integers The set of all integers is the set and the subset of Z given by Z = {, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, }, N = {0, 1, 2, 3, 4, }, is the set of nonnegative integers (also called

More information

Properties of the Integers

Properties of the Integers Properties of the Integers The set of all integers is the set and the subset of Z given by Z = {, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, }, N = {0, 1, 2, 3, 4, }, is the set of nonnegative integers (also called

More information

Definition: A binary relation R from a set A to a set B is a subset R A B. Example:

Definition: A binary relation R from a set A to a set B is a subset R A B. Example: Chapter 9 1 Binary Relations Definition: A binary relation R from a set A to a set B is a subset R A B. Example: Let A = {0,1,2} and B = {a,b} {(0, a), (0, b), (1,a), (2, b)} is a relation from A to B.

More information

Lecture 7: Relations

Lecture 7: Relations Lecture 7: Relations 1 Relation Relation between two objects signify some connection between them. For example, relation of one person being biological parent of another. If we take any two people at random,

More information

Relations. We have seen several types of abstract, mathematical objects, including propositions, predicates, sets, and ordered pairs and tuples.

Relations. We have seen several types of abstract, mathematical objects, including propositions, predicates, sets, and ordered pairs and tuples. Relations We have seen several types of abstract, mathematical objects, including propositions, predicates, sets, and ordered pairs and tuples. Relations use ordered tuples to represent relationships among

More information

Chapter 1. Sets and Numbers

Chapter 1. Sets and Numbers Chapter 1. Sets and Numbers 1. Sets A set is considered to be a collection of objects (elements). If A is a set and x is an element of the set A, we say x is a member of A or x belongs to A, and we write

More information

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010)

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010) http://math.sun.ac.za/amsc/sam Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics 2009-2010 Lecture notes in progress (27 March 2010) Contents 2009 Semester I: Elements 5 1. Cartesian product

More information

Discrete Structures (2IT50)

Discrete Structures (2IT50) Discrete Structures (2IT50) Rob Hoogerwoord & Hans Zantema August, 2016 1 2 Contents 0.1 Introduction................................. 5 0.2 Basic set theory............................... 5 0.3 The principle

More information

CSC Discrete Math I, Spring Relations

CSC Discrete Math I, Spring Relations CSC 125 - Discrete Math I, Spring 2017 Relations Binary Relations Definition: A binary relation R from a set A to a set B is a subset of A B Note that a relation is more general than a function Example:

More information

Introduction. Foundations of Computing Science. Pallab Dasgupta Professor, Dept. of Computer Sc & Engg INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

Introduction. Foundations of Computing Science. Pallab Dasgupta Professor, Dept. of Computer Sc & Engg INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR 1 Introduction Foundations of Computing Science Pallab Dasgupta Professor, Dept. of Computer Sc & Engg 2 Comments on Alan Turing s Paper "On Computable Numbers, with an Application to the Entscheidungs

More information

Chapter 6. Relations. 6.1 Relations

Chapter 6. Relations. 6.1 Relations Chapter 6 Relations Mathematical relations are an extremely general framework for specifying relationships between pairs of objects. This chapter surveys the types of relations that can be constructed

More information

Section Summary. Relations and Functions Properties of Relations. Combining Relations

Section Summary. Relations and Functions Properties of Relations. Combining Relations Chapter 9 Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations Closures of Relations (not currently included

More information

Packet #5: Binary Relations. Applied Discrete Mathematics

Packet #5: Binary Relations. Applied Discrete Mathematics Packet #5: Binary Relations Applied Discrete Mathematics Table of Contents Binary Relations Summary Page 1 Binary Relations Examples Page 2 Properties of Relations Page 3 Examples Pages 4-5 Representations

More information

Relations --- Binary Relations. Debdeep Mukhopadhyay IIT Madras

Relations --- Binary Relations. Debdeep Mukhopadhyay IIT Madras Relations --- Binary Relations Debdeep Mukhopadhyay IIT Madras What is a relation? The mathematical concept of relation is based on the common notion of relationships among objects: One box is heavier

More information

Selected Solutions to Even Problems, Part 3

Selected Solutions to Even Problems, Part 3 Selected Solutions to Even Problems, Part 3 March 14, 005 Page 77 6. If one selects 101 integers from among {1,,..., 00}, then at least two of these numbers must be consecutive, and therefore coprime (which

More information

Foundations of algebra

Foundations of algebra Foundations of algebra Equivalence relations - suggested problems - solutions P1: There are several relations that you are familiar with: Relations on R (or any of its subsets): Equality. Symbol: x = y.

More information

XMA2C011, Annual Examination 2012: Worked Solutions

XMA2C011, Annual Examination 2012: Worked Solutions XMA2C011, Annual Examination 2012: Worked Solutions David R. Wilkins 1. (a) Let A, B and C be sets. Prove that A (B \ C) = (A B) \ (A C). We show that every element of A (B \ C) is an element of (A B)

More information

Reading 11 : Relations and Functions

Reading 11 : Relations and Functions CS/Math 240: Introduction to Discrete Mathematics Fall 2015 Reading 11 : Relations and Functions Instructor: Beck Hasti and Gautam Prakriya In reading 3, we described a correspondence between predicates

More information

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes These notes form a brief summary of what has been covered during the lectures. All the definitions must be memorized and understood. Statements

More information

Relations. Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations. Reading (Epp s textbook)

Relations. Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations. Reading (Epp s textbook) Relations Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations Reading (Epp s textbook) 8.-8.3. Cartesian Products The symbol (a, b) denotes the ordered

More information

Relations. Relations. Definition. Let A and B be sets.

Relations. Relations. Definition. Let A and B be sets. Relations Relations. Definition. Let A and B be sets. A relation R from A to B is a subset R A B. If a A and b B, we write a R b if (a, b) R, and a /R b if (a, b) / R. A relation from A to A is called

More information

EQUIVALENCE RELATIONS (NOTES FOR STUDENTS) 1. RELATIONS

EQUIVALENCE RELATIONS (NOTES FOR STUDENTS) 1. RELATIONS EQUIVALENCE RELATIONS (NOTES FOR STUDENTS) LIOR SILBERMAN Version 1.0 compiled September 9, 2015. 1.1. List of examples. 1. RELATIONS Equality of real numbers: for some x,y R we have x = y. For other pairs

More information

HL Test 2018 Sets, Relations and Groups [50 marks]

HL Test 2018 Sets, Relations and Groups [50 marks] HL Test 2018 Sets, Relations and Groups [50 marks] The binary operation multiplication modulo 10, denoted by 10, is defined on the set T = {2, 4, 6, 8} and represented in the following Cayley table. 1a.

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 1 Course Web Page www3.cs.stonybrook.edu/ cse303 The webpage contains: lectures notes slides; very detailed solutions to

More information

Chapter 9: Relations Relations

Chapter 9: Relations Relations Chapter 9: Relations 9.1 - Relations Definition 1 (Relation). Let A and B be sets. A binary relation from A to B is a subset R A B, i.e., R is a set of ordered pairs where the first element from each pair

More information

Discrete Mathematics with Applications MATH236

Discrete Mathematics with Applications MATH236 Discrete Mathematics with Applications MATH236 Dr. Hung P. Tong-Viet School of Mathematics, Statistics and Computer Science University of KwaZulu-Natal Pietermaritzburg Campus Semester 1, 2013 Tong-Viet

More information

Section 7.1 Relations and Their Properties. Definition: A binary relation R from a set A to a set B is a subset R A B.

Section 7.1 Relations and Their Properties. Definition: A binary relation R from a set A to a set B is a subset R A B. Section 7.1 Relations and Their Properties Definition: A binary relation R from a set A to a set B is a subset R A B. Note: there are no constraints on relations as there are on functions. We have a common

More information

Relations. Definition 1 Let A and B be sets. A binary relation R from A to B is any subset of A B.

Relations. Definition 1 Let A and B be sets. A binary relation R from A to B is any subset of A B. Chapter 5 Relations Definition 1 Let A and B be sets. A binary relation R from A to B is any subset of A B. If A = B then a relation from A to B is called is called a relation on A. Examples A relation

More information

Copyright c 2007 Jason Underdown Some rights reserved. statement. sentential connectives. negation. conjunction. disjunction

Copyright c 2007 Jason Underdown Some rights reserved. statement. sentential connectives. negation. conjunction. disjunction Copyright & License Copyright c 2007 Jason Underdown Some rights reserved. statement sentential connectives negation conjunction disjunction implication or conditional antecedant & consequent hypothesis

More information

Report 1 The Axiom of Choice

Report 1 The Axiom of Choice Report 1 The Axiom of Choice By Li Yu This report is a collection of the material I presented in the first round presentation of the course MATH 2002. The report focuses on the principle of recursive definition,

More information

MATH1240 Definitions and Theorems

MATH1240 Definitions and Theorems MATH1240 Definitions and Theorems 1 Fundamental Principles of Counting For an integer n 0, n factorial (denoted n!) is defined by 0! = 1, n! = (n)(n 1)(n 2) (3)(2)(1), for n 1. Given a collection of n

More information

We want to show P (n) is true for all integers

We want to show P (n) is true for all integers Generalized Induction Proof: Let P (n) be the proposition 1 + 2 + 2 2 + + 2 n = 2 n+1 1. We want to show P (n) is true for all integers n 0. Generalized Induction Example: Use generalized induction to

More information

Chapter VI. Relations. Assumptions are the termites of relationships. Henry Winkler

Chapter VI. Relations. Assumptions are the termites of relationships. Henry Winkler Chapter VI Relations Assumptions are the termites of relationships. Henry Winkler Studying relationships between objects can yield important information about the objects themselves. In the real numbers,

More information

Gray Codes and Overlap Cycles for Restricted Weight Words

Gray Codes and Overlap Cycles for Restricted Weight Words Gray Codes and Overlap Cycles for Restricted Weight Words Victoria Horan Air Force Research Laboratory Information Directorate Glenn Hurlbert School of Mathematical and Statistical Sciences Arizona State

More information

Combinatorial algorithms

Combinatorial algorithms Combinatorial algorithms computing subset rank and unrank, Gray codes, k-element subset rank and unrank, computing permutation rank and unrank Jiří Vyskočil, Radek Mařík 2012 Combinatorial Generation definition:

More information

Massachusetts Institute of Technology 6.042J/18.062J, Fall 02: Mathematics for Computer Science Professor Albert Meyer and Dr.

Massachusetts Institute of Technology 6.042J/18.062J, Fall 02: Mathematics for Computer Science Professor Albert Meyer and Dr. Massachusetts Institute of Technology 6.042J/18.062J, Fall 02: Mathematics for Computer Science Professor Albert Meyer and Dr. Radhika Nagpal Quiz 1 Appendix Appendix Contents 1 Induction 2 2 Relations

More information

Relations, Functions, and Sequences

Relations, Functions, and Sequences MCS-236: Graph Theory Handout #A3 San Skulrattanakulchai Gustavus Adolphus College Sep 13, 2010 Relations, Functions, and Sequences Relations An ordered pair can be constructed from any two mathematical

More information

Notes. Relations. Introduction. Notes. Relations. Notes. Definition. Example. Slides by Christopher M. Bourke Instructor: Berthe Y.

Notes. Relations. Introduction. Notes. Relations. Notes. Definition. Example. Slides by Christopher M. Bourke Instructor: Berthe Y. Relations Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 7.1, 7.3 7.5 of Rosen cse235@cse.unl.edu

More information

MATH 13 SAMPLE FINAL EXAM SOLUTIONS

MATH 13 SAMPLE FINAL EXAM SOLUTIONS MATH 13 SAMPLE FINAL EXAM SOLUTIONS WINTER 2014 Problem 1 (15 points). For each statement below, circle T or F according to whether the statement is true or false. You do NOT need to justify your answers.

More information

Equivalence relations

Equivalence relations Equivalence relations R A A is an equivalence relation if R is 1. reflexive (a, a) R 2. symmetric, and (a, b) R (b, a) R 3. transitive. (a, b), (b, c) R (a, c) R Example: Let S be a relation on people

More information

COMP 182 Algorithmic Thinking. Relations. Luay Nakhleh Computer Science Rice University

COMP 182 Algorithmic Thinking. Relations. Luay Nakhleh Computer Science Rice University COMP 182 Algorithmic Thinking Relations Luay Nakhleh Computer Science Rice University Chapter 9, Section 1-6 Reading Material When we defined the Sorting Problem, we stated that to sort the list, the elements

More information

Solutions to In Class Problems Week 4, Mon.

Solutions to In Class Problems Week 4, Mon. Massachusetts Institute of Technology 6.042J/18.062J, Fall 05: Mathematics for Computer Science September 26 Prof. Albert R. Meyer and Prof. Ronitt Rubinfeld revised September 26, 2005, 1050 minutes Solutions

More information

Graph Theory. Thomas Bloom. February 6, 2015

Graph Theory. Thomas Bloom. February 6, 2015 Graph Theory Thomas Bloom February 6, 2015 1 Lecture 1 Introduction A graph (for the purposes of these lectures) is a finite set of vertices, some of which are connected by a single edge. Most importantly,

More information

Relations Graphical View

Relations Graphical View Introduction Relations Computer Science & Engineering 235: Discrete Mathematics Christopher M. Bourke cbourke@cse.unl.edu Recall that a relation between elements of two sets is a subset of their Cartesian

More information

21-301, Spring 2019 Homework 4 Solutions

21-301, Spring 2019 Homework 4 Solutions 21-301, Spring 2019 Homework 4 Solutions Michael Anastos Not to be published without written consent of the author or the instructors of the course. (Please contact me if you find any errors!) Problem

More information

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4 Do the following exercises from the text: Chapter (Section 3):, 1, 17(a)-(b), 3 Prove that 1 3 + 3 + + n 3 n (n + 1) for all n N Proof The proof is by induction on n For n N, let S(n) be the statement

More information

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations Page 1 Definitions Tuesday, May 8, 2018 12:23 AM Notations " " means "equals, by definition" the set of all real numbers the set of integers Denote a function from a set to a set by Denote the image of

More information

SOME TRANSFINITE INDUCTION DEDUCTIONS

SOME TRANSFINITE INDUCTION DEDUCTIONS SOME TRANSFINITE INDUCTION DEDUCTIONS SYLVIA DURIAN Abstract. This paper develops the ordinal numbers and transfinite induction, then demonstrates some interesting applications of transfinite induction.

More information

1.4 Equivalence Relations and Partitions

1.4 Equivalence Relations and Partitions 24 CHAPTER 1. REVIEW 1.4 Equivalence Relations and Partitions 1.4.1 Equivalence Relations Definition 1.4.1 (Relation) A binary relation or a relation on a set S is a set R of ordered pairs. This is a very

More information

Intersecting curves (variation on an observation of Maxim Kontsevich) by Étienne GHYS

Intersecting curves (variation on an observation of Maxim Kontsevich) by Étienne GHYS Intersecting curves (variation on an observation of Maxim Kontsevich) by Étienne GHYS Abstract Consider the graphs of n distinct polynomials of a real variable intersecting at some point. In the neighborhood

More information

On sets, functions and relations

On sets, functions and relations On sets, functions and relations Chapter 2 Rosalie Iemhoff 1 Contents 1 Relations 3 1.1 Cartesian product.......................... 4 1.2 Disjoint sum............................. 5 1.3 Relations of arbitrary

More information

Practice Exam 1 CIS/CSE 607, Spring 2009

Practice Exam 1 CIS/CSE 607, Spring 2009 Practice Exam 1 CIS/CSE 607, Spring 2009 Problem 1) Let R be a reflexive binary relation on a set A. Prove that R is transitive if, and only if, R = R R. Problem 2) Give an example of a transitive binary

More information

Multiple Choice Questions for Review

Multiple Choice Questions for Review Equivalence and Order Multiple Choice Questions for Review In each case there is one correct answer (given at the end of the problem set). Try to work the problem first without looking at the answer. Understand

More information

Set theory. Math 304 Spring 2007

Set theory. Math 304 Spring 2007 Math 304 Spring 2007 Set theory Contents 1. Sets 2 1.1. Objects and set formation 2 1.2. Unions and intersections 3 1.3. Differences 4 1.4. Power sets 4 1.5. Ordered pairs and binary,amscdcartesian products

More information

The Advantage Testing Foundation Olympiad Solutions

The Advantage Testing Foundation Olympiad Solutions The Advantage Testing Foundation 015 Olympiad Problem 1 Prove that every positive integer has a unique representation in the form d i i, where k is a nonnegative integer and each d i is either 1 or. (This

More information

arxiv: v2 [cs.dm] 29 Mar 2013

arxiv: v2 [cs.dm] 29 Mar 2013 arxiv:1302.6346v2 [cs.dm] 29 Mar 2013 Fixed point theorems for Boolean networks expressed in terms of forbidden subnetworks Adrien Richard Laboratoire I3S, CNRS & Université de Nice-Sophia Antipolis, France.

More information

A BRIEF INTRODUCTION TO ZFC. Contents. 1. Motivation and Russel s Paradox

A BRIEF INTRODUCTION TO ZFC. Contents. 1. Motivation and Russel s Paradox A BRIEF INTRODUCTION TO ZFC CHRISTOPHER WILSON Abstract. We present a basic axiomatic development of Zermelo-Fraenkel and Choice set theory, commonly abbreviated ZFC. This paper is aimed in particular

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 3 CHAPTER 1 SETS, RELATIONS, and LANGUAGES 6. Closures and Algorithms 7. Alphabets and Languages 8. Finite Representation

More information

SYSTEMS ANALYSIS LECTURE 2 SYSTEM IDENTIFICATION. Zuzana Bělinová

SYSTEMS ANALYSIS LECTURE 2 SYSTEM IDENTIFICATION. Zuzana Bělinová SYSTEMS ANALYSIS LECTURE 2 SYSTEM IDENTIFICATION Zuzana Bělinová Summary Extended Inductive Definition of System S = (A/F, R/P, M,,, I) Summary - system identification 1. Choice of the level of distinguish

More information

DISCRETIZED CONFIGURATIONS AND PARTIAL PARTITIONS

DISCRETIZED CONFIGURATIONS AND PARTIAL PARTITIONS DISCRETIZED CONFIGURATIONS AND PARTIAL PARTITIONS AARON ABRAMS, DAVID GAY, AND VALERIE HOWER Abstract. We show that the discretized configuration space of k points in the n-simplex is homotopy equivalent

More information

REVIEW QUESTIONS. Chapter 1: Foundations: Sets, Logic, and Algorithms

REVIEW QUESTIONS. Chapter 1: Foundations: Sets, Logic, and Algorithms REVIEW QUESTIONS Chapter 1: Foundations: Sets, Logic, and Algorithms 1. Why can t a Venn diagram be used to prove a statement about sets? 2. Suppose S is a set with n elements. Explain why the power set

More information

Complete Induction and the Well- Ordering Principle

Complete Induction and the Well- Ordering Principle Complete Induction and the Well- Ordering Principle Complete Induction as a Rule of Inference In mathematical proofs, complete induction (PCI) is a rule of inference of the form P (a) P (a + 1) P (b) k

More information

Chapter 4. Measure Theory. 1. Measure Spaces

Chapter 4. Measure Theory. 1. Measure Spaces Chapter 4. Measure Theory 1. Measure Spaces Let X be a nonempty set. A collection S of subsets of X is said to be an algebra on X if S has the following properties: 1. X S; 2. if A S, then A c S; 3. if

More information

Simplification by Truth Table and without Truth Table

Simplification by Truth Table and without Truth Table Engineering Mathematics 2013 SUBJECT NAME SUBJECT CODE MATERIAL NAME MATERIAL CODE REGULATION UPDATED ON : Discrete Mathematics : MA2265 : University Questions : SKMA1006 : R2008 : August 2013 Name of

More information

School of Mathematics and Statistics. MT1003 Pure Mathematics. Handout 0: Course Information

School of Mathematics and Statistics. MT1003 Pure Mathematics. Handout 0: Course Information MRQ 2006 School of Mathematics and Statistics MT1003 Pure Mathematics Handout 0: Course Information Lecturer: Martyn Quick, Mathematical Institute, Room 210. Recommended Texts: D. M. Burton, Elementary

More information

Finite Automata and Regular Languages

Finite Automata and Regular Languages Finite Automata and Regular Languages Topics to be covered in Chapters 1-4 include: deterministic vs. nondeterministic FA, regular expressions, one-way vs. two-way FA, minimization, pumping lemma for regular

More information

What are relations? f: A B

What are relations? f: A B What are relations? Ch 9.1 What are relations? Notation Informally, a relation is a set of pairs of objects (or in general, set of n-tuples) that are related to each other by some rule. We will focus first

More information

CHAPTER 1. Relations. 1. Relations and Their Properties. Discussion

CHAPTER 1. Relations. 1. Relations and Their Properties. Discussion CHAPTER 1 Relations 1. Relations and Their Properties 1.1. Definition of a Relation. Definition 1.1.1. A binary relation from a set A to a set B is a subset R A B. If (a, b) R we say a is Related to b

More information

5 Flows and cuts in digraphs

5 Flows and cuts in digraphs 5 Flows and cuts in digraphs Recall that a digraph or network is a pair G = (V, E) where V is a set and E is a multiset of ordered pairs of elements of V, which we refer to as arcs. Note that two vertices

More information

Chapter 5: Integer Compositions and Partitions and Set Partitions

Chapter 5: Integer Compositions and Partitions and Set Partitions Chapter 5: Integer Compositions and Partitions and Set Partitions Prof. Tesler Math 184A Winter 2017 Prof. Tesler Ch. 5: Compositions and Partitions Math 184A / Winter 2017 1 / 32 5.1. Compositions A strict

More information

5. Partitions and Relations Ch.22 of PJE.

5. Partitions and Relations Ch.22 of PJE. 5. Partitions and Relations Ch. of PJE. We now generalize the ideas of congruence classes of Z to classes of any set X. The properties of congruence classes that we start with here are that they are disjoint

More information

Bulletin of the Iranian Mathematical Society

Bulletin of the Iranian Mathematical Society ISSN: 117-6X (Print) ISSN: 1735-8515 (Online) Bulletin of the Iranian Mathematical Society Vol. 4 (14), No. 6, pp. 1491 154. Title: The locating chromatic number of the join of graphs Author(s): A. Behtoei

More information

Discrete Structures May 13, (40 points) Define each of the following terms:

Discrete Structures May 13, (40 points) Define each of the following terms: Discrete Structures May 13, 2014 Prof Feighn Final Exam 1. (40 points) Define each of the following terms: (a) (binary) relation: A binary relation from a set X to a set Y is a subset of X Y. (b) function:

More information

MODEL ANSWERS TO THE SEVENTH HOMEWORK. (b) We proved in homework six, question 2 (c) that. But we also proved homework six, question 2 (a) that

MODEL ANSWERS TO THE SEVENTH HOMEWORK. (b) We proved in homework six, question 2 (c) that. But we also proved homework six, question 2 (a) that MODEL ANSWERS TO THE SEVENTH HOMEWORK 1. Let X be a finite set, and let A, B and A 1, A 2,..., A n be subsets of X. Let A c = X \ A denote the complement. (a) χ A (x) = A. x X (b) We proved in homework

More information

Discrete Mathematics Fall 2018 Midterm Exam Prof. Callahan. Section: NetID: Multiple Choice Question (30 questions in total, 4 points each)

Discrete Mathematics Fall 2018 Midterm Exam Prof. Callahan. Section: NetID: Multiple Choice Question (30 questions in total, 4 points each) Discrete Mathematics Fall 2018 Midterm Exam Prof. Callahan Section: NetID: Name: Multiple Choice Question (30 questions in total, 4 points each) 1 Consider the following propositions: f: The student got

More information

Ranking Score Vectors of Tournaments

Ranking Score Vectors of Tournaments Utah State University DigitalCommons@USU All Graduate Plan B and other Reports Graduate Studies 5-2011 Ranking Score Vectors of Tournaments Sebrina Ruth Cropper Utah State University Follow this and additional

More information

Basic Proof Examples

Basic Proof Examples Basic Proof Examples Lisa Oberbroeckling Loyola University Maryland Fall 2015 Note. In this document, we use the symbol as the negation symbol. Thus p means not p. There are four basic proof techniques

More information

Chapter 5: Integer Compositions and Partitions and Set Partitions

Chapter 5: Integer Compositions and Partitions and Set Partitions Chapter 5: Integer Compositions and Partitions and Set Partitions Prof. Tesler Math 184A Fall 2017 Prof. Tesler Ch. 5: Compositions and Partitions Math 184A / Fall 2017 1 / 46 5.1. Compositions A strict

More information

Midterm Exam. There are 6 problems. Your 5 best answers count. Please pay attention to the presentation of your work! Best 5

Midterm Exam. There are 6 problems. Your 5 best answers count. Please pay attention to the presentation of your work! Best 5 Department of Mathematical Sciences Instructor: Daiva Pucinskaite Modern Algebra June 22, 2017 Midterm Exam There are 6 problems. Your 5 best answers count. Please pay attention to the presentation of

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Today's learning goals Determine whether a relation is an equivalence relation by determining whether it is Reflexive Symmetric

More information

Strange Combinatorial Connections. Tom Trotter

Strange Combinatorial Connections. Tom Trotter Strange Combinatorial Connections Tom Trotter Georgia Institute of Technology trotter@math.gatech.edu February 13, 2003 Proper Graph Colorings Definition. A proper r- coloring of a graph G is a map φ from

More information

MATH 220 (all sections) Homework #12 not to be turned in posted Friday, November 24, 2017

MATH 220 (all sections) Homework #12 not to be turned in posted Friday, November 24, 2017 MATH 220 (all sections) Homework #12 not to be turned in posted Friday, November 24, 2017 Definition: A set A is finite if there exists a nonnegative integer c such that there exists a bijection from A

More information

Preliminaries to the Theory of Computation

Preliminaries to the Theory of Computation Preliminaries to the Theory of Computation 2 In this chapter, we explain mathematical notions, terminologies, and certain methods used in convincing logical arguments that we shall have need of throughout

More information

Generating p-extremal graphs

Generating p-extremal graphs Generating p-extremal graphs Derrick Stolee Department of Mathematics Department of Computer Science University of Nebraska Lincoln s-dstolee1@math.unl.edu August 2, 2011 Abstract Let f(n, p be the maximum

More information

CMPSCI 250: Introduction to Computation. Lecture #11: Equivalence Relations David Mix Barrington 27 September 2013

CMPSCI 250: Introduction to Computation. Lecture #11: Equivalence Relations David Mix Barrington 27 September 2013 CMPSCI 250: Introduction to Computation Lecture #11: Equivalence Relations David Mix Barrington 27 September 2013 Equivalence Relations Definition of Equivalence Relations Two More Examples: Universal

More information

MITOCW Lec 11 MIT 6.042J Mathematics for Computer Science, Fall 2010

MITOCW Lec 11 MIT 6.042J Mathematics for Computer Science, Fall 2010 MITOCW Lec 11 MIT 6.042J Mathematics for Computer Science, Fall 2010 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high

More information