Hi everyone,(adsbygoogle = window.adsbygoogle || []).push({});

I have the following recurrence to represent in terms of n:

Basically, it is an analysis of following code:Code (Text):

n-1 n j

Sigma Sigma Sigma(c1) =...

i =1 j = i+1 k=1

So, I came up with summations but not sure how to switch to n.Code (Text):

for(i = 1 to n -1)

for(j = i+1 to n)

for(k = 1 to j)

something of O(1)

So far I have following:

Second part resulted in c1[n(n-1) - [n(n+1)]/2 - (n-1)]; but I am stuck on the first part. Should I regard j = i + 1 as some constant?Code (Text):

n-1 n n-1 n n-1 n

Sigma Sigma (c1)(j-1) = c1 Sigma Sigma j - c1 Sigma Sigma 1;

i=1 j=i+1 i=1 j=i+1 i=1 j=i+1

Thanks a lot.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Help with summations code

**Physics Forums | Science Articles, Homework Help, Discussion**