3 ms·
Interesting. I would have thought that one could solve such things exactly by representing each unique known irrational that arises (root 2, pi, etc) by its own
by tehwalrus 13y ago
Interesting. I would have thought that one could solve such things exactly by representing each unique known irrational that arises (root 2, pi, etc) by its own rational multiplier, and then overloading the relevant equality checks. Of course, you'd need to anticipate/implement each irrational type that might arise (roots, the geometric transcendental pi, and so on.)
[Leaving the next sentence in, for comedy value. I typed it and then realised how ridiculous it is - apologies!]
Essentially it's just teaching the computer to do the algebra for you, isn't it?
- lmm 13y agoHow would you test whether two generic irrational numbers were equal? Obviously you can numerically approximate them and if you see any difference in the numerical approximation then they must be different - but if they seem the same up to e.g. 10 decimal places, what do you do next?
- tehwalrus 13y agoI would generally assume that sqrts of primes don't overlap, so you can always do exact comparisons of rational coefficients? It wouldn't be perfect, but it would do as well as a person with pen and paper and a hundred years. [[ Approximate algorithm, in case I'm not being clear: you need sqrt(35), represent it as 1×sqrt(5) × 1×sqrt(7). You simplify each expression evaluated down to roughly what you'd write on paper in RAM, and then you do exact comparisons - is that the same coefficients of the same number of the same prime sqrts? For greater than/less than you cast them to a hundred-sig-fig float, and if those are still equal, keep going down the rabbit hole. Obviously the RAM requirements for complicated numbers would be large, but that's the same with rationals - this is just taking it to the extreme. I'd be very surprised if some function of sqrts was exactly the same as some other function of different sqrts. ]]
- lmm 13y agoSines of certain fractions of pi are equal to certain ratios of square roots though. And once you get to more complicated functions it's very hard to prove anything (e.g. I believe it's still not even proven that pi^e is irrational, never mind transcendental). Could we construct a countable field (for to be able to write down the numbers involved the field would have to be countable, i.e. only an infinitesimal fraction of the reals) that contained everything we need to do this kind of geometry in? Maybe. But I can just as easily believe you could construct a way of arranging objects that required a turing-complete computation to determine whether two objects met, in which case the halting problem makes this impossible.