Math 2602 Finite and Linear Math Fall 14. Homework 9: Core solutions

Similar documents
HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)!

Practice with Proofs

Section IV.1: Recursive Algorithms and Recursion Trees

MATH 425, PRACTICE FINAL EXAM SOLUTIONS.

3. INNER PRODUCT SPACES

1 if 1 x 0 1 if 0 x 1

Solutions to Homework 6 Mathematics 503 Foundations of Mathematics Spring 2014

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

10.2 Series and Convergence

A power series about x = a is the series of the form

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

4/1/2017. PS. Sequences and Series FROM 9.2 AND 9.3 IN THE BOOK AS WELL AS FROM OTHER SOURCES. TODAY IS NATIONAL MANATEE APPRECIATION DAY

Math 115 Spring 2011 Written Homework 5 Solutions

E3: PROBABILITY AND STATISTICS lecture notes

Sample Induction Proofs

Continued Fractions and the Euclidean Algorithm

Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm

MATH 22. THE FUNDAMENTAL THEOREM of ARITHMETIC. Lecture R: 10/30/2003

Introduction. Appendix D Mathematical Induction D1

Math 55: Discrete Mathematics

APP INVENTOR. Test Review

10.2 ITERATIVE METHODS FOR SOLVING LINEAR SYSTEMS. The Jacobi Method

1 Calculus of Several Variables

1 Norms and Vector Spaces

To discuss this topic fully, let us define some terms used in this and the following sets of supplemental notes.

Full and Complete Binary Trees

Real Roots of Univariate Polynomials with Real Coefficients

Solutions of Equations in One Variable. Fixed-Point Iteration II

n k=1 k=0 1/k! = e. Example 6.4. The series 1/k 2 converges in R. Indeed, if s n = n then k=1 1/k, then s 2n s n = 1 n

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

CONTINUED FRACTIONS AND PELL S EQUATION. Contents 1. Continued Fractions 1 2. Solution to Pell s Equation 9 References 12

SOLUTIONS FOR PROBLEM SET 2

Math 55: Discrete Mathematics

Mathematical Methods of Engineering Analysis

Reading 13 : Finite State Automata and Regular Expressions

Functions: Piecewise, Even and Odd.

Lectures 5-6: Taylor Series

Cardinality. The set of all finite strings over the alphabet of lowercase letters is countable. The set of real numbers R is an uncountable set.

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

THE BANACH CONTRACTION PRINCIPLE. Contents

CS 103X: Discrete Structures Homework Assignment 3 Solutions

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

Class Meeting # 1: Introduction to PDEs

Limits and Continuity

Nonlinear Algebraic Equations. Lectures INF2320 p. 1/88

it is easy to see that α = a

Study Guide 2 Solutions MATH 111

Chapter 13: Basic ring theory

Negative Integer Exponents

Numerical methods for American options

L 2 : x = s + 1, y = s, z = 4s Suppose that C has coordinates (x, y, z). Then from the vector equality AC = BD, one has

Vector and Matrix Norms

Mathematics Georgia Performance Standards

Answer Key for California State Standards: Algebra I

Critical points of once continuously differentiable functions are important because they are the only points that can be local maxima or minima.

8 Divisibility and prime numbers

Homework until Test #2

36 CHAPTER 1. LIMITS AND CONTINUITY. Figure 1.17: At which points is f not continuous?

Math Review. for the Quantitative Reasoning Measure of the GRE revised General Test

The Pointless Machine and Escape of the Clones

Mathematics 31 Pre-calculus and Limits

Cartesian Products and Relations

Determine If An Equation Represents a Function

We can express this in decimal notation (in contrast to the underline notation we have been using) as follows: b + 90c = c + 10b

Notes on metric spaces

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

Math 4310 Handout - Quotient Vector Spaces

High School Algebra Reasoning with Equations and Inequalities Solve systems of equations.

K-Cover of Binary sequence

MATH ADVISEMENT GUIDE

Unit 7: Radical Functions & Rational Exponents

FINAL EXAM SECTIONS AND OBJECTIVES FOR COLLEGE ALGEBRA

Fundamentele Informatica II

MA651 Topology. Lecture 6. Separation Axioms.

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Regular Languages and Finite Automata

Lecture 3: Finding integer solutions to systems of linear equations

