Hacker News new | past | comments | ask | show | jobs | submit login

Sure, here's one: given a list of n items, compute the sum of pairwise distances between every pair of items.

The first item has distance 1 from the second, 2 from the third, ..., n-1 from the last. Similarly, the second item has distance 1 from the third, 2 from the fourth, ..., n-1 from the last. And so on until the (n-1)-th item.

Expressed as a finite sum, this amounts to:

  sum (sum j, j=1 to n-i), i=1 to n-1
Paste this to Wolphram Alpha and you get the answer in a closed form: http://www.wolframalpha.com/input/?i=sum+%28sum+j%2C+j%3D1+t...



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: