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

Similar documents
Some Review Problems for Exam 2: Solutions

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

MATH 243E Test #3 Solutions

Math 2142 Homework 5 Part 1 Solutions

MATH 3012 N Solutions to Review for Midterm 2

Math 24 Spring 2012 Questions (mostly) from the Textbook

COM S 330 Lecture Notes Week of Feb 9 13

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 =

Section 9.7 and 9.10: Taylor Polynomials and Approximations/Taylor and Maclaurin Series

Math 475, Problem Set #8: Answers

MATH 1231 MATHEMATICS 1B CALCULUS. Section 5: - Power Series and Taylor Series.

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

Review for Exam 2. Review for Exam 2.

Introduction to Combinatorial Mathematics

Math 112 Rahman. Week Taylor Series Suppose the function f has the following power series:

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.

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

n=0 xn /n!. That is almost what we have here; the difference is that the denominator is (n + 1)! in stead of n!. So we have x n+1 n=0

Statistics 253/317 Introduction to Probability Models. Winter Midterm Exam Friday, Feb 8, 2013

MATH 324 Summer 2011 Elementary Number Theory. Notes on Mathematical Induction. Recall the following axiom for the set of integers.

Recurrence Relations

April 30, Name: Amy s Solutions. Discussion Section: N/A. Discussion TA: N/A

No Solution Equations Let s look at the following equation: 2 +3=2 +7

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

Some Review Problems for Exam 3: Solutions

Some Review Problems for Exam 3: Solutions

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

What this shows is that an a + b by c + d rectangle can be partitioned into four rectangular regions with areas ac, bc, ad and bd, thus proving that

Solving Quadratic & Higher Degree Equations

, p 1 < p 2 < < p l primes.

base 2 4 The EXPONENT tells you how many times to write the base as a factor. Evaluate the following expressions in standard notation.

Definition: A sequence is a function from a subset of the integers (usually either the set

MATH 408N PRACTICE MIDTERM 1

CMSC250 Homework 9 Due: Wednesday, December 3, Question: Total Points: Score:

Fall 2017 Test II review problems

2. Polynomials. 19 points. 3/3/3/3/3/4 Clearly indicate your correctly formatted answer: this is what is to be graded. No need to justify!

Math 4326 Fall Exam 2 Solutions

Exam 2 Solutions. In class questions

Name: Exam 2 Solutions. March 13, 2017

Student name: Student ID: TA s name and/or section: MATH 3B (Butler) Midterm II, 20 February 2009

EXAM 2 MARCH 17, 2004

Without fully opening the exam, check that you have pages 1 through 13.

Outline. We will cover (over the next few weeks) Induction Strong Induction Constructive Induction Structural Induction

CS 154 Introduction to Automata and Complexity Theory

Electric Circuits Part 2: Kirchhoff s Rules

Math 42: Fall 2015 Midterm 2 November 3, 2015

CHAPTER 8 Advanced Counting Techniques

Math 463/563 Homework #2 - Solutions

Math Circle: Recursion and Induction

Mathematics Algebra. It is used to describe the world around us.

Exponents are a short-hand notation for writing very large or very. small numbers. The exponent gives the number of times that a number

This is a closed book exam. No notes or calculators are permitted. We will drop your lowest scoring question for you.

Solving Quadratic & Higher Degree Equations

CS 124 Math Review Section January 29, 2018

MATH 13 SAMPLE FINAL EXAM SOLUTIONS

Math WW08 Solutions November 19, 2008

Math 122 Test 3. April 15, 2014

Math 10b Ch. 8 Reading 1: Introduction to Taylor Polynomials

MCS 256 Discrete Calculus and Probability Exam 5: Final Examination 22 May 2007

Notes on Polynomials from Barry Monson, UNB

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

1. (4 % each, total 20 %) Answer each of the following. (No need to show your work for this problem). 3 n. n!? n=1

MITOCW MITRES18_005S10_DiffEqnsMotion_300k_512kb-mp4

Lecture 3: Miscellaneous Techniques

FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016)

Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018

