Mathematics for Computer Science Exercises from Week 4

Similar documents
Homework Set #2 Math 440 Topology Topology by J. Munkres

Introduction to Sets and Logic (MATH 1190)

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

EDAA40 At home exercises 1

Review of Sets. Review. Philippe B. Laval. Current Semester. Kennesaw State University. Philippe B. Laval (KSU) Sets Current Semester 1 / 16

TOPOLOGY, DR. BLOCK, FALL 2015, NOTES, PART 3.

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

Functions. How is this definition written in symbolic logic notation?

2. Functions, sets, countability and uncountability. Let A, B be sets (often, in this module, subsets of R).

CSC Discrete Math I, Spring Sets

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

MATHEMATICS 191, FALL 2004 MATHEMATICAL PROBABILITY Outline #1 (Countability and Uncountability)

Discrete Mathematics Lecture 4. Harper Langston New York University

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

Nim-Regularity of Graphs

Logic and Discrete Mathematics. Section 2.5 Equivalence relations and partitions

This Lecture. We will first introduce some basic set theory before we do counting. Basic Definitions. Operations on Sets.

5. Lecture notes on matroid intersection

Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103. Chapter 2. Sets

Comparing sizes of sets

BOOLEAN ALGEBRA AND CIRCUITS

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

AXIOMS FOR THE INTEGERS

CSE 20 DISCRETE MATH. Fall

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Sections p.

6. Lecture notes on matroid intersection

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

Suppose we have a function p : X Y from a topological space X onto a set Y. we want to give a topology on Y so that p becomes a continuous map.

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

9.5 Equivalence Relations

Algebra of Sets (Mathematics & Logic A)

CSE 20 DISCRETE MATH. Winter

1.1 - Introduction to Sets

Let A(x) be x is an element of A, and B(x) be x is an element of B.

Lecture 15: The subspace topology, Closed sets

1.2 Venn Diagrams and Partitions


Computer Science and Mathematics. Part I: Fundamental Mathematical Concepts Winfried Kurth

T. Background material: Topology

Johns Hopkins Math Tournament Proof Round: Point Set Topology

2. Sets. 2.1&2.2: Sets and Subsets. Combining Sets. c Dr Oksana Shatalov, Fall

Extra Practice Problems 2

Notes on categories, the subspace topology and the product topology

4 Basis, Subbasis, Subspace

Algebra of Sets. Aditya Ghosh. April 6, 2018 It is recommended that while reading it, sit with a pen and a paper.

10/11/2018. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings

Topology I Test 1 Solutions October 13, 2008

Topology problem set Integration workshop 2010

8 NP-complete problem Hard problems: demo

Functions. Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A.

2.1 Sets 2.2 Set Operations

11.4 Bipartite Multigraphs

Online Appendix: A Stackelberg Game Model for Botnet Data Exfiltration

Topology 550A Homework 3, Week 3 (Corrections: February 22, 2012)

Functions 2/1/2017. Exercises. Exercises. Exercises. and the following mathematical appetizer is about. Functions. Functions

COUNTING THE NUMBER OF WINNING BINARY STRINGS IN THE 1-DIMENSIONAL SAME GAME. Department of Mathematics Oberlin College Oberlin OH 44074

A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY

4 Mathematical Data Types

NP-Hardness. We start by defining types of problem, and then move on to defining the polynomial-time reductions.

4&5 Binary Operations and Relations. The Integers. (part I)

Theorem 3.1 (Berge) A matching M in G is maximum if and only if there is no M- augmenting path.

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition.

(i, j)-almost Continuity and (i, j)-weakly Continuity in Fuzzy Bitopological Spaces

2 A topological interlude

Sets and set operations

Lecture 25 : Counting DRAFT

Solution: It may be helpful to list out exactly what is in each of these events:

CSE 20 DISCRETE MATH WINTER

CONNECTED SPACES AND HOW TO USE THEM

Finding a winning strategy in variations of Kayles

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

Intersection of sets *

Math 190: Quotient Topology Supplement

Division of the Humanities and Social Sciences. Convex Analysis and Economic Theory Winter Separation theorems

Assignment 4 Solutions of graph problems

Topology Homework 3. Section Section 3.3. Samuel Otten

Vertex Deletion games with Parity rules

Open and Closed Sets

Lecture 1: Examples, connectedness, paths and cycles

Figure 1.1: This is an illustration of a generic set and its elements.

The Game of Hex and Brouwer s Fixed-Point Theorem. Michael Cao

