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

Here is a nice challenge: Just like we have arbitrary precision integers (allocating more memory as needed) and arbitrary precision "fractional numbers", design a library providing arbitrary precision "computable numbers".



An obvious representation is a convergent stream of fractions. This will also quickly drive home why you cannot implement equality.

The other obvious representation is that of first order formulae over the theory of real fields, but then you need to check equivalence of arbitrary formulae. You ultimately need a limit operation to be included and now you're sunk. You'll also probably wish you were implementing the complex numbers instead pretty quickly.


> design a library providing arbitrary precision "computable numbers"

I believe they call those "programming languages"


Naive question:

Programs written in programming languages aren't guaranteed to terminate. Computable numbers, however, are all real numbers that can be represented to arbitrary precision by a computation that terminates. Wouldn't that mean we don't need a fully fledged programming language to have the capability to represent all computable numbers?

Somewhere in there is the idea we just need a program that determines whether an arbitrary program terminates or not...


I can't tell how much of this is a joke, but, yes, it turns out you can't write such a programming language for exactly the reason you allude to: you can't tell whether a given number is computable in finite time, as you don't know whether your program will terminate.


This is a neat idea! Although I'd imagine that it'd quickly approach the power of a full computer algebra system.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: