Solutions to In-Class Problems Week 4, Mon.



Similar documents
Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Lecture 17 : Equivalence and Order Relations DRAFT

Examination paper for MA0301 Elementær diskret matematikk

Lecture 16 : Relations and Functions DRAFT

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Page 331, 38.4 Suppose a is a positive integer and p is a prime. Prove that p a if and only if the prime factorization of a contains p.

INTRODUCTORY SET THEORY

Discrete Mathematics. Hans Cuypers. October 11, 2007

MATHEMATICAL INDUCTION. Mathematical Induction. This is a powerful method to prove properties of positive integers.

Full and Complete Binary Trees

Every tree contains a large induced subgraph with all degrees odd

3. Mathematical Induction

So let us begin our quest to find the holy grail of real analysis.

Mathematical Induction. Lecture 10-11

SOLUTIONS TO ASSIGNMENT 1 MATH 576

Sample Induction Proofs

Mathematical Induction

This asserts two sets are equal iff they have the same elements, that is, a set is determined by its elements.

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

Cartesian Products and Relations

7.1 RELATIONS AND THEIR PROPERTIES

TOPOLOGY: THE JOURNEY INTO SEPARATION AXIOMS

Practice with Proofs

Homework until Test #2

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors.

C H A P T E R Regular Expressions regular expression

Mathematical Induction

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

1 = (a 0 + b 0 α) (a m 1 + b m 1 α) 2. for certain elements a 0,..., a m 1, b 0,..., b m 1 of F. Multiplying out, we obtain

4. CLASSES OF RINGS 4.1. Classes of Rings class operator A-closed Example 1: product Example 2:

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

MATH10040 Chapter 2: Prime and relatively prime numbers

Reading 13 : Finite State Automata and Regular Expressions

Computability Theory

NIM with Cash. Abstract. loses. This game has been well studied. For example, it is known that for NIM(1, 2, 3; n)

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

26 Ideals and Quotient Rings

k, then n = p2α 1 1 pα k

8 Divisibility and prime numbers

CS 103X: Discrete Structures Homework Assignment 3 Solutions

Introduction to Automata Theory. Reading: Chapter 1

6.2 Permutations continued

SCORE SETS IN ORIENTED GRAPHS

Basic Concepts of Point Set Topology Notes for OU course Math 4853 Spring 2011

Lecture Notes on Discrete Mathematics

Fundamentele Informatica II

1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal:

Graphs without proper subgraphs of minimum degree 3 and short cycles

Local periods and binary partial words: An algorithm

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

6.080/6.089 GITCS Feb 12, Lecture 3

Handout #1: Mathematical Reasoning

def: An axiom is a statement that is assumed to be true, or in the case of a mathematical system, is used to specify the system.

Solutions to Homework 6 Mathematics 503 Foundations of Mathematics Spring 2014

1. Prove that the empty set is a subset of every set.

RESULTANT AND DISCRIMINANT OF POLYNOMIALS

ALGEBRAIC APPROACH TO COMPOSITE INTEGER FACTORIZATION

Notes on Complexity Theory Last updated: August, Lecture 1

Lecture 13 - Basic Number Theory.

Math 55: Discrete Mathematics

Every Positive Integer is the Sum of Four Squares! (and other exciting problems)

Permutation Groups. Tom Davis April 2, 2003

Discrete Maths. Philippa Gardner. These lecture notes are based on previous notes by Iain Phillips.

Degree Hypergroupoids Associated with Hypergraphs

3. SETS, FUNCTIONS & RELATIONS

How To Prove The Dirichlet Unit Theorem

CPSC 121: Models of Computation Assignment #4, due Wednesday, July 22nd, 2009 at 14:00

Mathematics Review for MS Finance Students

= = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

You know from calculus that functions play a fundamental role in mathematics.

Chapter 17. Orthogonal Matrices and Symmetries of Space

INCIDENCE-BETWEENNESS GEOMETRY

Dedekind s forgotten axiom and why we should teach it (and why we shouldn t teach mathematical induction in our calculus classes)

6.042/18.062J Mathematics for Computer Science December 12, 2006 Tom Leighton and Ronitt Rubinfeld. Random Walks

SECTION 10-2 Mathematical Induction