n f(k) k=1 means to evaluate the function f(k) at k = 1, 2,..., n and add up the results. In other words: n f(k) = f(1) + f(2) f(n). 1 = 2n 2.

Parabolas and lines

We say that the function f obtains a maximum value provided that there. We say that the function f obtains a minimum value provided that there

University of New Mexico Department of Computer Science. Final Examination. CS 561 Data Structures and Algorithms Fall, 2013

Math Real Analysis II

Math 115 HW #10 Solutions

MATHEMATICS FOR ENGINEERS & SCIENTISTS 23

1 What is the area model for multiplication?

1 Sequences and Summation

CS103 Handout 47 Spring 2018 Practice CS103 Final Exam V

Sec 2.1 The Real Number Line. Opposites: Two numbers that are the same distance from the origin (zero), but on opposite sides of the origin.

Lecture 10: Powers of Matrices, Difference Equations

MITOCW Lec 15 MIT 6.042J Mathematics for Computer Science, Fall 2010

1 Answers to Chapter 8, Odd-numbered Exercises

Examples. f (x) = 3x 2 + 2x + 4 f (x) = 2x 4 x 3 + 2x 2 5x 2 f (x) = 3x 6 5x 5 + 7x 3 x

Introduction to discrete probability. The rules Sample space (finite except for one example)

HOMEWORK #2 - MATH 3260

Solving Quadratic & Higher Degree Equations

12 Sequences and Recurrences


Eigenvalues and eigenvectors

Euler-Cauchy Using Undetermined Coefficients

Algebra II Polynomials: Operations and Functions

CMSC Discrete Mathematics SOLUTIONS TO SECOND MIDTERM EXAM November, 2005

AP Physics C 2015 Summer Assignment

CS1800 Discrete Structures Final Version A

2015 Math Camp Calculus Exam Solution

Examples: Solving nth Order Equations

1.4 Techniques of Integration

4. What is the probability that the two values differ by 4 or more in absolute value? There are only six

Polynomials; Add/Subtract

Math 353, Fall 2017 Study guide for the final

1 Take-home exam and final exam study guide

1.1 Inductive Reasoning filled in.notebook August 20, 2015

Transcription:

Math 5366 Fall 015 Exam Solutions 1. (0 points) Find the appropriate generating function (in closed form) for each of the following problems. Do not find the coefficient of x n. (a) In how many ways can n balls be put in 4 boxes if each box is nonempty? Solution: The generating function for each box is x + x + x 3 + = x 1 x. x 4 The generating function for the problem is the fourth power of this, (1 x). 4 (b) How many quaternary sequences (0 s, 1 s, s, 3 s) of length n are there having at least 1 of each of the four digits? Solution: Here, the generating function is (x + x! + x3 3! + ) 4 = (e x 1) 4. (c) In how many ways can n balls be put in 4 boxes if the first box has an even number of balls and the last box has an odd number of balls? Solution: The generating function for the first box is 1 + x + x 4 + = 1. 1 x For the last box, it is x + x 3 + x 5 + = x. For the problem we have 1 x 1 1 1 x 1 x 1 x 1 x 1 x = x (1 x ) (1 x). (d) How many quaternary sequences of length n have an even number of 0 s and an odd number of 1 s? e x + e x Solution: Even number of 0 s:, odd number of 1 s: generating function is ex + e x e x e x e x = e4x 1. 4 e x e x, our

