Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

I'm currently studying recurrences for divide and conquer algorithms (CLRS chapter 4) and I am struggling to understand a slight change that was made to the latest (4th) edition of the book.

The recurrence relation is defined T(n) = a*T(n/b) + f(n), which resolves to the following:

T(n) = Θ(n^log(a, b) + ∑j=0→log(n,b): a^j * f(n/b^j)

CLRS Ch. 4 Recursion Tree Solution

In the previous version of the book and a lot of places I see online, the limit to the summation is instead log(n,b)-1, which makes sense since you only include the combine cost f(n) for every level except the last. But now the sum just log(n,b), which considering j starts at 0 and ends at log(n,b), means f(n) is included for all levels including leaves. The definition of a tree's height was also changed to be log(n,b) + 1 (which includes the root) whereas it used to be just log(n,b).

Can somebody explain why these changes were made? I must be misunderstanding something here.

For instance, for a binary tree with just 2 elements with recurrence defined as T(1) = c1 and T(n) = 2T(n/2) + n(c2):

where c1 and c2 are constants, I get T(2) = 2(c1) + 2(c2). If I use the solution formula, I get T(2) = 2(c1) + 4(c2) because of the extra sum so the math does not match.

My work shown here

I'm currently studying recurrences for divide and conquer algorithms (CLRS chapter 4) and I am struggling to understand a slight change that was made to the latest (4th) edition of the book.

The recurrence relation is defined T(n) = a*T(n/b) + f(n), which resolves to the following:

T(n) = Θ(n^log(a, b) + ∑j=0→log(n,b): a^j * f(n/b^j)

CLRS Ch. 4 Recursion Tree Solution

In the previous version of the book and a lot of places I see online, the limit to is instead log(n,b)-1, which makes sense since you only include the combine cost f(n) for every level except the last. But now the sum just log(n,b), which considering j starts at 0 and ends at log(n,b), means f(n) is included for all levels including leaves. The definition of a tree's height was also changed to be log(n,b) + 1 (which includes the root) whereas it used to be just log(n,b).

Can somebody explain why these changes were made? I must be misunderstanding something here.

For instance, for a binary tree with just 2 elements with recurrence defined as T(1) = c1 and T(n) = 2T(n/2) + n(c2) where c1 and c2 are constants, I get T(2) = 2(c1) + 2(c2). If I use the solution formula, I get T(2) = 2(c1) + 4(c2) because of the extra sum so the math does not match.

My work shown here

I'm currently studying recurrences for divide and conquer algorithms (CLRS chapter 4) and I am struggling to understand a slight change that was made to the latest (4th) edition of the book.

The recurrence relation is defined , which resolves to the following:

CLRS Ch. 4 Recursion Tree Solution

In the previous version of the book and a lot of places I see online, the limit to the summation is instead , which makes sense since you only include the combine cost for every level except the last. But now the sum just , which considering starts at 0 and ends at , means is included for all levels including leaves. The definition of a tree's height was also changed to be (which includes the root) whereas it used to be just .

Can somebody explain why these changes were made? I must be misunderstanding something here.

For instance, for a binary tree with just 2 elements with recurrence defined as:

where are constants, I get . If I use the solution formula, I get because of the extra sum so the math does not match.

My work shown here

deleted 10 characters in body
Source Link

I'm currently studying recurrences for divide and conquer algorithms (CLRS chapter 4) and I am struggling to understand a slight change that was made to the latest (4th) edition of the book.

The recurrence relation is defined T(n) = a*T(n/b) + f(n), which resolves to the following:

T(n) = Θ(n^log(a, b) + ∑j=0→log(n,b): a^j * f(n/b^j)

CLRS Ch. 4 Recursion Tree Solution

In the previous version of the book and a lot of places I see online, the limit to ∑ is instead log(n,b)-1, which makes sense since you only include the combine cost f(n) for every level except the last. But now the sum just log(n,b), which considering j starts at 0 and ends at log(n,b), which means f(n) is included for all levels, including leaves. He also changed the The definition of a tree's height was also changed to be log(n,b) + 1 (which now includes the root) whereas it used to be just log(n,b).

Can somebody explain why these changes were made? I must be misunderstanding something here.

For instance, for a binary tree with just 2 elements with recurrence defined as T(1) = c1 and T(n) = 2T(n/2) + n(c2) where c1 and c2 are constants, I get T(2) = 2(c1) + 2(c2). If I use the solution formula, I get T(2) = 2(c1) + 4(c2) because of the extra sum so the math does not match.

My work shown here

I'm currently studying recurrences for divide and conquer algorithms (CLRS chapter 4) and I am struggling to understand a slight change that was made to the latest (4th) edition of the book.

The recurrence relation is defined T(n) = a*T(n/b) + f(n), which resolves to the following:

T(n) = Θ(n^log(a, b) + ∑j=0→log(n,b): a^j * f(n/b^j)

CLRS Ch. 4 Recursion Tree Solution

In the previous version of the book and a lot of places I see online, the limit to ∑ is instead log(n,b)-1, which makes sense since you only include the combine cost f(n) for every level except the last. But now the sum just log(n,b), which considering j starts at 0 and ends at log(n,b), which means f(n) is included for all levels, including leaves. He also changed the definition of a tree's height to be log(n,b) + 1 (which now includes the root) whereas it used to be just log(n,b).

Can somebody explain why these changes were made? I must be misunderstanding something here.

For instance, for a binary tree with just 2 elements with recurrence defined as T(1) = c1 and T(n) = 2T(n/2) + n(c2) where c1 and c2 are constants, I get T(2) = 2(c1) + 2(c2). If I use the solution formula, I get T(2) = 2(c1) + 4(c2) because of the extra sum so the math does not match.

My work shown here

I'm currently studying recurrences for divide and conquer algorithms (CLRS chapter 4) and I am struggling to understand a slight change that was made to the latest (4th) edition of the book.

The recurrence relation is defined T(n) = a*T(n/b) + f(n), which resolves to the following:

T(n) = Θ(n^log(a, b) + ∑j=0→log(n,b): a^j * f(n/b^j)

CLRS Ch. 4 Recursion Tree Solution

In the previous version of the book and a lot of places I see online, the limit to ∑ is instead log(n,b)-1, which makes sense since you only include the combine cost f(n) for every level except the last. But now the sum just log(n,b), which considering j starts at 0 and ends at log(n,b), means f(n) is included for all levels including leaves. The definition of a tree's height was also changed to be log(n,b) + 1 (which includes the root) whereas it used to be just log(n,b).

Can somebody explain why these changes were made? I must be misunderstanding something here.

For instance, for a binary tree with just 2 elements with recurrence defined as T(1) = c1 and T(n) = 2T(n/2) + n(c2) where c1 and c2 are constants, I get T(2) = 2(c1) + 2(c2). If I use the solution formula, I get T(2) = 2(c1) + 4(c2) because of the extra sum so the math does not match.

My work shown here

edited body
Source Link

I'm currently studying recurrences for divide and conquer algorithms (CLRS chapter 4) and I am struggling to understand a slight change that was made to the latest (4th) edition of the book.

The recurrence relation is defined T(n) = a*T(n/b) + f(n), which resolves to the following:

T(n) = Θ(n^log(a, b) + ∑j=0→log(n,b): a^j * f(n/b^j)

CLRS Ch. 4 Recursion Tree Solution

In the previous version of the book and a lot of places I see online, the limit to ∑ is instead log(n,b)-1, which makes sense since you only include the combine cost f(n) for every level except the last. But now the sum just log(n,2b), which considering j starts at 0 and ends at log(n,2b), which means f(n) is included for all levels, including leaves. He also changed the definition of a tree's height to be log(n,b) + 1 (which now includes the root) whereas it used to be just log(n,b).

Can somebody explain why these changes were made? I must be misunderstanding something here.

For instance, for a binary tree with just 2 elements with recurrence defined as T(1) = c1 and T(n) = 2T(n/2) + n(c2) where c1 and c2 are constants, I get T(2) = 2(c1) + 2(c2). If I use the solution formula, I get T(2) = 2(c1) + 4(c2) because of the extra sum so the math does not match.

My work shown here

I'm currently studying recurrences for divide and conquer algorithms (CLRS chapter 4) and I am struggling to understand a slight change that was made to the latest (4th) edition of the book.

The recurrence relation is defined T(n) = a*T(n/b) + f(n), which resolves to the following:

T(n) = Θ(n^log(a, b) + ∑j=0→log(n,b): a^j * f(n/b^j)

CLRS Ch. 4 Recursion Tree Solution

In the previous version of the book and a lot of places I see online, the limit to ∑ is instead log(n,b)-1, which makes sense since you only include the combine cost f(n) for every level except the last. But now the sum just log(n,2), which considering j starts at 0 and ends at log(n,2), which means f(n) is included for all levels, including leaves. He also changed the definition of a tree's height to be log(n,b) + 1 (which now includes the root) whereas it used to be just log(n,b).

Can somebody explain why these changes were made? I must be misunderstanding something here.

For instance, for a binary tree with just 2 elements with recurrence defined as T(1) = c1 and T(n) = 2T(n/2) + n(c2) where c1 and c2 are constants, I get T(2) = 2(c1) + 2(c2). If I use the solution formula, I get T(2) = 2(c1) + 4(c2) because of the extra sum so the math does not match.

My work shown here

I'm currently studying recurrences for divide and conquer algorithms (CLRS chapter 4) and I am struggling to understand a slight change that was made to the latest (4th) edition of the book.

The recurrence relation is defined T(n) = a*T(n/b) + f(n), which resolves to the following:

T(n) = Θ(n^log(a, b) + ∑j=0→log(n,b): a^j * f(n/b^j)

CLRS Ch. 4 Recursion Tree Solution

In the previous version of the book and a lot of places I see online, the limit to ∑ is instead log(n,b)-1, which makes sense since you only include the combine cost f(n) for every level except the last. But now the sum just log(n,b), which considering j starts at 0 and ends at log(n,b), which means f(n) is included for all levels, including leaves. He also changed the definition of a tree's height to be log(n,b) + 1 (which now includes the root) whereas it used to be just log(n,b).

Can somebody explain why these changes were made? I must be misunderstanding something here.

For instance, for a binary tree with just 2 elements with recurrence defined as T(1) = c1 and T(n) = 2T(n/2) + n(c2) where c1 and c2 are constants, I get T(2) = 2(c1) + 2(c2). If I use the solution formula, I get T(2) = 2(c1) + 4(c2) because of the extra sum so the math does not match.

My work shown here

added 74 characters in body
Source Link
Loading
Source Link
Loading

AltStyle によって変換されたページ (->オリジナル) /