The last three chapters introduced three major proof techniques: direct,

Math 4310 Handout - Quotient Vector Spaces

International Journal of Information Technology, Modeling and Computing (IJITMC) Vol.1, No.3,August 2013

MATH 4330/5330, Fourier Analysis Section 11, The Discrete Fourier Transform

arxiv: v1 [math.pr] 5 Dec 2011

H/wk 13, Solutions to selected problems

This chapter is all about cardinality of sets. At first this looks like a

6.852: Distributed Algorithms Fall, Class 2

Simple Graphs Degrees, Isomorphism, Paths

A simple algorithm with no simple verication

The Mean Value Theorem

Normal distribution. ) 2 /2σ. 2π σ

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

No: Bilkent University. Monotonic Extension. Farhad Husseinov. Discussion Papers. Department of Economics

Vocabulary. Term Page Definition Clarifying Example. biconditional statement. conclusion. conditional statement. conjecture.

Putnam Notes Polynomials and palindromes

SHARP BOUNDS FOR THE SUM OF THE SQUARES OF THE DEGREES OF A GRAPH

POLYNOMIAL RINGS AND UNIQUE FACTORIZATION DOMAINS

Chapter 7: Products and quotients

Degrees of Truth: the formal logic of classical and quantum probabilities as well as fuzzy sets.

Introduction. Appendix D Mathematical Induction D1

Transcription:

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 to In-Class Problems Week 4, Mon. Problem 1. In each case, say whether or not R is a equivalence relation on A. If it is an equivalence relation, what are the equivalence classes and how many equivalence classes are there? (a) R ::= {(x, y) W W the words x and y start with the same letter} where W is the set of all words in the 2001 edition of the Oxford English dictionary. Solution. R is an equivalence relation since it is reflexive, symmetric, and transitive. The equivalence class of x with respect to R is the set [x] R = the set of words y, such that y has the same first letter as x. There are 26 equivalence classes, one for each letter of the English alphabet. (b) R ::= {(x, y) W W the words x and y have at least one letter in common}. Solution. S is reflexive and symmetric, but it is not transitive. Therefore, S is not an equivalence relation. For example, let w 1 be the word scream, let w 2 be the word and, and let w 3 be the word shout. Then w 3 Sw 1, and w 1 Sw 2, but it is not the case that w 3 Sw 2. (c) R = {(x, y) W W and the word x comes before the word y alphabetically}. Solution. R is not reflexive but it is transitive and antisymmetric. It is not an equivalence relation, but it is a partial order. (d) R = {(x, y) R R and x y }. Solution. R is reflexive and transitive. It is not symmetric. It is not antisymmetric either. As a counterexample, 3 3, 3 3, but 3 = 3. (e) R = {(x, y) B B, where B is the set of all bit strings and x and y have the same number of 1s.} Copyright 2005, Prof. Albert R. Meyer and Prof. Ronitt Rubinfeld.

2 Solutions to In-Class Problems Week 4, Mon. Solution. R is reflexive, symmetric and transitive, and therefore an equivalence relation. There is an equivalence class for each natural number corresponding to bit strings with that number of 1s. Problem 2. False Claim. Suppose R is a relation on A. If R is symmetric and transitive, then R is reflexive. (a) Give a counter-example to the claim. Solution. The simplest counterexample is to let R be the empty relation on some nonempty set A. This R is vacuously symmetric and transitive, but obviously not reflexive. A slightly less trivial example is R ::= {(a, a), (a, b), (b, a), (b, b)} on the set A ::= {a, b, c}. It is not reflexive because (c, c) is not in R. (b) Find the flaw in the following proof of the claim: False proof. Let x be an arbitrary element of A. Let y be any element of A such that xry. Since R is symmetric, it follows that yrx. Then since xry and yrx, we conclude by transitivity that xrx. Since x was arbitrary, we have shown that x A (xrx), so R is reflexive. Solution. The flaw is assuming that y exists. It is possible that there is an x A that is not related by R to anything. No such R will be reflexive. Note that the theorem can be fixed: R restricted to its domain of definition is reflexive, and hence an equivalence relation. Problem 3. Verify that each of the following relations is a partial order by describing a function, g, such that the relation is defined by g according to the Definition 4.2 in the Appendix. For each, is it a total order? (a) The relation, <, on R.