. (0 points) Find the generating function for each of the following problems. Then SOLVE for the number asked. (a) In how many ways can n balls be put into 4 boxes if the first box has at least balls? x 1 x. x (1 x), and the coefficient of 4 xn in Solution: The generating function for the first box is x +x 3 +x 4 + = for the problem, the generating function is ( ) ( ) n + 4 1 n + 1 this is =. 4 1 3 (b) How many quaternary sequences of length n have at least two 0 s? Solution: For 0 we need x + x3 + =! 3! ex 1 x. The rest just contribute e x each. The generating function for the problem is e 4x e 3x xe 3x. The answer to the question is n! times the coefficient of x n in this expression or ( ) 4 n n! n! 3n n! 3n 1 = 4 n 3 n n3 n 1. (n 1)! 3. (10 points) Find a recurrence, with initial conditions, for a n, the number of ternary sequences of length n in which all the 0 s occur before any. Hint: After the first appears, the remaining digits can only be 1 s and s. Solution: If the sequence starts with either 0 or 1, then filling in the remaining n 1 positions is the same kind of problem: they must have all 0 s occurring before any. The count for this is a n 1, so there are a n 1 strings of this type. If the string starts with a, then the remaining n 1 positions consist of only 1 s and s, and there are a total of n 1 strings of this type. The total count is a n = a n 1 + n 1. For the initial conditions, the empty string fulfills the requirements so a 0 = 1. Alternatively, all strings of length 1 are ok so a 1 = 3. As a check, the recurrence continues 1, 3, 8, 0, 8,.... How many bad strings of length 3 are there? I count 7: 00, 01, 0, 0, 10, 00, 10. This leaves 3 3 7 = 0 good strings, as it should. Page

4. (0 points) Solve each of the following recurrence relations (a) a n = 7a n 1 10a n, a 0 = 4, a 1 = 11. Solution: The characteristic polynomial is x 7x + 10 = (x )(x 5) so the general solution is a n = A n + B5 n. The initial conditions give us A + B = 4, A + 5B = 11. Multiplying the first by and subtracting from the second, 3B = 3. Thus, B = 1, A = 3, and the solution is a n = 3 n + 5 n. (b) a n = 6a n 1 9a n, a 0 = 1, a 1 = 9. Solution: Here, the characteristic polynomial is x 6x + 9 = (x 3). Since there is a multiple root the general solution is a n = (An + B)3 n. The initial conditions now say B = 1, 3A + 3B = 9, or A =. The solution is a n = (n + 1)3 n. 5. (0 points) solve each of the following inhomogeneous recurrence relations. Hint: You solved the homogeneous problem in part 3a. Sorry about that it should have been 4(a). (a) a n = 7a n 1 10a n 3 n, a 0 = 1, a 1 = 39. Solution: The general solution to an inhomogeneous recurrence has the form (Particular solution to inhomogeneous recurrence) + (general homogeneous solution). We know the general homogeneous solution is A n + B5 n from question 4. For a particular solution, we should guess a n = P 3 n. Trying this, P 3 n = 7P 3 n 1 10P 3 n 3 n. Dividing by 3 n, 9P = 1P 10P 18, or P = 18. So the general solution to the recurrence is A n + B5 n + 9 3 n. The initial conditions yield A + B + 9 = 1, A + 5B + 7 = 39. From these, we get B =, A = 1 so the solution we seek is a n = n + 5 n + 3 n+. (b) a n = 7a n 1 10a n + 3 5 n 1, a 0 = 1, a 1 = 7. Solution: Since 5 n is already part of the homogeneous solution, for a particular solution we should guess a n = P n5 n. Trying this, P n5 n = 7P (n 1)5 n 1 10P (n )5 n + 3 5 n 1. Dividing by 5 n 1, 5nP = 7(n 1)P P (n ) + 3. If you really trust yourself, you can plug in a value for n to get P. One student use n = to get 10P = 7P + 3. I just worked with the original expression: 5nP = 7nP 7P np + 4P + 3 np (5 7 + ) + P (7 4) = 3. Either way, P = 1, and the general solution is A n + B5 n + n 5 n. The initial conditions give A + B = 1, A + 5B + 5 = 7. From these, we get A = 1, B = 0. The solution we seek is a n = n + n5 n. Page 3

