Assignment 3 with Solutions

Similar documents
MATH FINAL EXAM REVIEW HINTS

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination I (Spring 2008)

MATH 3300 Test 1. Name: Student Id:

Functions and cardinality (solutions) sections A and F TA: Clive Newstead 6 th May 2014

Name (please print) Mathematics Final Examination December 14, 2005 I. (4)

CHAPTER 3 REVIEW QUESTIONS MATH 3034 Spring a 1 b 1

A n = A N = [ N, N] A n = A 1 = [ 1, 1]. n=1

Try the assignment f(1) = 2; f(2) = 1; f(3) = 4; f(4) = 3;.

1 Basic Combinatorics

A Short Review of Cardinality

Review Problems for Midterm Exam II MTH 299 Spring n(n + 1) 2. = 1. So assume there is some k 1 for which

Math 127 Homework. Mary Radcliffe. Due 29 March Complete the following problems. Fully justify each response.

Chapter Five Notes N P U2C5

REVIEW FOR THIRD 3200 MIDTERM

MATH 115, SUMMER 2012 LECTURE 12

Differentiation. Table of contents Definition Arithmetics Composite and inverse functions... 5

Immerse Metric Space Homework

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

1 + lim. n n+1. f(x) = x + 1, x 1. and we check that f is increasing, instead. Using the quotient rule, we easily find that. 1 (x + 1) 1 x (x + 1) 2 =

The integers. Chapter 3

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

SETS AND FUNCTIONS JOSHUA BALLEW

CH 61 USING THE GCF IN EQUATIONS AND FORMULAS

LIMITS AND DERIVATIVES

Math 231E, Lecture 25. Integral Test and Estimating Sums

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

D-MATH Algebra I HS18 Prof. Rahul Pandharipande. Solution 1. Arithmetic, Zorn s Lemma.

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.

Integer-Valued Polynomials

S15 MA 274: Exam 3 Study Questions

Homework for MATH 4603 (Advanced Calculus I) Fall Homework 13: Due on Tuesday 15 December. Homework 12: Due on Tuesday 8 December

PRACTICE PROBLEMS: SET 1

Math 0230 Calculus 2 Lectures

Discussion Summary 10/16/2018

(1) Which of the following are propositions? If it is a proposition, determine its truth value: A propositional function, but not a proposition.

ADVANCED CALCULUS - MTH433 LECTURE 4 - FINITE AND INFINITE SETS

0 Sets and Induction. Sets

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

DIRECTED STUDIES IN MATHEMATICS - FINAL REPORT. 1. Introduction

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 27

1 Overview and revision

Cartesian Products and Relations

Postulate 2 [Order Axioms] in WRW the usual rules for inequalities

CDM Combinatorial Principles

Week Some Warm-up Questions

INFINITE SEQUENCES AND SERIES

Solutions to Tutorial for Week 4

Section 20: Arrow Diagrams on the Integers

8.7 Taylor s Inequality Math 2300 Section 005 Calculus II. f(x) = ln(1 + x) f(0) = 0

STEP Support Programme. Pure STEP 1 Questions

Mathematics 220 Workshop Cardinality. Some harder problems on cardinality.

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

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Supremum and Infimum

MATH 403 MIDTERM ANSWERS WINTER 2007

AMB111F Notes 1: Sets and Real Numbers

Fall 2015 Lecture 14: Modular congruences. cse 311: foundations of computing

MAT115A-21 COMPLETE LECTURE NOTES

Let us first solve the midterm problem 4 before we bring up the related issues.

1/12/05: sec 3.1 and my article: How good is the Lebesgue measure?, Math. Intelligencer 11(2) (1989),

We are going to discuss what it means for a sequence to converge in three stages: First, we define what it means for a sequence to converge to zero

Math 110 Test # 1. The set of real numbers in both of the intervals [0, 2) and ( 1, 0] is equal to. Question 1. (F) [ 1, 2) (G) (2, ) (H) [ 1, 2]

CHAPTER 1. Review of Algebra

e x = 1 + x + x2 2! + x3 If the function f(x) can be written as a power series on an interval I, then the power series is of the form

MATH 22 FUNCTIONS: COMPOSITION & INVERSES. Lecture N: 10/16/2003. Mad world! mad kings! mad composition! Shakespeare, King John, II:1

Metric Space Topology (Spring 2016) Selected Homework Solutions. HW1 Q1.2. Suppose that d is a metric on a set X. Prove that the inequality d(x, y)

Meta-logic derivation rules

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

NOTE: You have 2 hours, please plan your time. Problems are not ordered by difficulty.

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

