Chapter 5: Problem 15
Solve each LHRRWCC. $$a_{n}=a_{n-1}+a_{n-2}, a_{0}=2, a_{1}=3$$
/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none}
Learning Materials
Features
Discover
Chapter 5: Problem 15
Solve each LHRRWCC. $$a_{n}=a_{n-1}+a_{n-2}, a_{0}=2, a_{1}=3$$
All the tools & learning materials you need for study success - in one app.
Get started for free
Algorithm 5.10 computes the \(n\)th power of a positive real number \(x,\) where \(n \geq 0 .\) Use it to answer Exercises 18-24 . Algorithm exponentiation(x,n) (* This algorithm computes the nth power of \(x\) using recursion and returns the value in the variable answer.*) 0\. Begin (* algorithm *) 1\. if \(n=0\) then 2\. answer \(\leftarrow 1\) 3\. else 1 if \(n=1\) then 4\. answer \(\leftarrow x\) 5\. else 6\. begin (* else *) 7\. value \(\leftarrow\) exponentiation \((x,\lfloor n / 2\rfloor)\) 8\. answer \(\leftarrow\) value \(\cdot\) value 9\. If \(n\) is odd then 10\. answer \(\leftarrow\) answer \(\cdot\) \(x\) 11\. endelse 12\. End (* algorithm *) Let \(a_{n}\) denote the number of multiplications (lines \(7-10 )\) required by the algorithm to compute \(x^{n}\) . Compute each. $$a_{4}$$
Using generating functions, solve each LHRRWCC. $$a_{n}=3 a_{n-1}+4 a_{n-2}-12 a_{n-3}, a_{0}=3, a_{1}=-7, a_{2}=7$$
A subset of the set \(S=\\{1,2, \ldots, n | \text { is alternating if its elements, when }\) arranged in increasing order, follow the pattern odd, even, odd, even, etc. For example, \(\\{3\\},\\{1,2,5\\},\) and \(\\{3,4\\}\) are alternating subsets of \(\\{1,2,3,4,5 |\) whereas \(\\{1,3,4\\}\) and \(\\{2,3,4,5\\}\) are not; \(\emptyset\) is considered alternating. Let \(a_{n}\) denote the number of alternating subsets of \(S .\) Prove that \(a_{n}=F_{n+2},\) where \(F_{n}\) denotes the \(n\) th Fibonacci number.
The number \(b_{n}\) of moves needed to transfer \(n\) disks in the Tower of Brahma puzzle in Example \(5.4 .\)
Let \(a, b \in \mathbb{N}\) and \(c, d \in \mathbb{R}^{+}\) with \(b \geq 2 .\) Let \(f\) be a non decreasing function such that \(f(n)=a f(n / b)+c\) and \(f(1)=d .\) Prove each. $$\text { If } a \neq 1, \text { then } f(n)=\mathrm{O}\left(n^{\log _{b} a}\right)$$
What do you think about this solution?
We value your feedback to improve our textbook solutions.