From b2c6c5577c3338856283aefc9b1614c9165bd3f8 Mon Sep 17 00:00:00 2001 From: Krzysztof Wojtas Date: Wed, 1 May 2024 00:34:29 +0200 Subject: [PATCH] #167 4-4h --- chapter4/problems/4/h.tex | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/chapter4/problems/4/h.tex b/chapter4/problems/4/h.tex index a0deb8f..0f62902 100644 --- a/chapter4/problems/4/h.tex +++ b/chapter4/problems/4/h.tex @@ -1 +1,31 @@ -\workinprogress % TODO +Let $n_0>0$ be the implicit threshold constant, and let $d>0$ be another constant such that $T(n)\le d$ for all $n0$. + +Let $0 \lg((n-1)!)-\lg(n_0!)+\lg n \\ + &= \lg((n-1)!\cdot n)-\lg(n_0!) \\ + &= \lg(n!)-\lg(n_0!) +\end{align*} +and +\begin{align*} + T(n) &= T(n-1)+\lg n \\ + &\le \lg((n-1)!)+d+\lg n \\ + &= \lg((n-1)!\cdot n)+d \\ + &= \lg(n!)+d, +\end{align*} +thereby completing the inductive proof. + +By the bounds shown above and by equation (3.28), we obtain $T(n)=\Theta(\lg(n!))=\Theta(n\lg n)$.