1: \documentclass[12pt]{article}
2:
3: \setlength{\textheight}{8.875in}
4: \addtolength{\textheight}{-0.4in}
5: \setlength{\topmargin}{0.0in}
6: \addtolength{\topmargin}{0.2in}
7:
8: \setlength{\columnsep}{2.0pc}
9: %\setlength{\footheight}{-0.1in}
10: \setlength{\headheight}{0.0in}
11: \setlength{\headsep}{0.0in}
12: \setlength{\parindent}{1pc}
13:
14: \setlength{\textwidth}{6.75in}
15: \addtolength{\textwidth}{-0.75in}
16: \setlength{\oddsidemargin}{-.19in}
17: \addtolength{\oddsidemargin}{.375in}
18: \setlength{\evensidemargin}{0.0in}
19: \addtolength{\evensidemargin}{.375in}
20:
21:
22: \makeatletter
23: \def\@normalsize{\@setsize\normalsize{10pt}\xpt\@xpt
24: \abovedisplayskip 10pt plus2pt minus5pt\belowdisplayskip
25: \abovedisplayskip \abovedisplayshortskip \z@ plus3pt\belowdisplayshortskip
26: 6pt plus3pt minus3pt\let\@listi\@listI}
27: \def\subsize{\@setsize\subsize{12pt}\xipt\@xipt}
28: \def\section{\@startsection
29: {section}{1}{\z@}{1.0ex plus 1ex minus .2ex}{.2ex plus .2ex}{\large\bf}}
30: \def\subsection{\@startsection
31: {subsection}{2}{\z@}{.2ex plus 1ex}{.2ex plus .2ex}{\subsize\bf}}
32: \makeatother
33:
34: \begin{document}
35:
36: \date{}
37:
38: \title{\Large\bf Multiple-Size Divide-and-Conquer
39: Recurrences\thanks{Copyright \copyright\ 1997 by Ming-Yang Kao. A version
40: of this work
41: appeared in {\it Proceedings
42: of the International Conference on Algorithms, the 1996 International
43: Computer Symposium}, pages 159--161, National Sun Yat-Sen University,
44: Kaohsiung, Taiwan, Republic of China, 1996.
45: Reprinted in {\em {SIGACT News}}, 28(2):67--69, June
46: 1997.}}
47:
48: \author{Ming-Yang Kao\thanks{Research supported in part by NSF Grant
49: CCR-9101385.}
50: \\ Department of Computer Science
51: \\ Duke University
52: \\ Durham, NC 27708
53: \\ U.S.A.
54: \\ \
55: \\ kao@cs.duke.edu}
56:
57: \maketitle
58:
59: \newtheorem{thm}{Theorem}
60:
61: \thispagestyle{empty}
62:
63: \newcommand{\ceiling}[1]{\lceil{#1}\rceil}
64:
65: \section{Introduction}
66: This note reports a tight asymptotic solution to the following recurrence
67: on all positive integers $n$:
68: \begin{eqnarray}
69: & T(n) = c{\cdot}n^\alpha{\cdot}\log^\beta{n} + \sum_{i=1}^{k}
70: a_i{\cdot}T(\ceiling{b_i{\cdot}n}) & \mbox{for $n \geq n_0$,}
71: \label{rec_1}
72: \\
73: & 0 < T(n) \leq d & \mbox{for $n < n_0$,}
74: \label{rec_2}
75: \end{eqnarray}
76: where
77: \begin{itemize}
78: \item $\alpha \geq 0, \beta \geq 0, c > 0, d > 0$,
79: \item $k$ is a positive integer,
80: \item $a_i > 0$ and $1 > b_i > 0$ for $i=1,\ldots,k$,
81: \item $n_0 \geq \max_{i=1}^k \frac{1}{1-b_i}$.
82: \end{itemize}
83: Since $n_0 \geq \max_{i=1}^k \frac{1}{1-b_i}$, $\ceiling{b_i{\cdot}n} \leq
84: n -1$ for all $b_i$ and $n \geq n_0$. Thus, the $T(n)$ term on the
85: left-hand side of (\ref{rec_1}) is defined on $T$-terms with smaller $n$,
86: and (\ref{rec_2}) properly specifies the initial values of $T$.
87:
88: A special case of this recurrence, namely, $k=1$, is discussed in
89: \cite{BHS80,Lueker80} and standard textbooks on algorithms and is used
90: extensively to analyze divide-and-conquer strategies \cite{AHU74,CLR91}. A
91: specific recurrence with $k=2$ is used to analyze a divide-and-conquer
92: algorithm for selecting a key with a given rank \cite{AHU74,BFPRT73,CLR91}.
93:
94: Let $g(x) = \sum_{i=1}^{k} a_i{\cdot}b_i^x$. The {\it characteristic
95: equation} of the general recurrence is the equation $g(x) = 1$. Our
96: solution to the general recurrence is summarized in the following theorem.
97: \begin{thm}
98: \label{the_thm}
99: If $r$ is the solution to the characteristic equation of the general
100: recurrence, then
101: \[T(n) = \left\{\begin{array}{ll}
102: \Theta(n^r) & \mbox{if $r > \alpha$;}
103: \\
104: \Theta(n^\alpha\log^{1+\beta}{n}) & \mbox{if $r = \alpha$;}
105: \\
106: \Theta(n^\alpha\log^\beta{n}) & \mbox{if $r < \alpha$.}
107: \end{array}\right.
108: \]
109: \end{thm}
110:
111: The key ingredient of our proof for this theorem is the notion of a
112: characteristic equation. With this new notion, our proof is essentially
113: the same as that of the case with $k =1$ \cite{AHU74,BHS80,CLR91,Lueker80}.
114: This note concentrates on elaborating the characteristic equation's role in
115: our proof by detailing an upper bound proof for a certain case. Once this
116: example is understood, it is straightforward to reconstruct a general proof
117: for Theorem~\ref{the_thm}. Consequently, we omit the general proof for the
118: sake of brevity and clarity.
119:
120: \section{An Example}
121: This section discusses the general recurrence with $k=3$. To further focus
122: our attention on the characteristic equation's role, we assume that $\beta
123: = 0$, $r$ is a positive integer, and $r > \alpha$. Then, according to
124: Theorem~\ref{the_thm}, $T(n)=\Theta(n^r)$. We will only prove
125: $T(n)=O(n^r)$. The lower bound proof is similar.
126:
127: Let $S(n) = f_1{\cdot}n^r - f_2{\cdot}n^{r-\frac{1}{2}} -
128: f_3{\cdot}n^\alpha$. It suffices to show that there exist some positive
129: constants $f_1, f_2, f_3$ such that $T(n) = O(S(n))$. These constants and
130: some others are chosen as follows. Without loss of generality, we assume
131: $b_1 < b_2 < b_3$.
132: \begin{eqnarray*}
133: f_3 & = & \frac{c}{g(\alpha)-1};
134: \\ f_2 & = & \mbox{any positive constant};
135: \\ f_1 & = & f_2+f_3+1;
136: \\ m_0 & = & \max \{n_0, \frac{1}{b_1},
137: \left(\frac{f_1{\cdot}2^r{\cdot}\frac{1}{b_1}}
138: {f_2{\cdot}\left(g(r-\frac{1}{2})-1\right)}\right)^2\};
139: \\ M & = & \max_{n < m_0}\{1, T(n)\}.
140: \end{eqnarray*}
141: Note that since $0 < b_i < 1$ for all $b_i$, $g$ is a decreasing function.
142: Then since $r > \alpha$ and $r > r-\frac{1}{2}$, $g(\alpha) > 1$ and
143: $g(r-\frac{1}{2}) > 1$. Thus, the above constants are all positive. We
144: next consider the following new recurrence:
145: \begin{eqnarray}
146: & R(n) = c{\cdot}n^\alpha +
147: a_1{\cdot}R(\ceiling{b_1{\cdot}n}) +
148: a_2{\cdot}R(\ceiling{b_2{\cdot}n}) +
149: a_3{\cdot}R(\ceiling{b_3{\cdot}n})
150: \label{r1}
151: & \mbox{for $n \geq m_0$,}
152: \\
153: & R(n) = 1 & \mbox{for $n < m_0$,}
154: \nonumber
155: \end{eqnarray}
156: It can be shown by induction that $T(n) \leq {M}{\cdot}R(n)$ for all $n$.
157: Thus, to prove $T(n) = O(S(n))$, it suffices to show $R(n) \leq S(n)$ for
158: all $n$.
159:
160: {\it Base Case}: $R(m) \leq S(m)$ for all $m < m_0$. This follows from the
161: choice of $f_1$.
162:
163: Given some $n \geq m_0$, we need to show $R(n) \leq S(n)$.
164:
165: {\it Induction Hypothesis}: $R(m) \leq S(m)$ for all integers $m$ where
166: $m_0 \leq m < n$.
167:
168: {\it Induction Step}:
169: \begin{eqnarray}
170: R(n) & \leq &
171: c{\cdot}n^\alpha + a_1{\cdot}S(\ceiling{b_1{\cdot}n}) +
172: a_2{\cdot}S(\ceiling{b_2{\cdot}n}) + a_3{\cdot}S(\ceiling{b_3{\cdot}n})
173: \label{eqn_i1}
174: \\ & \leq & c{\cdot}n^\alpha + f_1{\cdot}g(r){\cdot}(n+\frac{1}{b_1})^r -
175: f_2{\cdot}g(r-\frac{1}{2}){\cdot}n^{r-\frac{1}{2}} -
176: f_3{\cdot}g(\alpha){\cdot}n^\alpha
177: \label{eqn_i5}
178: \\ & \leq & c{\cdot}n^\alpha +
179: f_1{\cdot}g(r){\cdot}n^r+f_1{\cdot}2^r{\cdot}n^{r-1}{\cdot}\frac{1}{b_1} -
180: f_2{\cdot}g(r-\frac{1}{2}){\cdot}n^{r-\frac{1}{2}} -
181: f_3{\cdot}g(\alpha){\cdot}n^\alpha
182: \label{eqn_i6}
183: \end{eqnarray}
184: In this above derivation,
185: \begin{itemize}
186: \item (\ref{eqn_i1}) follows from (\ref{r1}), the inequality $m_0 \geq
187: n_0$, the base step and the induction hypothesis;
188: \item (\ref{eqn_i5}) follows from the fact that $\ceiling{b_i{\cdot}n} \leq
189: b_i{\cdot}(n+\frac{1}{b_1})$;
190: \item (\ref{eqn_i6}) follows from the fact that $(n+\frac{1}{b_1})^r \leq
191: n^r+2^r{\cdot}n^{r-1}{\cdot}\frac{1}{b_1}$ because $r$ is a positive
192: integer and $m_0 \geq \frac{1}{b_1}$.
193: \end{itemize}
194: To finish the induction step, note that the right-hand side of
195: (\ref{eqn_i6}) is at most $S(n)$ as desired for the following reasons.
196: \begin{itemize}
197: \item By the choice of $f_3$,
198: \(
199: c{\cdot}n^\alpha + f_3{\cdot}g(\alpha){\cdot}n^\alpha \leq
200: -f_3{\cdot}n^\alpha.
201: \)
202: \item
203: Since $m_0 \geq \left(\frac{f_1{\cdot}2^r{\cdot}\frac{1}{b_1}}
204: {f_2{\cdot}\left(g(r-\frac{1}{2})-1\right)}\right)^2$,
205: $
206: f_1{\cdot}2^r{\cdot}n^{r-1}{\cdot}\frac{1}{b_1} -
207: f_2{\cdot}g(r-\frac{1}{2}){\cdot}n^{r-\frac{1}{2}} \leq
208: - f_2{\cdot}n^{r-\frac{1}{2}}.$
209: \end{itemize}
210:
211: \section*{Acknowledgments}
212: The author found the result in this note in 1986 while teaching a course on
213: algorithms. Since then, he has been teaching it in his classes. He wishes
214: to thank Don Rose for helpful discussions.
215:
216: %\bibliographystyle{plain}
217: %\bibliography{all}
218:
219: \begin{thebibliography}{1}
220:
221: \bibitem{AHU74}
222: A.~V. Aho, J.~E. Hopcroft, and J.~D. Ullman.
223: \newblock {\em The Design and Analysis of Computer Algorithms}.
224: \newblock Addison-Wesley, Reading, MA, 1974.
225:
226: \bibitem{BHS80}
227: J.~L. Bentley, D.~Haken, and J.~B. Saxe.
228: \newblock A general method for solving divide-and-conquer recurrences.
229: \newblock {\em SIGACT News}, 12(3):36--44, 1980.
230:
231: \bibitem{BFPRT73}
232: M.~Blum, R.~W. Floyd, V.~Pratt, R.~L. Rivest, and R.~E. Tarjan.
233: \newblock Time bounds for selection.
234: \newblock {\em Journal of Computer and System Sciences}, 7(4):448--461, 1973.
235:
236: \bibitem{CLR91}
237: T.~H. Cormen, C.~L. Leiserson, and R.~L. Rivest.
238: \newblock {\em Introduction to Algorithms}.
239: \newblock {MIT} Press, Cambridge, MA, 1991.
240:
241: \bibitem{Lueker80}
242: G.~S. Lueker.
243: \newblock Some techniques for solving recurrences.
244: \newblock {\em ACM Computing Surveys}, 12(4):419--436, 1980.
245:
246: \end{thebibliography}
247:
248: \end{document}
249: