by h0mEDw · 7y ago · 0 comments
1. For x and y you cannot prove that x<=y or x=>y
2. Every function is continuous
Some hand-waving to see why 1. is a problem: given two numbers, x and y, as a lazily-computed infinite decimal expansion, the program that loops in parallel over the expansions and seeks the first difference (to determine which number is greater) will never terminate if x and y have identical expansions.See this submission from two months ago: https://news.ycombinator.com/item?id=18411935
And floats are really a whole other beast than fractions or naturals or real numbers. As I wrote earlier - the "+" operator isn't associative. Python snippet:
def before():
x = 0.0
x += 1.0
for i in xrange(1000):
x += 1e-17
return x
def after():
x = 0.0
for i in xrange(1000):
x += 1e-17
x += 1.0
return x
print before() == 1.0
print after() == 1.0
Will print: True
FalseEdit: for instance, you could imagine a representation (think object of a virtual class in c++) that gives you a fraction and a 1/2^n bound for error, where you can query the number for whatever n you see fit. Still, in some cases it's undecidable to determine which number is greater.