What is the Role of J in this Summation Problem?

  • Thread starter Thread starter EvLer
  • Start date Start date
  • Tags Tags
    Summation
Click For Summary

Homework Help Overview

The discussion revolves around understanding the role of the variable j in a nested summation problem related to algorithmic complexity. The context involves analyzing a code snippet that includes multiple summations and how they relate to the variable j.

Discussion Character

  • Exploratory, Mathematical reasoning, Problem interpretation

Approaches and Questions Raised

  • Participants are attempting to express the summation in terms of n while questioning the necessity of j in the expression. There are discussions about breaking down the sums and substituting j with its definition.

Discussion Status

Some participants have provided guidance on substituting j with its definition to simplify the expression. However, there is still uncertainty about fully eliminating j from the analysis, indicating an ongoing exploration of the problem.

Contextual Notes

Participants are grappling with the implications of the variable j and its impact on the overall summation, while also adhering to the constraints of expressing the solution in terms of n.

EvLer
Messages
454
Reaction score
0
Hello, I really trying to understand what is going on with these summations.
the code is following:
Code:
for p = 2 to n
    for i = 1 to n - p + 1
        j = i + p -1
        for k = i to j - 1
           O(1) + O(1)
Does j enter anywhere here besides the upper bound of the inner-most summation?
Here is what I have so far
Code:
    n     n-p+1    j-1
  Sigma  Sigma    Sigma(C) = Sigma  (C) Sigma (j-1-i) = ...
   p=2    i=1      k=i

then I break up the double sums on sums of j, -1, and i.
In the course of my attempt to solve this thing, I cannot get rid of j, while the expression is supposed to be in terms of n.
How do I get around it?

Thanks a lot.
 
Physics news on Phys.org
EvLer said:
Hello, I really trying to understand what is going on with these summations.
the code is following:
Code:
for p = 2 to n
    for i = 1 to n - p + 1
        j = i + p -1
        for k = i to j - 1
           O(1) + O(1)

 In the course of my attempt to solve this thing, I cannot get rid of j, while the expression is supposed to be in terms of n.
How do I get around it?

.[/QUOTE]

You seem to forget about the third line, j=i+p-1. 

ehild
 
Even with that, I still have j and cannot get rid of it!
 
You have [tex]\sum_{p=2}^{n}\sum_{i=1}^{n-p+1}\sum_{k=i}^{j-1}C[/tex] right?

Stick in j=i+p-1, which is assigned before your 3rd loop, and you get:

[tex]\sum_{p=2}^{n}\sum_{i=1}^{n-p+1}\sum_{k=i}^{i+p-2}C[/tex]

No more j.
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 21 ·
Replies
21
Views
2K
Replies
12
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 10 ·
Replies
10
Views
4K
Replies
5
Views
4K
  • · Replies 12 ·
Replies
12
Views
3K