SOLUTIONS FOR PROBLEMS 1-30

The fundamental theorem of linear programming

Questionnaire for CSET Mathematics subset 1

Functions as Relations

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

1 The distributive law

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

A function is a special kind of relation. More precisely... A function f from A to B is a relation on A B such that. f (x) = y

Math 1b Sequences and series summary

Integration of Rational Functions by Partial Fractions

1.5 Inverse Trigonometric Functions

Solutions Final Exam May. 14, 2014

One-to-one functions and onto functions

Divisibility. Chapter Divisors and Residues

TAYLOR AND MACLAURIN SERIES

Section 7.2: One-to-One, Onto and Inverse Functions

Chapter-2 Relations and Functions. Miscellaneous

The 70th William Lowell Putnam Mathematical Competition Saturday, December 5, 2009

Math 2534 Solution to Test 3A Spring 2010

Math /Foundations of Algebra/Fall 2017 Numbers at the Foundations: Real Numbers In calculus, the derivative of a function f(x) is defined

4.1 Real-valued functions of a real variable

Introductory Analysis 2 Spring 2010 Exam 1 February 11, 2015

Assignment #2 COMP 3200 Spring 2012 Prof. Stucki

1 Take-home exam and final exam study guide

Notes on ordinals and cardinals

Mathematics for Graphics and Vision

Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS.

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

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 20. To Infinity And Beyond: Countability and Computability

Midterm Review Math 311, Spring 2016

Transcription:

Discrete Mathematics (Math 27), Spring 2004 Assignment 3 with Solutions. Recall the definition of functions, one-to-one functions, and onto functions. (a) Consider the function f : R R with f(x) x x. i. Is f one-to-one? ii. Is f onto? Explain your answers. Recall that for all x R we have x < x x (). i. Claim: f is not one-to-one. Proof. For any x R we have x x (x + m) x + m (this follows from the identity x + m x + m, which is proved analogous to 3.(a).) For instance, 2 2 2 and ( + ) ( ) 2 + 2 + 2 2. Therefore, f is not one-to-one. ii. Claim: f is not onto. Proof. For any x R we have 0 x x < by (). Therefore, f is not onto. (b) Let A and B be non-empty finite sets with A B (e.g. A B {, 2, 3, 4}). Prove or disprove: For any function f : A B, f is one-to-one if and only if f is onto. Claim: Let A, B, and f be as above. Then f is one-to-one if and only if f is onto. Proof. This follows from the pigeon-hole principle: Let f be one-to-one, then for all a, a 2 A we have f(a ) f(a 2 ) a a 2, so each b B that has a preimage a A has exactly one unique such preimage. Since A and B are finite sets with A B and since f is a function, it follows that each b B must have a preimage a A under f. So f is onto. Conversely, let f be onto. So every b B has a preimage a A. Again, since A and B are finite sets with A B and since f is a function, it follows that each a A must have exactly one unique image b B under f. So f in one-to-one. Since f is onto if f is one-to-one and vice versa, this proves the claim. (c) Let A and B be infinite sets with A B (e.g. A B Z). Prove or disprove: For any function f : A B, f is one-to-one if and only if f is onto. Claim: Let A, B, and f be as above. Then there exist functions f such that f is one-to-one but not onto, and there exist functions f such that f is not one-to-one but onto. Proof. Let A B R. The function f(x) 2 x is one-to-one but not onto (2 x > 0 for all x R), and the function f(x) tan(x) is not one-to-one (tan is a periodic function, i.e. tan(x) tan(x + kπ) for any k Z) but onto. (d) Recall how to prove that two functions are identical. For any real number x let f(x) x x 2, x 2 and g(x) x, x. State the ranges of f and g, state (f g)(x), and prove or disprove: f is the inverse of g. Let y x/(x 2), then yx 2y x and 2y/(y ) x. Since x is not defined for y but for any other y R, it follows that im f R {}. Likewise, let y /(x ), then yx y and y/(y 2) x. Since x is not defined for y but for any other y R, it follows that im f R {2}.

