Computing Distances: Evaluating Sums in Polynomials

  • Context: Graduate 
  • Thread starter Thread starter drago
  • Start date Start date
  • Tags Tags
    Computing
Click For Summary

Discussion Overview

The discussion revolves around evaluating sums of squared differences between two polynomials at specified points. Participants explore the possibility of expressing these sums, denoted as Sk, in terms of previous sums Sk-1, with a focus on reducing computational complexity from O(n) to constant time.

Discussion Character

  • Exploratory
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant, drago, presents a problem involving the evaluation of sums S0, S1, ..., Sn-1 based on the differences between two polynomials Y(x) and Q(x) at n consecutive points.
  • Another participant questions the correctness of the indices used in the expressions for the sums.
  • Drago defends the indexing and explains that the sums represent a rightward shift of the polynomial Y(x) while comparing it to Q(x), suggesting a potential misunderstanding of the notation.
  • Drago later expresses doubt about the feasibility of computing all sums in less than O(n^2) time, indicating a shift in perspective on the problem's complexity.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the computational complexity of the sums or the correctness of the indexing in the expressions. Disagreement exists regarding the feasibility of reducing the time complexity.

Contextual Notes

There are unresolved assumptions regarding the definitions of the polynomials and the specific conditions under which the sums are evaluated. The discussion does not clarify the implications of shifting the polynomial segments on the overall computation.

drago
Messages
5
Reaction score
0
Hi,
I would appreciate if you could point me some resources that you have seen and think could be related to the following problem:

Given are the values of two polynomials Y(x) and Q(x) in n consecutive points (x0, x1,…, xn-1): (y0, y1,…,yn-1) and (q0, q1,…,qn-1) respectively.
We would like to evaluate the following sums:

S0 = (y0 – q0)^2 + (y1 – q1)^2 + …. + (yn-1 – qn-1)^2
S1 = (y0 – q1)^2 + (y1 – q2)^2 + …. + (yn-2 – qn-1)^2
S2 = (y0 – q2)^2 + (y1 – q3)^2 + …. + (yn-3 – qn-1)^2
….
Sn-1 = (y0 – qn-1)^2

Now, the question is, can I represent Sk as function of Sk-1? The point is, that I can evaluate Sk from the above representation, but this would have linear time complexity O(n), and there should be some way for this to be done in constant time, once we know S0 through Sk-1.

Thank you

drago
 
Physics news on Phys.org
are you sure your indices are correct on the last terms of your expressions, Sj?
 
Yes, they are. That is as if we shift right the y segment one point at a time and compute the sum of the distances between the new segments leaving out the leftmost point of q and rigthmost point of y:

for S0 : (q0, q1, ..., qn-1)
(y0, y1, ..., yn-1)

for S1: (q0, q1,..., qn-1)
(y0, y1,..., yn-2, yn-1) //y shifted right
...
for Sn-1: (q0, q1,..., qn-1)
(y0, ..., yn-1)

Well, the more I think about this, the more it seems to me that computing all of the sums cannot be done in less than O(n^2) time.

Thank you anyway!

drago
 
Sorry, the example should be like that:

for S1:
(q1, ..., qn-1)
(y0,..., yn-2) //y shifted rigth and compared with the remaining of q

...
for Sn-1:
(qn-1)
(y0) //y after the n-1st shift

drago
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K