EULER S FORMULA AND THE FIVE COLOR THEOREM

Final Test in MAT 410: Introduction to Topology Answers to the Test Questions

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

Topic: Orientation, Surfaces, and Euler characteristic

SETS. Sets are of two sorts: finite infinite A system of sets is a set, whose elements are again sets.

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np

A Generalization of the Nim and Wythoff games

Combinatorial Gems. Po-Shen Loh. June 2009

MC302 GRAPH THEORY SOLUTIONS TO HOMEWORK #1 9/19/13 68 points + 6 extra credit points

Characterization of Boolean Topological Logics

HW Graph Theory SOLUTIONS (hbovik)

LECTURE 8: SETS. Software Engineering Mike Wooldridge

Point-Set Topology 1. TOPOLOGICAL SPACES AND CONTINUOUS FUNCTIONS

The Language of Sets and Functions

Point-Set Topology II

Assignment # 4 Selected Solutions

Sets. De Morgan s laws. Mappings. Definition. Definition

Abstract Combinatorial Games

Notes on metric spaces and topology. Math 309: Topics in geometry. Dale Rolfsen. University of British Columbia

Transcription:

Mathematics for Computer Science Exercises from Week 4 Silvio Capobianco Last update: 26 September 2018 Problems from Section 4.1 Problem 4.3. Set Formulas and Propositional Formulas. (a) Verify that the propositional formula (P and Q) or (P and Q) is equivalent to P. (b) Prove that for all sets A, B, by showing A = (A B) (A B) x A iff x (A B) (A B) for all elements x using the equivalence of part (a) in a chain of iff s. Solution. (a) By using distributivity: (P and Q) or (P and Q) iff P and (Q or Q) iff (b) Let P ::= x A and Q ::= x B: then, iff P. P and T x A iff (x A and not(x B)) or (x A and x B) iff (x A B) or (x A B) iff x (A B) (A B). 1

Problem 4.4. Prove Theorem (Distributivity of union over intersection). A (B C) = (A B) (A C) (1) for all sets A, B, C, by using a chain of iff s to show that x A (B C) iff x (A B) (A C) for all elements x. You may assume the corresponding propositional equivalence 3.10. Solution. Let P ::= x A, Q ::= x B, and R ::= x C: we plan to use the distributive law for disjunction P or (Q and R) iff (P or Q) and (P or R), expressed by 3.10 in the textbook. So: x A (B C) iff x A or (x B and x C) where the second iff exploits 3.10. iff (x A or x B) and (x A or x C) iff (x A B) and (x A C) iff x (A B) (A C), Problem 4.6(a) Let A and B be sets. Prove that pow(a B) = pow(a) pow(b). Solution. Let S be a set. We must prove: S A B iff S A and S B (2) Suppose the left-hand side of (2) holds. Let x be an arbitrary element: then, x S implies x A B implies x A 2

because A B A; similarly, x S implies x B. We have thus proved that, if S A B, then S A and S B: that is, pow(a B) pow(a) pow(b). Suppose now that the right-hand side of (2) holds. Recall that such intersection is never empty, because the empty set is a subset of every set, thus an element of every power set. Let S A and S B: if S is empty, then S A B for sure; if S is not empty, then every element of S belongs to both A and B, thus to A B, and this shows S A B. We have thus proved that, if S A and S B, then S A B: that is, pow(a) pow(b) pow(a B). Double inclusion means equality. Problem 4.7 Subset take-away 1 is a two player game played with a finite set A of numbers. Players alternately choose nonempty subsets of A with the conditions that a player may not choose the whole set A, or any set containing a set that was named earlier. The first player who is unable to move loses the game. For example, if the size of A is one, then there are no legal moves and the second player wins. If A has exactly two elements, then the only legal moves are the two one-element subsets of A. Each is a good reply to the other, and so once again the second player wins. The first interesting case is when A has three elements. This time, if the first player picks a subset with one element, the second player picks the subset with the other two elements. If the first player picks a subset with two elements, the second player picks the subset whose sole member is the third element. In both cases, these moves lead to a situation that is the same as the start of a game on a set with two elements, and thus leads to a win for the second player. Verify that when A has four elements, the second player still has a winning strategy. 2 1 From Christensen & Tilford, David Gale s Subset Takeaway Game, American Mathematical Monthly, Oct. 1997 2 David Gale worked out some of the properties of this game and conjectured that the second player wins the game for any set A. This has been disproved in 2017 by Brouwer & Christensen. See arxiv:1702.03018 3

