You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

请求协助求解递推关系式T(n) = T(9n/10) + n

Solving the Recurrence Relation T(n) = T(9n/10) + n (with T(1)=0)

Great job getting started with expanding the recurrence—you’re already on the right track! Let’s finish up the solution by completing the pattern you’ve started and simplifying the geometric series at the core of the problem.

Step 1: Finalize the k-th Expansion

You correctly expanded the recurrence k times to reach:

T(n) = T( (9^k n)/10^k ) + n * [ (9/10)^0 + (9/10)^1 + (9/10)^2 + ... + (9/10)^{k-1} ]

Since we know T(1) = 0, we need to find k such that (9^k n)/10^k = 1. Rearranging this gives:

(9/10)^k = 1/n → k = log_{10/9} n

Instead of working directly with logarithms, let’s first compute the sum of the geometric series in the equation.

Step 2: Calculate the Geometric Series Sum

The sum inside the brackets is a finite geometric series with first term a=1, common ratio r=9/10, and k terms. The formula for this sum is:

Sum = (1 - r^k) / (1 - r)

Plugging in r=9/10:

Sum = (1 - (9/10)^k) / (1 - 9/10) = (1 - (9/10)^k) / (1/10) = 10*(1 - (9/10)^k)

Step 3: Substitute Back and Simplify

From earlier, we know (9/10)^k = 1/n. Substitute this into the sum:

Sum = 10*(1 - 1/n)

Multiply by n (from the expanded recurrence) and use T(1) = 0:

T(n) = 0 + n * 10*(1 - 1/n) = 10n*(1 - 1/n) = 10n - 10

Quick Verification

Let’s confirm this formula works with the base case and sample values:

  • For n=1: T(1) = 10*1 -10 = 0 ✔️ (matches the given condition)
  • For n=10/9: T(10/9) = T(1) + 10/9 = 10/9, and 10*(10/9) -10 = 10/9 ✔️
  • For n=(10/9)^2 = 100/81: T(100/81) = T(10/9) + 100/81 = 190/81, and 10*(100/81) -10 = 190/81 ✔️

The closed-form solution is T(n) = 10n - 10.

内容的提问来源于stack exchange,提问作者Soon_to_be_code_master

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:12:46