# Solving Recurrence Relations 'Chip & Conquer'

I've been tasked with solving some recurrence relations, and I've been running into trouble with so called 'chip & conquer' relations.

Here are some example problems:

$$T(n) = T(n-5) + cn^2$$

and

$$T(n) = T(n-2) + \log{n}$$

I'm supposed to be giving an answer in $\Theta$ notation. How do I go around and solving relations like these?

For simplicity, let's assume that $5$ divides $n$ and that $n/2=n-5k$ for some integer $k>0$.

\begin{align*} T(n) &= T(n-5) + cn^2 \\ T(n) &= cn^2 + c(n - 5)^2 + c(n - 10)^2 + c(n - 15)^2 + ... + c5^2 + c0^2 \\ &= c(n^2 + (n - 5)^2 + (n - 10)^2 + (n - 15)^2 + ... + 5^2 + 0^2) \\ &\ge c(n^2 + (n - 5)^2 + (n - 10)^2 + (n / 2)^2) \ge c(n / 2)(1 / 5)(n / 2)^2) \\ &= cn^3 / 40 = (c / 40)n^3 \\ &= \Omega(n^3) \\ T(n) &= cn^2 + c(n - 5)^2 + c(n - 10)^2 + c(n - 15)^2 + ... + c5^2 + c0^2 \\ &\le c(n / 5)n^2 \le cn^3 \\ &= O(n^3) \\ \end{align*}

We conclude that $T(n) = \Theta(n^3)$.

Let's assume for simplicity that $n/2 = n-2k$ for an integer $k>1$.

\begin{align*} T(n) &= T(n-2) + \log n = \log n + \log(n - 2) + \log(n - 4) + ... + \log(4) \\ &\ge \log n + \log(n - 2) + \log(n - 4) + ... + \log(n / 2) \ge (n / 2)log(n / 2) \\ &= \Omega(n \log n) \\ T(n) &= T(n-2) + \log n = \log n + \log(n - 2) + \log(n - 4) + ... + \log(4) \\ &\le (n / 2) \log n \\ &= O(n \log n) \\ \end{align*}

We conclude that $T(n)=\Theta(n \log n)$.

Expand the recurrence and sum it up.

Example 1:

\begin{align*} T(n) &= T(n-5) + O(n^2) = T(n-10) + O(n^2) = \dots \\ &= T(0) + \{\text{$$n/5$$ terms, each $$O(n^2)$$}\} \end{align*}

Now let's say $T(0) = c$. This would be generally given in the question.

so this would sum to $(n/5).O(n^2) = O(n^3)$

Example 2:

\begin{align*} T(n) &= T(n-2)+\log n = T(n-4)+\log(n-2) + \log(n) = \dots \\ &= T(0) + \log(n-2^k) + \dots + log(n) = c + \log(n-2^k) + \dots + \log(n-2) + \log(n) \\ &= c + n \log(n) \end{align*}

• It was supposed to be +cn^2 not =cn^2. Silly typos! – user906153 Apr 25 '12 at 2:42
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 1.0000100135803223, "perplexity": 1216.9382139781528}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-29/segments/1593655882051.19/warc/CC-MAIN-20200703122347-20200703152347-00340.warc.gz"}