Discrete Mathematics (Math 27), Spring 2004 2 For (f g) we have f g)(x) f(g(x)) x x 2 2 2 x. f is indeed the inverse of g as f (x) g(x) and dom f im f dom g. (e) State the range of the following functions on R and state the inverse or explain, why an inverse doesn t exist: i. f(x) x 2 + ii. f(x) x 5 + iii. f(x) 3 x iv. f(x) 3 x 2 v. f(x) x vi. f(x) x x vii. f(x) e x viii. f(x) e x i. f(x) x 2 + : im f {y R : x }. Since f(x) f( x) for all real x, f is not one-to-one and thus has no inverse function. ii. F(x) x 5 + : im f R. f is one-to-one as x 5 + x5 2 + is equivalent to x5 x5 2, i.e. x x x x x x 2 x 2 x 2 x 2 x 2 or x x x ( x ) ( x ) x 2 x 2 x 2 ( x 2 ) ( x 2 ) or x ( x ) ( x ) ( x ) ( x ) x 2 ( x 2 ) ( x 2 ) ( x 2 ) ( x 2 ); all of these cases imply x x 2 (x x 2 and x x 2 is only satisfied for x x 2 0). The inverse of f is f (x) 5 x. iii. f(x) 3 x : im f R. f(x) is one-to-one as 3 x 3 x 2 is equivalent to x x 2 and thus x x 2. The inverse of f(x) is f (x) x 3 +. iv. f(x) 3 x 2 : im f {y R : x }. Since f(x) f( x) for all x R, f is not one-to-one and thus has no inverse function. v. f(x) x : im f {y R : x 0}. Since f(x) f( x) for all x R, f is not one-to-one and thus has no inverse function. vi. f(x) x x : im f R. f is one-to-one as f(x) x 2 for x 0 and f(x) x 2 for x < 0, and x 2 ( x) 2, but f(x) f( x) for all x R. The inverse of f is f (x) x if x 0 and f (x) x for x < 0. vii. f(x) e x : im f {y R : y > 0}. f is one-to-one since f is strictly monotonic, i.e. for all x, x 2 R we have x < x 2 f(x ) < f(x 2 ); this can be seen as follows: for any real t > 0 we have x + t > x and e t >, thus e x+t e x e t > e x. The inverse of f is f (x) ln x. viii. f(x) e x : im f {y R : y < }. f is one-to-one since f is strictly monotonic, i.e. for all x, x 2 R we have x < x 2 f(x ) < f(x 2 ); this can be seen as follows: for any real t > 0 we have x + t > x and e t /e t <, thus e (x+t) e x e t < e x, and therefore e (x+t) > e x. The inverse of f is f (x) ln( x). (f) Recall the pigeon-hole principle. A bitstring of length l is technically a list of length l with entries from {0, }, e.g. the bitstring 00 corresponds to the list (, 0, 0,, ). If l is fixed, then bitstrings shorter than l are padded with leading zeros, so for l 5 we write 0 as 000. (The length of 000 is still 3, not 5.) A compression algorithm is supposed to map bitstrings of a certain length to shorter bitstrings. The compression is loss-free if and only if the map is bijective (i.e. one-to-one

Discrete Mathematics (Math 27), Spring 2004 3 and onto). Fix l, and let f l : {0, } l {0, } l, and for any bitstring x let length(x) denote the length of x without leading zeros. Prove or disprove: There exists a loss-free compression map f l such that x {0, } l : length ( f l (x) ) < length(x). That says (make sure you understand this): There is a loss-free compression map such that every bitstring of length l can be bijectively mapped (i.e. compressed) to a shorter bitstring. Claim: There exists no such loss-free compression map f l with the asserted property. Proof. We use a simple counting argument and exploit the pigeon-hole principle. Consider bitstrings of length l. There are 2 l bitstrings of length l with leading (the leftmost bit is fixed to, all other bits can be chosen freely and independently, so the multiplication principle can be invoked). Likewise for any other length k < l there are 2 k bitstrings of length k with leading. So there are l k 2k bitstrings strictly shorter than l with a leading. As seen in the lecture l k 2k l k0 2k 2 l. So the set of bitstrings of exactly length l is larger than the set of bitstrings strictly shorter than l. By the pigeon-hole principle there cannot exist a bijective map between (finite) sets of different cardinality. Therefore, at least one bitstring cannot be compressed. This says that no matter what compression algorithm you use (zip, gzip, etc.), it will not work on every input (e.g. note that compressed files in general cannot be further compressed). 2. Prove the following statements by mathematical induction or the well ordering principle. Recall how to write a clean proof. The proofs for the statements below can be written in a quite short way, so try to avoid needless clutter. And remember: Don t use the statement that what you want to prove in the proof. (a) Let A(n) : n k0 a k an+ a Prove A(n) for all natural numbers n 0. for any real a. Proof. Base case: For n 0 we have a 0 and a, so A(n) is true for n 0. a I.H.: Let A(m) be true for some m 0. We derive A(m + ) from A(m). We have [ m+ m ] a k a k + a m+ k0 k0 [ a m+ ] + a m+ by I.H. a am+ + (a )a m+ a am+ + a m+2 a m+ a am+2 a Thus, m+ k0 ak a(m+)+ a, which is A(m + ). Since A(0) is true and A(m) A(m + ), A(n) is true for all n 0..