Solutions to In-Class Problems Week 4, Mon. 3 Solution. Define g(r) ::= {t R t < r}. It follows that r 1 < r 2 iff g(r 1 ) g(r 2 ) so < satisfies the condition (3) on R that defines partial orders. Likewise, the relation,, is a partial order because r 1 r 2 iff r 1 < r 2, for all reals r 1 = r 2. (b) The superset relation,, on P(B) for a set, B. Solution. Define g(a) ::= a ::= B {a}, and note that for a 1 = a 2 P(B), a 1 a 2 iff a 1 a 2 (since a 1 a 2 ) iff a 1 a 2 iff g(a 1 ) g(a 2 ) (basic set theory) (def of g). (c) The divides relation on natural numbers. Solution. Let g(a) ::= the set of natural number that divide a. Problem 4. Suppose you are given the description of an equivalence relation and want to cut down on the number of pairs that are stored without losing any information. For example, here are the pairs of an equivalence relation on a set of integers: G ::= {11, 33, 44, 55, 66, 77, 13, 31, 45, 54, 47, 74, 57, 75}. where for readability, we ve written mk to designate the pair (m, k). To start, we know that if we have mk, then we necessarily also have km, so there s no need to keep both. This lets us cut down to: {11, 33, 44, 55, 66, 77, 13, 45, 47, 57}. Also, if we have 45 and 57, we don t need 47, since that will necessarily be there (by transitivity), so we can further cut down to {11, 33, 44, 55, 66, 77, 13, 45, 57}

4 Solutions to In-Class Problems Week 4, Mon. In addition, as long as we keep some pair in which k appears, we don t need the pair kk. This lets us cut down to the pairs {66, 13, 45, 57}. (1) These pairs are all that are needed to determine the entire original equivalence relation, G. Moreover, the set (1) of these pairs is minimal with this property; this means that if any pair was removed from the set, it wouldn t determine the relation any more. (a) Describe another couple of minimal sets of pairs that determine the relation. Solution. {66, 31, 45, 57}, {66, 13, 47, 57}, and lots more.... (b) Here are the pairs that are left after some unnecessary pairs have been removed from the description of an equivalence relation, E. What is the domain of E? What are the equivalence classes of E? 15, 20, 40, 57, 68, 79, 9a, bb, c3 Solution. domain of E = {0123456789abc} equivalence classes of E = {024} {1579a} {3c} {68} {b}. (c) On a domain of n elements, what is the smallest number of pairs that could determine an equivalence relation? Solution. n/2 by having all blocks of size 2, except for one block of size 1 if n is odd. (d) Suppose you have an equivalence relation on a domain of size n with k equivalence classes, with no classes of just one element. Then every minimal set of pairs has the same size. What is that size? Explain. Solution. It takes n k pairs. We ll let you convince yourself that c 1 is the minimum number of pairs to connect up all the elements and thereby determine an equivalence class of size c > 1. (We ll prove this carefully in couple of weeks when we study tree structures.) So if there are k classes of sizes c 1,..., c k, you need (c 1 1) + (c 2 1) + + (c k 1) = (c 1 + c 2 + + c k ) k = n k pairs.

Solutions to In-Class Problems Week 4, Mon. Appendix 5 Equivalence Definition 4.1. A binary relation, R, on a set, A, is an equivalence relation iff there is a function, f, with domain A, such that a 1 R a 2 iff f(a 1 ) = f(a 2 ) (2) for all a 1, a 2 A. Theorem. A relation is an equivalence iff it is reflexive, symmetric and transitive. Partial Order Definition 4.2. A relation, R, on a set, A, is a partial order providing there is a function, g, from A to some collection of sets such that for all a 1 = a 2 A. a 1 R a 2 iff g(a 1 ) g(a 2 ), (3) Theorem. A relation is a partial order iff it is transitive and antisymmetric. Relational Properties A binary relation, R, on a set, A, is reflexive if ara for every a A, irreflexive if ara holds for no a A, symmetric if for every a, b A, arb implies bra, antisymmetric if for every a = b A, arb implies (bra), asymmetric if for every a, b A, arb implies (bra), transitive if for every a, b, c A, arb and brc implies arc.