Here is another approach to problems like number 5. Take part (a). If we know that the particular solution has to have the form P 3 n and the general solution will be a n = A n +B5 n +(particular) = A n +B5 n +P 3 n, then we can create another initial condition and solve for A, B, P using those. In this case, a = 135. We have A + B + P = 1, A + 5B + 3P = 39, 4A + 5B + 9P = 135. Subtracting twice the second from the third and then twice the first from the second, 15B + 3P = 57, 3B + P = 15, and we get 6B = 1 B =, P = 9, A = 1. On 5(b), we could not use a n = A n + B5 n + P 5 n because 5 n would be used twice so we need a n = A n + B5 n + P n5 n. With a = 54, A + B = 1, A + 5B + 5P = 7, 4A + 5B + 50P = 54. We quickly find A = 1, B = 0, P = 1. This method requires that we know the form of the particular solution. It usually requires more effort than the method outlined in the book and in class (more variables and more equations to solve) but in small cases it can be pretty fast. 6. (10 points) Solve each of the following recurrence relations. You may use any approach that can be sufficiently justified. I will give extra credit if you use generating functions. (a) a n = a n 1 + 3a n + 9a n 3 + + 3 n 1 a 0, a 0 = 3. Solution: Here are two approaches: First, if we just plug in values, a 1 = a 0 = 3, a = a 1 + 3a 0 = 1, a 3 = 1 + 3 3 + 9 3 = 48, we might be able to guess that a n = 3 4 n 1, when n 1, with a 0 = 3, which technically does not fit the pattern. With this guess, we could verify by induction that the guess is right: if true through n 1 then a n = 3 4 n + 3 4 n 3 + + 3 n 1 4 0 + 3 n. All but the last term form a geometric progression (ratio 3 4 ) so a n = 3 n + 3 4n 3 4 3n 1 4 0 1 3 4 = 3 n + 3 4 n 1 3 n = 3 4 n 1, as desired. More thematic is the following: If n then we can write a n 1 = a n +3a n 3 + + 3 n a 0. We multiply this by 3 and subtract from the original recurrence: a n = a n 1 + 3a n + 9a n 3 + + 3 n 1 a 0 (3a n 1 = 3a n + 3 a n 3 + + 3 n 1 a 0 ) to get a n 3a n 1 = a n 1, or a n = 4a n 1, but not starting at n = 1 but at n =. Since a 1 = 3, we have, for n 1, a n = 3 4 n 1, as above. Page 4

(b) a n = na n 1 + 3n 3, a 0 = 1. Strong hint: One approach is to guess a particular solution of the form a n = P, and then solve the homogeneous problem. Solution: The point of this problem is to stress this idea that for an inhomogeneous system, General solution = General homogeneous solution + Particular solution. The homogeneous problem, a n = na n 1 can easily be solved by iteration: a 1 = 1 a 0, a = a 1 = 1 a 0, a 3 = 3 1a 0, etc. so a n = An!. But what about the particular solution? The hint says to try a n = P, a constant. We get P = np + 3n 3, or n(p + 3) (P + 3) = 0, and this should be 0 for all n. This happens when P = 3 so our particular solution worked. The general solution is a n = An! 3, and a 0 = 1 requires A = 4. The solution is a n = 4n! 3. 7. Some extra credit questions, if you are interested. Generating functions help on (d). (a) ( points) Solve the recurrence in question 3. (b) (8 points) Find, with initial conditions, a recurrence for a n, the number of sequences of length n made of 0 s, 1 s, s, 3 s, 4 s, if all 0 s appear before any and all s appear before any 4. Solve the recurrence. I will give credit for sufficient progress. (c) (4 points) Solve the recurrence a n = a n 1 + a n + 3a n 3 + + na 0, a 0 = 1. (d) (4 points) Solve the recurrence a n = na n 1 + (n 1)a n + + a 0, a 0 = 1. Page 5