Collinear Points in Permutations

Chapter 6. Linear Transformation. 6.1 Intro. to Linear Transformation

Chapter 4. Polynomial and Rational Functions. 4.1 Polynomial Functions and Their Graphs

Chapter 7 - Roots, Radicals, and Complex Numbers

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

Probability Generating Functions

THE FUNDAMENTAL THEOREM OF ALGEBRA VIA PROPER MAPS

Metric Spaces. Chapter Metrics

Representation of functions as power series

3 1. Note that all cubes solve it; therefore, there are no more

Special Situations in the Simplex Algorithm

Math 241, Exam 1 Information.

Regular Languages and Finite State Machines

6.4 Logarithmic Equations and Inequalities

This is a square root. The number under the radical is 9. (An asterisk * means multiply.)

Deterministic Finite Automata

FACTORING POLYNOMIALS IN THE RING OF FORMAL POWER SERIES OVER Z

Notes on Factoring. MA 206 Kurt Bryan

Convex analysis and profit/cost/support functions

Mathematical Induction. Mary Barnes Sue Gordon

Chapter 8 - Power Density Spectrum

Geometric Transformations

Mathematical Induction

Transcription:

Math 2602 Finite and Linear Math Fall 14 Homework 9: Core solutions Section 8.2 on page 264 problems 13b, 27a-27b. Section 8.3 on page 275 problems 1b, 8, 10a-10b, 14. Section 8.4 on page 279 problems 2c, 7a. Chapter 8 review problems on page 280 problem 6. 13b. Show that b n n! for any b > 1 Solution: Let a n = bn n!. Then a n+1 a n = bn+1 /(n+1)! b n /n! = b n+1, which converges to zero as n tends to infinity. By the ratio test (from Calculus), the series n=1 a n converges absolutely. A necessary condition for the series to converge, however, is that the b terms a n must tend to zero. Hence, lim n n = 0. By Proposition 8.2.6 on page 256, we n! have b n n!. 27a. Establish the triangle inequality: a + b a + b. Solution: For any real number x and y we have x x x, and y y y. Adding the two inequalities together we have But ( x + y ) x + y x + y. (1) x + y = In either case, x + y x + y using Equation 1. { x + y if x + y 0 (x + y) if x + y < 0. Alternate proof: We first show that x + y 2 ( x + y ) 2. We have x + y 2 = (x + y)(x + y) = x 2 + 2xy + y 2 = x 2 + 2xy + y 2 x 2 + 2 x y + y 2 = ( x + y ) 2. Now, if a, b are any positive real numbers and a b, then a b. This is immediate since the function f(x) = x is strictly increasing on it s domain (recall, f (x) = 1 2 > 0 for x x > 0). This finishes the proof.

2 27b. Show that x 1 + +x n x 1 + + x n for any n 1 and real numbers x 1,..., x n. Solution: Proof by induction. When n = 1 we have x 1 x 1 (by the way, the n = 2 case is just what we did in the previous exercise). Now, suppose x 1 + + x k x 1 + + x k. We have, x 1 + + x k + x k+1 x 1 + + x k + x k+1 x 1 + + x k + x k+1, where the first inequality follows from the previous exercise and the second equality follows from the induction hypothesis. 1b. Show the sequence of steps in a binary search to find x = 7 in the list 1, 2, 3, 4, 5, 6, 7, 8, 9. How many times is x compared with an element in the list? How many times would it be compared if we used a linear search? Solution: Recall the binary search and linear search algorithms. Binary search algorithm: Input: a 1,..., a n, x with a 1 a 2 a n. step 1: Initialize S = 0. step 2: WHILE n > 0, IF n = 1 then IF x = a 1 set n = 0 and replace S with 1. ELSE set n = 0. ELSE set m = n 2 ; IF x a m replace the current list with a 1,..., a m and set n = m; ELSE replace the current list with a m+1,..., a n and replace n by n m. END WHILE Output: S. Linear search algorithm: Input: a 1,..., a n, x. step 1: Initialize S = 0. For i = 1..n,

3 IF x = a i, set i = 2n and replace S with 1. Output: S. The algorithms above each take a list and output 1 if x is an element of the list and output 0 otherwise. The steps in the binary search with the list 1, 2, 3, 4, 5, 6, 7, 8, 9 and x = 7 is as follows: Initialize S = 0. Since n 1 set m = 9 = 4. The number x = 7 does not satisfy x a 2 m since 7 a 4 = 4. So we replace the list by 5, 6, 7, 8, 9. Since n 1 set m = 5 = 2. The 2 number x = 7 does not satisfy x a m since a 2 = 6, so we replace the list by 7, 8, 9. Since n 1 set m = 3 = 1. The number x = 7 does satisfy x a 2 1 since a 1 = 7. Hence, we replace the list with the list 7. Now, n = 1 and x = a 1, so we replace S with 1. Finally, we output S = 1. There are a total of 4 comparisons using the binary search. If we were to do a linear search, there would be 7 comparisons (6 failed comparison and then a successful comparison). 8. Show the sequence of steps involved in merging the sorted lists 2, 4, 4, 6, 8 and 1, 5, 7, 9, 10. How many comparisons are required? Solution: Recall the merging algorithm. Merging algorithm: MERGE(L 1, L 2 ) Input: L 1 = (a 1,..., a s ) and L 2 = (b 1,..., b t ) with a 1 a 2 a s and b 1 b 2 b t. step 1: Initialize L 3 = (). step 2: IF L 1 is empty, set L 3 = L 2 and STOP. IF L 2 is empty, set L 3 = L 1 and STOP. step 3: IF a 1 b 1, remove a 1 from L 1 and append it to L 3 ; if this empties L 1 then append L 2 to L 3 and STOP. Relabel the elements in L 1 and repeat Step 3. ELSE a 1 > b 1, remove b 1 from L 2 and append it to L 3 ; if this empties L 2 then append L 1 to L 3 and STOP. Relabel the elements in L 2 and repeat Step 3. Output: L 3.

4 The sequence of steps is as follows: L 1 L 2 L 3 1 (2, 4, 4, 6, 8) (1, 5, 7, 9, 10) () 2 (2, 4, 4, 6, 8) (5, 7, 9, 10) (1) 3 (4, 4, 6, 8) (5, 7, 9, 10) (1, 2) 4 (4, 6, 8) (5, 7, 9, 10) (1, 2, 4) 5 (6, 8) (5, 7, 9, 10) (1, 2, 4, 4) 6 (6, 8) (7, 9, 10) (1, 2, 4, 4, 5) 7 (8) (7, 9, 10) (1, 2, 4, 4, 5, 6) 8 (8) (9, 10) (1, 2, 4, 4, 5, 6, 7) 9 () (9, 10) (1, 2, 4, 4, 5, 6, 7, 8) 10 () () (1, 2, 4, 4, 5, 6, 7, 8, 9, 10) There are 8 comparisons required (the 1rst and 10th step did not require a comparison). 10. Find an example of two ordered lists of lengths s and t 3 that can be merged with (a) one comparison. Solution: Set L 1 = (1) and L 2 = (2, 3, 4). (b) t comparisons. Solution: Set L = (t + 1) and L 2 = (1, 2, 3,..., t). 11. Sort the list 7, 2, 2, 5, 3, 5, 4 using bubble sort and merge sort. In each case, how many comparisons were needed? (for merge sort, you may ignore comparisons required to check the size and parity of n at each iteration of Step 3) Solution: The merge sort and bubble sort algorithms are stated below. Recall the Merging algorithm above whose input L 1, L 2 are two ordered lists and whose output MERGE(L 1, L 2 ) is the merged ordered list coming from L 1, L 2. Merge sort algorithm: Input: An unordered list L = (a 1,..., a n ). step 1: Initialize F = 0. step 2: For i = 1..n, define L i to be the list with single element a i. step 3: WHILE F = 0, IF n = 1, set F = 1. IF n = 2m is even,

5 For i = 1..m replace L i with MERGE(L 2i, L 2i 1 ). Set n := m. IF n = 2m + 1 is odd and n 1, For i = 1..m replace L i with MERGE(L 2i, L 2i 1 ). Set L m+1 := L n. Set n := m + 1. Output: L 1. Bubble sort algorithm: Input: An unordered list L = (a 1,..., a n ). step 1: For i = n 1 down to 1, For j = 1..i, IF a j > a j+1, set a j := a j+1 and a j+1 := a j. Output: L.