## Discrete Mathematics with Applications 4th Edition

Quantities of the form $kn + kn\log_2n$ for positive integers $k_1 \cdot k_2$ and $n$ arise in the analysis of the merge sort algorithm in computer science. Show that for any positive integer $k$, $k_1n+k_2n\log_2n$ is $\Theta(n\log_2n)$. For $n>1$ and for positive integers $k_1,k_2$: $k_2n\log_2n \leq k_1n+k_2n\log_2n$. For $n>1$ and for positive integers $k_1,k_2$: $k_1n \leq k_1n\log_2n$ (by statement 11.4.13) Add $k_2n\log_2n$ to both sides: $k_1n + k_2n\log_2n \leq k_1n\log_2n + k_2n\log_2n = (k_1+k_2)\log_2n$. Because all terms are positive: $k_2|n\log_2n| \leq |k_1n + k_2n\log_2n| \leq (k_1+k_2)|\log_2n|$. Hence for $A=k_1, B=(k_1 + k_2), h=1$, $A|n\log_2n| \leq |k_1n + k_2n\log_2n| \leq B|\log_2n|$ for all $n>h$. Thus $k_1n+k_2n\log_2n$ is $\Theta(n\log_2n)$
Recall the definition of $\Theta$-notation: $f(x)$ is $\Theta(g(x))$ iff there exist positive real numbers A, B, k, such that $A|g(x)| \leq |f(x)| \leq B|g(x)|$ for all $x>k$. Statement 11.4.13: For all real numbers $b$ with $b>1$ and for all sufficiently large real numbers $x$: $x \leq x\log_bx \leq x^2$.