Discrete Mathematics (Math 27), Spring 2004 4 (b) Let B(n) : n k0 ( 2k + Prove B(n) for all natural numbers n 0. ) 2k + 2 Proof. Base case: For n 0 we have a 0 and (2n + 2)!. 2 0 + 2 0 + 2 2, so B(n) is true for n 0. (2 0 + 2)! I.H.: Let B(m) be true for some m 0. We derive B(m + ) from B(m). We have m+ k0 ( 2k + ) 2k + 2 [ m k0 ( 2k + ) ] 2k + 2 [ ] (2m + 2)! 2m + 3 (2m + 4)! (2(m + ) + 2)! 2(m + ) + 2m + 4. 2(m + ) + 2 by I.H. Thus, m+ ( k0 2k+ ) 2k+2 (2(m+)+2)!, which is B(m + ). Since B(0) is true and B(m) B(m + ), B(n) is true for all n 0. (c) Let n+ C(n) : k 2 k n 2 n+2 + 2. k Prove C(n) for all natural numbers n. Proof. Base case: For n we have 2 k k 2k 2 + 2 2 2 0 and 2 3 + 2 0, so C(n) is true for n. I.H.: Let C(m) be true for some m. We derive C(m + ) from C(m). We have m+2 k k 2 k [ m+ k k 2 k ] [ ] m 2 m+2 + 2 + (m + 2) 2 m+2 + (m + 2) 2 m+2 by I.H. (2m + 2) 2 m+2 + 2 2(m + ) 2 m+2 + 2 (m + ) 2 m+3 + 2. Thus, m+2 k k 2k (m + ) 2 (m+)+2, which is C(m + ). Since C() is true and C(m) C(m + ), C(n) is true for all n. (d) Let D(n) : + nx ( + x) n for any real number x >. Prove D(n) for all natural numbers n 2. Proof. Base case: For n 2 we have + + + x 2 ( + x) 2 since x 2 0, so D(n) is true for n 2. I.H.: Let D(m) be true for some m 2. We derive D(m + ) from D(m). First note the following: If x 0, then +x and thus (+x) m ; and if < x < 0, then 0 < + x < and thus 0 < ( + x) m <. In both cases we have x x( + x) m ().

Discrete Mathematics (Math 27), Spring 2004 5 We have ( ) [ ] + (m + )x ( + mx) + x [( + x) m ] + x by I.H. ( + x) m + x( + x) m by () ( + x) m ( + x) ( + x) m+. Thus, ( + (m + )x) ( + x) m+, which is D(m + ). Since D() is true and D(m) D(m + ), D(n) is true for all n 2. (e) Let E(n) : 7 2 3n. Prove E(n) for all natural numbers n. This is a bit different from the previous problems: Proof. Base case: For n we have 2 3 8 7, so E(n) is true for n. I.H.: Let E(m) be true for some m. In particular, since 7 2 3m, there exists an integer s such that 2 3m 7s. We derive E(m + ) from E(m). We have 2 3(m+) 2 3 2 3m 2 3 2 3m + 2 3m 2 3m [ ] 2 3 2 3m 2 3m + 2 3m (2 3 ) 2 3m + [ 7s ] by I.H. 7 2 3m + 7s 7(2 3m + s). Thus, 7 2 3(m+), which is E(m + ). Since E() is true and E(m) E(m + ), E(n) is true for all n. (f) Let the sequence g 0, g, g 2,... be defined by g 0 2, g 29, and g k 5g k 6g k 2 for all natural number k 2, and let F(n) : g n 5 3 n + 7 2 n. Prove F(n) for all natural numbers n 0. This is a bit different from the previous problems: Proof. Base case: For n 0 we have 5 3 0 + 7 2 0 2 g 0, and for n we have 5 3 + 7 2 29 g, so F(n) is true for n 0 and n. Note: It is important to check for F(0) and F(), just F(0) or F() is not sufficient. I.H.: Let F(m) and F(m + ) be true for some m 0. We derive F(m + 2) from F(m) and F(m + ). We have g m+2 5 [g ] [ ] m+ 6 gm [ 5 5 3 m+ + 7 2 m+] [ 6 5 3 m + 7 2 m] by I.H. (5 5 3 6 5) 3 m + (5 7 2 6 7) 2 m 45 3 m + 28 2 m ( 5 3 2) 3 m + ( 7 2 2) 2 m 5 3 m+2 + 7 2 m+2. Thus, g m+2 5 3 m+2 + 7 2 m+2, which is F(m + 2). Since F(0) and F() are true and F(m) F(m + ) F(m + 2), F(n) is true for all n 0.

