• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Math/Geometry brain teaser

 
Bartender
Posts: 1205
22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're given a random number of points randomly distributed along a line. Where is the point that minimizes the sum of the distances to the original points?

Don't provide the mathematical formula that yields the answer, but rather describe the location qualitatively.

How did you arrive at the answer?

Ryan
 
blacksmith
Posts: 1332
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hm ... seems to me half the time the answer is nonunique.
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any point on the line that has the same number of points to its right as the nubmer of points to its left.

You pair the points from the most left and most right, the second left and second right, ..., and you measure the sum of the distances of your chosen point to each pair, then you see this.
 
Ryan McGuire
Bartender
Posts: 1205
22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jerry Young:
Any point on the line that has the same number of points to its right as the nubmer of points to its left.

You pair the points from the most left and most right, the second left and second right, ..., and you measure the sum of the distances of your chosen point to each pair, then you see this.



Bing bing bing, we have a winner.

Originally posted by Warren Dew:
Hm ... seems to me half the time the answer is nonunique.



True. If there are initially an even number of "random" points, then anywhere on the line segment between the two middle points will satisfy the "minimum total distance" condition.

Ryan
 
Ranch Hand
Posts: 171
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the probability distribution of the points? There is no such thing as a uniform distribution of n points on an infinite line.

Geoffrey
 
Ryan McGuire
Bartender
Posts: 1205
22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Geoffrey Falk:
What is the probability distribution of the points? There is no such thing as a uniform distribution of n points on an infinite line.

Geoffrey



Point taken. Let's edit the problem so that first line is, "You're given a random number of points randomly distributed along a line segment."

Ryan
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic