Skip to content

Commit

Permalink
Update 4.6.md
Browse files Browse the repository at this point in the history
New solution giving a simple and exact expression for n_j and a proof of its correctness.
  • Loading branch information
lzralbu authored and Jay Chen committed Mar 7, 2020
1 parent dc095eb commit 6495d00
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/Chap04/4.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@

> Give a simple and exact expression for $n_j$ in equation $\text{(4.27)}$ for the case in which $b$ is a positive integer instead of an arbitrary real number.
We state that $\forall{j \ge 0}, n_j = \left \lceil \frac{n}{b^j} \right \rceil$.

Indeed, for $j=0$ we have from the recurrence's base case that $n_0 = n = \left \lceil \frac{n}{b^0} \right \rceil$.
Now, suppose $n_{j - 1} = \left \lceil \frac{n}{b^{j - 1}} \right \rceil$ for some $j > 0$. By definition, $n_j = \left \lceil \frac{n_{j - 1}}{b} \right \rceil$.
It follows from the induction hypothesis that $n_j = \left \lceil \frac{\left \lceil \frac{n}{b^{j - 1}} \right \rceil}{b} \right \rceil$.
Since $b$ is a positive integer, equation $(3.4)$ implies that $\left \lceil \frac{\left \lceil \frac{n}{b^{j - 1}} \right \rceil}{b} \right \rceil = \left \lceil \frac{n}{b^j} \right \rceil$.
Therefore, $n_j = \left \lceil \frac{n}{b^j} \right \rceil$.

P.S.
$n_j$ is obtained by shifting the base $b$ representation $j$ positions to the right, and adding $1$ if any of the $j$ least significant positions are non-zero.


## 4.6-2 $\star$

> Show that if $f(n) = \Theta(n^{\log_b a}\lg^k{n})$, where $k \ge 0$, then the master recurrence has solution $T(n) = \Theta(n^{\log_b a}\lg^{k + 1}n)$. For simplicity, confine your analysis to exact powers of $b$.
Expand Down

0 comments on commit 6495d00

Please sign in to comment.