Discrete Mathematics (Math 27), Spring 2004 6 3. Recall the definition of and and the fundamental inequalities involved. Also recall how to compute the gcd of two integers. (a) Prove that for any real x and any integer m we have x + m x + m. Proof. Recall that for all x R, we have x x < x +, () where x x if and only if x Z. Also observe the following simple fact: n, m Z : n < m n m n + m, (2) which follows from the basic properties of the integers and the relations < and. Finally, we make the following claim: x R : s, t Z : x s < x + x t < x + s t. (3) This says that there is exactly one integer in the set {y R : x y < x + }. This can be proved in two (albeit similar) ways: Observe that x s < x + (4) and x t < x + (5) imply two things: First, x s < x + t +, which implies x s t by (2), and second, x t < x + s +, which implies x t s by (2). This finally implies s t. Alternative proof: Observe that (5) is equivalent to x < t x (6). If we add (4) and (6), then we arrive at < s t <. Invoking (2) again implies that 0 s t 0, i.e. s t. Now back to the initial question. Since () implies x + m x + m < x + m + as well as x + m x + m < x + m +, the claim with s x + m and t x + m implies x + m x + m. (b) Prove that if x R Z, then x x. Proof. Since x is not an integer, we have x < x < x + () and x < x < x (2). Note that (2) is equivalent to x < x < x (3). We add () and (3) to obtain 0 < x x < 2. Invoking (2) of 3.(a) yields x x, which implies x x. Note: Since x / Z, we have x < x < x and x < x < x +, it might be tempting to invoke (2) of 3.(a) on x < x < x < x +, which looks contradictory. However, (2) of 3.(a) is only valid for integers. (c) Prove for all a, b Z with a, b > 0 that a b a b +. Proof. First observe that (a )/b < (a )/b + (a )/b + is equivalent to a < b (a )/b + b a + b (), because b >. Using (2) of 3.(a) on both inequalities of () yields a b (a )/b + b < a + b, which is equivalent to a/b (a )/b + < a/b +. Since we also have a/b a/b < a/b +, it follows from (3) of 3.(a) that a/b (a )/b +. Note that showing a/b (a )/b + is equivalent to showing that a/b (a )/b + 0; subtracting the according systems of inequalities yields that 0 a/b (a )/b + 0. (However, it is crucial to transform the inequalities for (a )/b such that a is replaced by a, otherwise this does not work.)

Discrete Mathematics (Math 27), Spring 2004 7 (d) Compute d gcd(7369, 5472) and compute the integers x and y such that 7369x + 5472y d. We use the scheme presented in the lecture to compute gcd(7369, 5472) and the representation thereof: k a k q k x k y k 0 7369 0 5472 3 0 2 953 5 3 3 707 5 6 4 246 2 6 9 5 25 7 54 6 3 6 23 73 7 29 55 492 8 2 4 78 565 9 2 2647 8402 So we have gcd(7369, 5472), where x 2647 and 8402, and it is easy to check that indeed 7369 ( 2647) + 5472 8402. (e) Prove that no pair of integers x, y satisfy 54x + 260y 3. Proof. It can easily be checked that gcd(54, 260) 2. Clearly, if d a and d b then d ax + by for any integers x and y. However, 2 3, so x and y can t be integers. (f) Prove that for every even integer n we have gcd(n, n + 2) 2 and find integers x and y such that nx + (n + 2)y 2. Proof. We use again the standard scheme to compute a gcd with representation. Since n is even, let n 2m. k a k q k x k y k 0 2m + 2 0 2m 0 2 2 m 3 0 So we have gcd(n+2, n) 2, where x and y, and clearly 2 (n+2)+( ) n. (g) Prove that for every integer n we have gcd(0n + 7, 7n + 5) and find integers x and y such that (0n + 7)x + (7n + 5)y. Proof. We resort again to the scheme for gcd computation with representation: k a k q k x k y k 0 0n + 7 0 7n + 5 0 2 3n + 2 2 3 n + 2 2 3 4 n 5 7 5 n 7 0 So we have gcd(0n + 7, 7n + 5), where x 7 and y 0, and it is easy to check that indeed 7 (0n + 7) + 0(7n + 5).