(In reply to
re: Solution by SilverKnight)
Ok, here is the program I used. It is written in Ruby (www.ruby-lang.org).
It doesn't print out the solution as points but rather as ranges in which to place the points.
To answer you second questions: Either the algorithm I used is flawed or there simply isn't any solution with more than 17 points. I'm personally in favour of the latter hypothesis, but feel free to prove me wrong ;)
require 'rational'
class Rational
def inspect
"%d/%d" % [@numerator, @denominator]
end
end
def rec(ranges, solution)
level = ranges.size
if level == 1
p ranges + solution
throw :found
end
step = Rational(1, level)
right = 0
ranges.map! do |range|
left = right
right += step
return if left >= range.end || right <= range.begin
([left, range.begin].max)..([right, range.end].min)
end
next_ranges = []
until ranges.empty?
cur_range = ranges.shift
rec(next_ranges + ranges, [cur_range] + solution)
next_ranges << cur_range
end
end
for level in 2..18
printf \"Level: %d\n\", level
catch :found do
rec([Rational(0, 1)..Rational(1, 1)] * level, [])
end
end