Solution. The first player can only take one, two, or three elements of A. Let us proceed by cases: 1. If the first player takes a one-element set, call that element a, and call b, c, and d the three remaining. If the second player takes {b}, she reduces the initial game to a game on the set {c, d}, which she wins. Alternatively, she can take {b, c, d}, and reduce the initial game to a game on that set, which she also wins. 2. If the first player takes a three-element set, call those elements a, b, and c, and call d the remaining element. If the second player takes {d}, she reduces the initial game to a game on the set {a, b, c}, which she wins. 3. The third and last case is the most interesting. If the first player takes a two-elements set, call those elements a and b, and call c and d the two remaining elements. The moves {a, b, c} and {a, b, d} are not legal anymore, but the moves {a, c, d} and {b, c, d} are. If the second player takes {c, d}, then {a, c, d} and {b, c, d} also become illegal, and every new move must be either a subset of {a, b}, or a subset of {c, d}, or another set with two elements. In the first two cases, the game will turn into two games, each on a two-element set, which the second player can win in sequence; as soon as one of the games is won, the four two-elements subsets which have not been chosen become illegal moves. In the third case, the second player can still act by complementation (e.g., if the first player chooses {a, d}, then the second player chooses {b, c}) because a set with four elements has six two-elements subset. After either two, four, or six two-elements subsets have been chosen, the game will turn into two two-objects games as before. Problems for Section 4.2 Problem 4.13. Prove that for any sets A, B, C and D, if the Cartesian products A B and C D are disjoint, then either A and C are disjoint or B and D are disjoint. 4

Solution. Recall that two sets are disjoint if they have no common elements. Let s prove the contrapositive: if A and C are not disjoint and B and D are not disjoint, then A B and C D are not disjoint. And this is easy to see: if x A C and y B D, then (x, y) (A B) (C D). Problem 4.14(a). Give a simple example where the following result fails, and briefly explain why: False Theorem. For sets A, B, C and D, let Then L = R. L ::= (A B) (C D), R ::= (A C) (B D). Solution. Suppose A = {1}, B = {2}, C = {3}, D = {4}: then (2, 3) is an element of L, but not of R. More nastily: if B and C are empty, but A and D are not, then L is not empty and R is. There is no such thing as a pair without a second element, or without a first element. The problem here is that the choices for the left and right component are independent in L, but not in R. In L, if we have chosen the first component from A, then we still have the option of choosing the second component from either C or D: but in R, we are forced to choose it from C. Problems for Section 4.4 We open this section with some definitions. If A is a set, then the identity relation Id A is the relation from A to A with graph {(a, a) a A}: that is, a is in relation Id A with b if and only if a = b. If R : A B and S : B C are relations, the composition of S with R (in this order) is the relation S R : A C defined by: a(s R)c iff b B. (arb and bsc). (3) 5

Problem 4.15. The inverse R 1 of a binary relation R from A to B is the relation from B to A defined by: br 1 A iff arb In other words, you get the diagram for R 1 from R by reversing the arrows in the diagram describing R. Now many of the relational properties of R correspond to different properties of R 1. For example, R is iff R 1 is. Fill in the remaining entries in this table: R is iff R 1 is Hint: Explain what s going on in terms of arrows from A to B in the diagram for R. Solution. We preliminarily observe that (R 1 ) 1 = R, as: Then we can immediately fill: a (R 1 ) 1 b iff b R 1 a iff a R b R is iff R 1 is To fill the rest of the table, we observe that the relation diagram of R 1 is obtained from that of R by first reflecting it along a vertical line which cuts the arrows in half, then reversing the direction of each arrow. This leads to the following important observation: R has the n in property if and only if R 1 has the n out property 6

where is either,, or =. As the inverse of the inverse relation is the original relation, the observation above also holds with the roles of R and R 1 swapped. We can now go on: R is iff R has the 1 out property iff R 1 has the 1 in property iff R 1 is To conclude, we recall that is a function which is both injective and surjective: in this case, R 1 is a surjective and injective relation which is both and, so it is also. And vice versa. The final table is thus: Problem 4.20. R is iff R 1 is Give an example of a relation R that is a injective function from a set A to itself but is not. Solution. Let A = N and xry iff y = x + 1: 1. R is. However given x, we always have x R (x + 1). 2. R is injective. If x + 1 = y + 1, then x = y. 3. R is. If xry and xrz, then y = x + 1 = z. 4. R is not, because it is not surjective. There is no natural number x such that x + 1 = 0. 7