Tutorial 6 solution. For a 0 -> 1= 1+ 2 (1. For a 1 -> 0 = (2. After solving equation 1 and 2, 1 = 3 and 2=-2. a n = 3*2 n -2*3 n

Similar documents
Advanced Counting Techniques. Chapter 8

Advanced Counting Techniques

3. If 4x = 0, the roots of the equation are (1) 25 and 25 (2) 25, only (3) 5 and 5 (4) 5, only 3

Solutions to the Mathematics Masters Examination

Divide-and-Conquer Algorithms and Recurrence Relations. Niloufar Shafiei

Exam 2 Solutions. x 1 x. x 4 The generating function for the problem is the fourth power of this, (1 x). 4

( c ) E p s t e i n, C a r t e r a n d B o l l i n g e r C h a p t e r 1 7 : I n f o r m a t i o n S c i e n c e P a g e 1

PUTNAM PROBLEMS SEQUENCES, SERIES AND RECURRENCES. Notes

Section 5.2 Solving Recurrence Relations

Discrete Mathematics -- Chapter 10: Recurrence Relations

Spring 06/MAT 140/Worksheet 1 Name: Show all your work.

Lecture 1: Shannon s Theorem

2007 First-Class Mail Rates for Flats* Weight (oz) Rate (dollars) Weight (oz) Rate (dollars)

FIITJEE ALGEBRA-2 Pre RMO

Section 7.2 Solving Linear Recurrence Relations

CHAPTER 8 Advanced Counting Techniques

Section 1.5. Linear Equations, Functions, Zeros, and Applications

Unit 7 Inverse and Radical Functions

MATH 3012 N Solutions to Review for Midterm 2

0814AI Common Core State Standards

Topic 6 Part 1 [251 marks]

EE 229B ERROR CONTROL CODING Spring 2005

Test: Chapter 8 Number patterns and recursion

Ex. Here's another one. We want to prove that the sum of the cubes of the first n natural numbers is. n = n 2 (n+1) 2 /4.

1. Decide for each of the following expressions: Is it a function? If so, f is a function. (i) Domain: R. Codomain: R. Range: R. (iii) Yes surjective.

Finite and Infinite Sets


Lecture 2. Fundamentals of the Analysis of Algorithm Efficiency

AP Calculus (BC) Chapter 9 Test No Calculator Section Name: Date: Period:

1. Given the public RSA encryption key (e, n) = (5, 35), find the corresponding decryption key (d, n).

Sequences. 1. Number sequences. 2. Arithmetic sequences. Consider the illustrated pattern of circles:

Linear Recurrence Relations

Ph219/CS219 Problem Set 3

Power Series Solutions We use power series to solve second order differential equations

Correlation and Regression (Excel 2007)

Omega notation. Transitivity etc.

Solutions to Tutorial 4 (Week 5)

1 Recurrence relations, continued continued

Equations and Inequalities in One Variable

Benchmark Test Modules 1 7

Name Date Class California Standards Rev. of 7AF1.5. Graphing Relationships

BINARY CODES. Binary Codes. Computer Mathematics I. Jiraporn Pooksook Department of Electrical and Computer Engineering Naresuan University

Information redundancy

Basic Theory of Linear Differential Equations

17.1 Binary Codes Normal numbers we use are in base 10, which are called decimal numbers. Each digit can be 10 possible numbers: 0, 1, 2, 9.

INFINITE SEQUENCES AND SERIES

channel of communication noise Each codeword has length 2, and all digits are either 0 or 1. Such codes are called Binary Codes.

Discrete Mathematics. Kishore Kothapalli

Sloping Binary Numbers: A New Sequence Related to the Binary Numbers

Cyclic Redundancy Check Codes

CPS 616 DIVIDE-AND-CONQUER 6-1

Arithmetic and Geometric Sequences and their Summation

UNIT 2: REASONING WITH LINEAR EQUATIONS AND INEQUALITIES. Solving Equations and Inequalities in One Variable

Ma 530 Power Series II

Math Exam Jam Concise. Contents. 1 Algebra Review 2. 2 Functions and Graphs 2. 3 Exponents and Radicals 3. 4 Quadratic Functions and Equations 4

Multiplication by an Integer Constant: Lower Bounds on the Code Length

48th AHSME If a is 50% larger than c, and b is 25% larger than c, then a is what percent larger than b?

(vi) xry iff x y 2 (see the previous exercise); (iii) xry iff xy 0;

Intermediate Math Circles February 14, 2018 Contest Prep: Number Theory

8.1 Multiplication Properties of Exponents Objectives 1. Use properties of exponents to multiply exponential expressions.

Solve the following equations. Show all work to receive credit. No decimal answers. 8) 4x 2 = 100

8. Given a rational number r, prove that there exist coprime integers p and q, with q 0, so that r = p q. . For all n N, f n = an b n 2

Linear Algebra. F n = {all vectors of dimension n over field F} Linear algebra is about vectors. Concretely, vectors look like this:

Ternary Modified Collatz Sequences And Jacobsthal Numbers

MATH 215 DISCRETE MATHEMATICS INSTRUCTOR: P. WENG

Analysis of Algorithm Efficiency. Dr. Yingwu Zhu

Asymptotic Notation. such that t(n) cf(n) for all n n 0. for some positive real constant c and integer threshold n 0

2. (10 points) Consider the following algorithm performed on a sequence of numbers a 1, a 2,..., a n.

Study P.1 # 17, 19, 43 65, 95

XOR - XNOR Gates. The graphic symbol and truth table of XOR gate is shown in the figure.

Sequences & Functions

Math Lecture 23 Notes

Solving Recurrence Relations 1. Guess and Math Induction Example: Find the solution for a n = 2a n 1 + 1, a 0 = 0 We can try finding each a n : a 0 =

f (r) (a) r! (x a) r, r=0

Executive Assessment. Executive Assessment Math Review. Section 1.0, Arithmetic, includes the following topics:

Day 1~ 2-1 Relations & Functions

Section Summary. Sequences. Recurrence Relations. Summations. Examples: Geometric Progression, Arithmetic Progression. Example: Fibonacci Sequence

CSCI 2570 Introduction to Nanocomputing

Algorithms Test 1. Question 1. (10 points) for (i = 1; i <= n; i++) { j = 1; while (j < n) {

Divide and Conquer Algorithms. CSE 101: Design and Analysis of Algorithms Lecture 14

Ch 7 Summary - POLYNOMIAL FUNCTIONS

Algebra I EOC Review (Part 3)

CS361 Homework #3 Solutions

Chapter 2 Solution of Homogeneous and Inhomogeneous Linear Equations

0615AI Common Core State Standards

Lab 6A: Application of Coulomb s Law, With Vernier Video Simulation

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. B) 6x + 4

New algebraic decoding method for the (41, 21,9) quadratic residue code

1.2. Indices. Introduction. Prerequisites. Learning Outcomes

10.1 Sequences. Example: A sequence is a function f(n) whose domain is a subset of the integers. Notation: *Note: n = 0 vs. n = 1.

MADHAVA MATHEMATICS COMPETITION, December 2015 Solutions and Scheme of Marking

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

Algorithm Design CS 515 Fall 2015 Sample Final Exam Solutions

Solutions to Practice Final

Elementary Differential Equations, Section 2 Prof. Loftin: Practice Test Problems for Test Find the radius of convergence of the power series

Questions # 1-53 Provide review for the Mid-Term Questions # Provide review for the Final

SHORT ANSWER. Write the word or phrase that best completes each statement or answers the question.

CHAPTER 1 REAL NUMBERS KEY POINTS

7.5 CRC. 12 March r0 SAS-2 CRC fixes

Review 1. 1 Relations and Functions. Review Problems

Transcription:

Tutorial 6 solution 1. I. a n = 5a n-1-6 a n-2 for n>=2, a 0 =1, a 1 =0 -> x 2-5x+6 =0 is the characteristic equation of the above equation. Root of the equations are 2 and 3. So a n = 1 2 n + 23 n For a 0 -> 1 = 1 + 2 (1 For a 1 -> 0 = 2 1 +3 2 (2 After solving equation 1 and 2, 1 = 3 and 2=-2 a n = 3*2 n -2*3 n II. a n = -4a n-1 4a n-2 for n>=2, a 0 =0, a 1= 4 -> x 2 +4x+4 =0 is the characteristic equation of the above equation. Root of the equations are -2 only. So a n = 1 (-2) n + 2n(-2) n For a 0 -> 0 = 1 (1 For a 1 -> 4 = -2 1 +- 2 (2 After solving equation 1 and 2, 1 = 0 and 2=-4 a n = -4*n*(-2) n 2. How many different messages can be transmitted in n microseconds using three different signal if one signal requires 1 microsecond for transmittal, the other two signals require 2 microseconds each for transmittal, and a signal in message is followed immediately by the next signal? Recurrence of the above problem is following a n = 1a n-1 +2 a n-2 x 2 x-2 =0 is the characteristic equation of the above equation. Root of the equations are 2 and -1. So a n = 1 (2) n + 2(-1) n Initial conditions are a 0=1, a 1 =1 For a 0 -> 1= 1+ 2 (1 For a 1 -> 1 = 2 1-2 (2 After solving equation (1 and (2, 1 = 2/3 and 2=1/3 a n = 2/3*2 n +1/3*(-1) n 3. A new employee at an exciting new software company starts with a salary of $50,000 and is promised that at the end of each year her salary will be double her salary of the previous year, with an extra increment of $10,000 for each year she has been with the company. a) Construct a recurrence relation for her salary for her nth year of employment. b) Solve this recurrence relation to find her salary for her nth year of employment.

a) Recurrence of above problem is following a n = 2a n-1 +10000 Initial condition is, a 1 = 50000 b) a n = 2 1 a n-1 +10000 -> 2 1 (2a n-2 +10000) +10000->2 2 (2a n-3 +10000) +(1+2)10000->2 3 (2a n-2 +10000) +(1+2+4)10000-> ->2 n-2 (2a 1 +10000)+(1+2+4+.+2 n-3 )10000 a n = 2 n-2 (2*50000 +10000)+(1+2+4+.+2 n-3 )10000 = 2 n-1 *50000+(1+2+4+.+2 n-3 +2 n-2 )10000 = 2 n-1 *50000+ (2 n-1-1)10000 a n = 2 n-1 60000-10000 4. Let a n be the sum of first n perfect squares, that is, n k=1 k 2. Show that the sequence {an} satisfies the linear nonhomogeneous recurrence relation a n = a n-1 +n 2 and the initial condition a 1 = 1. The associate linear homogenous recurrence relation for a n is a n = a n-1 The solution of this homogenous recurrence relation are given by a n (h) = c(1) n =c, where c is constant. To find all solutions of a n = a n-1 +n 2 we need find a single particular solution. Because F(n) = n 2.(1) n and s =1 is a root degree one of the characteristic equation of the associate linear homogenous recurrence relation, there is a particular solution of the form n(p 2n 2 +p 1n +p 0) Inserting this into the recurrence relation gives n(p 2n 2 +p 1n +p 0) = n(p 2(n-1) 2 +p 1(n -1)+p 0) + n 2. Solve the equation for the coefficient we get the particular solution a n (p) = n(n+1)(2n+1)/6 Hence the solution is a n = c + n(n+1)(2n+1)/6 since a 1 = 1 it follows that c = 0; hence a n = n(n+1)(2n+1)/6 5. Use generating functions to solve the recurrence relation a k = 5a k-1-6a k-2 with initial conditions a 0 = 6 and a 1 = 30. ak = 18 3 k 12 2 k 6. Suppose that a valid codeword is an n digit number in decimal; notation containing an even number of 0s. Let a n denote the number of valid codeword of length n. Find the recurrence relation of a n. Use generating functions to find an explicit formula for a n. Note that a1 = 9 because there are 10 one-digit strings, and only one, namely, the string 0, is not valid.a recurrence relation can be derived for this sequence by considering how a valid n-digit string can be obtained from strings of n 1 digits. There are two ways to form a valid string with n digits from a string with one fewer digit. First, a valid string of n digits can be obtained by appending a valid string of n 1 digits with a digit other than 0. This appending can be done in nine ways. Hence, a valid string with n

digits can be formed in this manner in 9an 1 ways. Second, a valid string of n digits can be obtained by appending a 0 to a string of length n 1 that is not valid. (This produces a string with an even number of 0 digits because the invalid string of length n 1 has an odd number of 0 digits.) The number of ways that this can be done equals the number of invalid (n 1)-digit strings. Because there are 10n 1 strings of length n 1, and an 1 are valid, there are 10n 1 an 1 valid n-digit strings obtained by appending an invalid string of length n 1 with a 0. Because all valid strings of length n are produced in one of these two ways, it follows that there are a n = 9a n-1 + (10 n-1- a n-1) we multiply both sides of the recurrence relation by x n,to obtain a n = 8a n-1 x n + 10 n-1 x n let G(x) = n=0 a n x n be the generating function of the sequence a 0,a 1,a 2 We sum both sides of the last equations starting with n =1. To find that There for we have Expanding the right hand side of the eqation into partial fractions gives This is equivalent to

7. Consider the nonhomogeneous linear recurrence relation a n = 3 a n-1 +2 n. I. Show that a n = -2 n+1 is a solution of this recurrence relation. II. Find all the solutions of this recurrence relation. III. Find the solution with a 0 =1 I 3a n 1 + 2n = 3( 2) n + 2 n = 2 n ( 3 + 1) = 2 n+1 = a n II a n = α3 n 2 n+1 III a n = 3 n+1 2 n+1 8. For the recurrence given bellow answer the following question T(n) = 7T ( n ) 2 6T(n ), T(1) = 2, T(2) = 7 4 I. Does recurrence for T(n) involve previous terms which are within a fixed range of n? II. If not, use the domain transform such that for given terms T(f(n)), T(f(f(n))), select a function g(m) which hold the property f(g(m)) = g(m-1). III. Solve the transformed recurrence with initial conditions written above. IV. Find the solution of original recurrence using inverse transformation. In this case f(n) = n/2 and by selecting g(m) = 2 m we obtain f(g(m)) =g(m)/2=2 m /2= 2 m 1 = g(m 1). By equating n with 2 m we obtain T(2 m ) = 7T ( 2m 2 ) 6T (2m 4 ) = 7T(2m 1 ) 6T(2 m 2 ), Let S(m) = T(2 m ). The recurrence for S(m) is S(m) = 7S(m 1) 6S(m 2), S(0) = T(1) = 2, S(1) = T(2) = 7. Note that the initial conditions for S(m) were also transformed. This recurrence was solved in Example 1; its solution is S(m) = 6m + 1. The inverse of g(m) = 2m is g 1(n) = log2 n. The solution for T(n) is T(n) = S(g 1(n)) = S(log2 n) = 6log2 n + 1 = nlog2 6 + 1. 9. For the recurrence given bellow, answer the following question T(n 1)3 T(2) = 2., T(0) = 2, T(1) = 2 T(n 2) 2 I. Is the recurrence linear? II. If not, apply the range transformations to the recurrence to make it linear. Idea is for given relation for T(n) in terms of T(n-1), T(n-2),., T(n-k), find a function f(x) such that f(t(n)) is a linear combination of f(t(n-1)),, f(t(n-k)). III. Solve the transformed recurrence with initial condition written above. IV. Find the solution of original recurrence using the inverse transformation. In this case by selecting f(x) = log2 x we obtain

f(t(n)) = log2 T(n) = log2 2 + log2(t(n 1) 3 ) log2 T(n 2) 2 = 3 log2 T(n 1) 2 log2 T(n 2) + 1 = 3f(T(n 1)) 2f(T(n 2)) + 1. If we let W(n) = f(t(n)) and the we obtain the following recurrence for W(n) W(n) = 3W(n 1) 2W(n 2) + 1, which has characteristic equation: (x 1)(x 2)(x 1)0+1 = (x 1)2(x 2) = 0. The general form of the solution is: W(n) = c11 n + c2n1 n + c32 n. Since there are three constants, one additional initial value must be obtained form the recurrence for solving the constants. T(2) = 2. T(1)3 23 T(0) 2=2. = 4 2 2 The values for the first three terms of T(n) must be transformed into the corresponding values for W(n) using f(). W(0) = f(t(0)) = log2 T(0) = log2 2 = 1 W(1) = f(t(1)) = log2 T(1) = log2 2 = 1 W(2) = f(t(2)) = log2 T(2) = log2 4 = 2 Constraints for constants: W(0) = 1 = c1 + c3 W(1) = 1 = c1 + c2 + 2c3 W(2) = 2 = c1 + 2c2 + 4c3 for constants: c1 = 0, c2 = 1, and c3 = 1. The solution to W(n) s recurrence is 2 n n. The final step is to transform the solution for W(n) into the solution for T(n) using the inverse of f(). The inverse of f(x) = log2 x is f 1 (y) = 2 y so the solution for T(n) is. T(n) = f 1 (W(n)) = 2 W(n) = 2 2n n =2 2n /2 n