uint64_t x = 0x7ff0000000000000ULL;
printf("%f\n", *(double *)&x);
output: inf
But you could use a representation where 0 is 0, and 1 is infinity, saving 63 bits...First of all, every finite number is computable by definition.
And second, your encodings will, unlike those in the lambda calculus, be completely arbitrary.
PS: in my self-delimiting encoding of the lambda calculus, there are only 1058720968043859 < 2^50 closed lambda terms of size up to 64 [1].
To the sibling comment about arbitrariness, we could use a hybrid where we trade off some bits from IEEE FP to introduce far reaches and also some precision there.. so like, keep 32 bits or 54 bits for IEEE compatibility, then switch to "extended" ranges for e.g. BB numbers, higher alephs, etc..
There was this one system for calculation with infinities that avoided the Hilbert Hotel problem.. can't find it but was called smth like Infinioid or some other play on the name. Would be neat to bolt those on too :)
Edit: "grossone" is the calculus for infinities.. love this work! https://www.theinfinitycomputer.com/
If the number representation is encoded outside the 64 bits then you have removed the 64 bit restriction. Of course it is hard to calculate how many bits of information are required to define the type. But "uint64" is pretty small and just requires our current human context (quite a few more bits of information) to make sense!
People sometimes mistakenly think that numbers or data in computers exist in some meaningful way.
Everything in a computer is a model or record or representation that serves a purpose. All bugs and limits are features.
Every finite integer is computable. We often represent non-integer numbers.
> your encodings will, unlike those in the lambda calculus, be completely arbitrary
Well, they /may/ be completely arbitrary. They may not be. The key is to choose encodings that are useful for the problem domain. Admittedly if the problem domain is "winning at the schoolyard game of saying a bigger number," those encodings may look arbitrary for most other purposes.
But there's actually an intent to my original comment besides being pedantic. The most general way to think of a 64-bit numeric representation is as a list of 2^64 numbers, feeding into a 2^64:1 mux, with the 64-bit string being the select bits of the mux. (Or, equivalently, a 2^64 entry x arbitrary width ROM with one number per entry, with the 64-bit string being the address input of the ROM. Same thing.) The two questions you must answer, then, are (a) which 2^64 numbers are most useful in your problem domain; and (b) are there hardware optimizations to reduce the (ridiculous) scale of the mux/ROM model that are so valuable that you're willing to make compromises on which numbers you select?
Since some commenters pointed out how awfully spammy that website is (which I had failed to notice due to my browser's adblockers), I recently decided to slightly rewrite and expand the article to host it on my newly formed personal blog.
This sort of trick/hack is the reason why theorems in (algorithmic) information theory involve constant factors. For example, we can define an image compressor which outputs a single `1` when given the Lenna test image[0], and otherwise acts exactly like PNG except prefixing its output with a `0`. To decode: a `1` decodes to the Lenna image, and anything starting with `0` gets decoded as PNG without the leading `0`. This gives perfect compression with no loss of quality, when tested on that Lenna image ;)
You likely mean every integer or rational is computable (although not by definition). There are finite real numbers that are not computable, in fact most of them are not.
It just feels really bad faith.
[1] https://www.youtube.com/watch?v=q6Etl4oGL4U&list=PL-R4p-BRL8...
Computing is fundamentally about decoding bit strings as different arbitrary representations that are meaningful to humans.
The explanation for how to interpret the 64 bit string is always outside of the 64 bit string. It's going to be tough to compare how big two explanations are since that's going to depend a lot on what each person considers to be a sufficient explanation.
I'm personally quite rusty on lambda calculus, and from glancing at the author's papers about lambda calculus encodings I suspect it will take a rather large number of bytes to represent an explanation that will make it through my thick skull!
Indeed, if we look at Church's paper, we'd find that the term is 80 symbols written fully, {λt[{{{{{t}(t)}(λh[λf[λn[{{{n}(h)}(f)}(n)]]])}(t)}(t)}(t)]}(λf[λx[{f}({f}(x))]]), or 44 symbols when abbreviated, {λt t(t, (λh λf λn n(h, f, n)), t, t, t)}(λf λx f(f(x))), which aren't too impressive given the alphabet of 11 or 12 symbols.
The course on reading and using lambda calculus is similarly longer than than the actual lambda calculus expression
I made the simplest choices I could that do not waste bits.
> And why use a self-delimiting format in the first place?
Because a lambda term description has many different parts that you need to be able to separate from each other.
> And why encode de Bruijn indices in unary
I tried to answer that in more detail in this previous discussion [1].
[1] >>37584869
That's basically Platonism. I think it's a reasonable position for some things, e.g. Booleans (two-valued logic), natural/integer/rational numbers, tuples, lists, binary trees, etc. I think it's meaningful to talk about, say, the number 2, separately from the way it may be encoded in RAM as a model of e.g. the number of items in a user's shopping cart.
This position gets less reasonable/interesting/useful as we consider data whose properties are more arbitrary and less "natural"; e.g. there's not much point separating the "essence" of an IEEE754 double-precision float from its representation in RAM; or pontificating about the fundamental nature of a InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState[0]
The question in the article is whether lambda calculus is "natural" enough to be usefully Platonic. It's certainly a better candidate than, say, Javascript; although I have a soft spot for combinatory logic (which the author has also created a binary encoding for; although its self-interpreter is slightly larger), and alternatives like concatenative languages, linear combinators (which seem closer to physics), etc.
[0] https://web.archive.org/web/20160818035145/http://www.javafi...
Reminds me of the hilarious and brilliant: http://tom7.org/nand/
It's pretty natural to use de Bruijn indexes, since their meaning is local and their composition matches the language semantics (they have a denotational semantics, which gives expressions an intrinsic meaning). For example, with de Bruijn indices the expression `λ0` is always the identity function. If we tried a different scheme, like "the index of the lambda in the string", then expressions like `λ0` would have no intrinsic meaning; it depends on what "string" they occur in, which requires some concrete notion of "the string", which complicates any interpreter, etc.
Whenever I see an implementation of lambda calculus (or some derivative) which doesn't use de Bruijn indexes, I require some justification to convince me why not :) (There are such justifications, e.g. performance optimisations, use of a host language's naming facilities, etc.; but I've can't think of any reason a self-contained, minimalist approach should avoid them)
> why use a self-delimiting format in the first place?
There are various technical reasons to prefer self-delimiting languages when working in algorithmic information theory. For example, prefix-free (binary) encodings are paths through a (binary) tree, with programs as leaves. This lets us assign well-defined probability measures to the set of all programs (assign 1 to the root node, and divide each node's probability between its (two) children). It's also more natural when programs are executed before they're fully known; e.g. reading one bit at a time on-demand (say, generated by a coin toss)
In Plato's allegory of the cave, this was the true monster casting shadows on the wall.
So I'm confused about what point you think people here are missing. There basically wasn't a point to the article, so people are either adding their own thought-wandering musings (totally appropriate, given the style of the post), or they're responding to the title, which is the only time the author really attempts to actually make a clear point. But the title of the article is flawed, and the author's musings do not adequately address the title. That's fine to point out. Nobody is missing any points.
I'm not sure what a "course on reading and using" has to do with description complexity? In any case, it takes 206 bits to implement a binary lambda calculus interpreter (that's Theorem 1 in http://tromp.github.io/cl/LC.pdf )
PS: I still prefer type 1 unums, due to their fallback to intervals :)
It's sort of a word game, being smart.
000: +0
001: +1 ( denormal: (-1)^0 * 0.5 * 2^(-0+1) )
010: +inf
011: +qnan
100: -0
101: -1 ( denormal: (-1)^1 * 0.5 * 2^(-0+1) )
110: -inf
111: -qnan
=== Floating point crib sheet ===--- Format ---
Sign:exponent:stored explicit mantissa leading bit:mantissa fraction:
binary16 = 1:5:0:10
bfloat16 = 1:8:0:7
TensorFloat = 1:8:0:10
fp24 = 1:7:0:16
binary32 = 1:8:0:23
binary64 = 1:11:0:52
8087 = 1:11:1:67
binary128 = 1:15:0:112
--- Interpretation ---leading bit = (exponent != 0) ? 1 : 0 when implicit (not stored)
bias = 2^(exponent bits - 1) - 1
value = (-1)^sign * 0 when zero
value = (-1)^sign * {{leading bit}}.{{mantissa fraction}}b * 2^(exponent - bias) when normal
value = (-1)^sign * 0.{{mantissa fraction}}b * 2^(-bias+1) when denormal
--- Classification ---
zero = exponent == 0 && mantissa fraction == 0
denormal = exponent == 0 && mantissa fraction != 0
normal = exponent != 0 && exponent != ~0
inf = exponent == ~0 && mantissa fraction == 0
nan = exponent == ~0 && mantissa fraction != 0
snan = nan && msb(mantissa fraction) == 0
qnan = nan && msb(mantissa fraction) == 1
PS: It often takes fewer gates to implement a simpler microcoded microarchitecture than to implement a single hardwired macroarchitecture. Microcoded architectures are theoretically slower than hardwired but this is often not the case in reality because of the costs of gate fanout and extra gates for clock distribution that ameliorate gains of fully specified and decoded in hardware.
https://www.theinfinitycomputer.com/wp-content/uploads/2020/...
If 𐡀-ω is too cheesy, my try would be 0xf090a880e2828900, which is 𐡀 subscript 9.
I was expecting the article to at least mention Kolmogorov complexity, or perhaps the demoscene (there are, surprisingly enough, 8-byte entries there.)
I think if you express your lambda calculus bindings in terms of De Bruijn indices, it might seem less arbitrary, too.
Scott Aaronson's quote in the article provides this constraint:
> Precisely because the Turing machine model is so ancient and fixed, whatever emergent behavior we find in the Busy Beaver game, there can be no suspicion that we “cheated” by changing the model until we got the results we wanted.
Your "each number x is interpreted as n+x" is a clear example of the cheating that makes for an uninteresting scheme.
> This property mirrors a notion of optimality for shortest description lengths, where it’s known as the Invariance theorem:
with the latter linking to https://en.wikipedia.org/wiki/Kolmogorov_complexity#Invarian...
For example, say you're refactoring some code and come across:
def foo(x):
return bar(x)
You decide to simplify this definition to: foo = bar
Congratulations, you've just performed η-reduction! https://en.wikipedia.org/wiki/Lambda_calculus#%CE%B7-reducti...Okay, let's ignore arithmetics and just allow comparison. As you've said, a common practice is to normalize it into some standard notation with a well-founded ordering. But there is no mechanical way to convert (or even bound) a computational representation to such notation---the general approach is therefore to compute a difference and check its sign. Not really good when it can continue even after the heat death of universe...
Frankly speaking, I rather expected to see some improvement over Level-Index number systems [1], but it turns out that this post is completely unrelated to number formats. Otherwise it is good, hence my mild frustration here :S
If you have the time to help me with my understanding then I would appreciate it.
I'm looking at wikipedia's formal definition, which says that for x to be computable, you need to provide a function from naturals to integers such that if you pick a denominator of a fraction (n), this function can give the numerator such that (f(n)-1)/n and (f(n)+1)/n end up straddling the value which is computable.
So, for an integer N, you make f(x) = xN then (f(n)-1)/n = N-(1/n) and (f(n)+1)/n = N+(1/n).
Therefore, for any integer N, it is computable.
Now, what is stopping me from doing something similar with a real?
If I say: f(x) = floor(xN)
Now (f(n)-1)/n = floor(n*N)-(1/n)
It is at this point where I realise I need to go to bed and sleep. If you see this and have the time to explain to me where it falls apart with reals, then I will be most happy. To be clear - I'm quite sure I am wrong, and this isn't me being passive aggressive about it.
I don't really want to get into the nitty gritty, as John will answer emails regarding this stuff. I've personally done so, and he's very polite and informative. I was using them for fractals, but using them in software, which was unfortunately very slow, but the results were amazing. I've read through his papers on them and it took me a while to really 'get it', but I did and oh man, even basic unums put floats to shame. While perhaps not a tremendous upgrade, I much prefer the distribution and accuracy and how there's far less overlap, NaNs, infinities, etc.
The A's are the aleph numbers, just using A instead of 𐡀 because I don't know how to put a subscript on the right side of an 𐡀.
They are the cardinalities of well-ordered infinite sets. Aleph-0 is the cardinality of the natural numbers, aleph-1 is the cardinality of the smallest infinite set that is larger than the natural numbers, and it goes on from there.
I'm very confused that you say posits are "more or less similar" to Binary Lambda Calculus. Posits are an inert data encoding: to interpret a posit as a number, we plug its parts (sign, regime, exponent and fraction) into a simple formula to get a numerical value. Those parts can have varying size (e.g. for soft posits), but the range of results is fundamentally limited by its use of exponentials.
In constrast, BLC is a Turing-complete, general-purpose programming language. To interpret a BLC value as a number, we:
- Parse its binary representation into lambda abstractions (00), function calls (01) and de-Bruijn-indexed variables (encoded in unary)
- Apply the resulting term to the symbol `one-more-than` and the symbol `zero`
- Beta-reduce that expression until it reaches a normal form. There is no way, in general, to figure out if this step will finish or get stuck forever: even if will eventually finish, that could take trillions of years or longer.
- Read the resulting symbols as a unary number, e.g. `one-more-than (one-more-than zero)` is the number two
Posit-style numbers can certainly be represented in BLC, by writing a lambda abstraction that implements the posit formula; but BLC can implement any other computable function, which includes many that grow much faster than the exponentials used in the posit formula (e.g. this has a nice explanation of many truly huge numbers https://www.reddit.com/r/math/comments/283298/how_to_compute... )
> Therefore, for any integer N, it is computable.
> If I say: f(x) = floor(xN)
For many definitions of a real, it's not at all clear whether you can compute this f(x). The ability to compute f already amounts to being able to approximate f arbitrarily well. For example, for Chaitin's number, you cannot compute your f() except for a few small values of N.
I still don't think it has properly clicked, because the function "f(x) = xN" still needs me to know what N is - despite it being an integer.
For example, let's suppose that you manage to have a conversation with God and you discover that BB(100) has the value of 42, and Chaitlin's number is 1/2.
Does Chaitlin's number suddenly become computable? My intuition is that it remains uncomputable, but maybe my intuition is wrong... I guess by the definition, it is computable, but you can't prove it.
I'm also struggling with the reciprocal of BB(100). This is rational, so maybe it too is computable.
I guess I am struggling with the lack of a constructive proof and what that means - it is like we are saying "there exists an algorithm to do X, but the algorithm can't be known", and maybe that is the core of me being wrong - we can prove that such an algorithm exists, and so 1/BB(100) is computable just like BB(100) is computable 0 but every time I write this down, I still can't see how this logic doesn't also break down with actually non-computable numbers. e.g. "There is a function f(x) which returns an integer, I can't tell you what the integer is, but it is the one that results in showing that Chaitlin's number is computable"
Anyway, if you notice this and do reply, then very much thank you - and apologies if your reply goes unread
You wouldn't be able to express BB(100) explicitly. My article is about a lower bound on the much smaller BB(63), and it's already very hard to give a sense of how large that is. Go would of course be able to give you the 100 bit program for it.
> Chaitlin's number is 1/2
We know that Chaitin's number is not computable. So it cannot be 1/2. It has an infinite binary expansion of which we can only ever compute a fixed number of bits.
> I guess by the definition, it is computable
It's not.
> I'm also struggling with the reciprocal of BB(100). This is rational, so maybe it too is computable.
A number x is computable if-and-only-if its reciprocal is. Any fixed integer, like N=BB(100) is computable (with the trivial program print N), and therefore so is its reciprocal. What is not computable is the function BB(.)
> there exists an algorithm to do X
What is X ?
If you want to discuss this further, please just send your reply by email.
An uncomputable number can not be expressed as a finite sequence of digits in any computable base. So Chaitin's constant must consist of an infinite number of digits regardless of what base you choose, so long as the base is computable.
So "God" or an oracle can never actually produce Chaitin's constant in any finite representation, all an oracle can do is behave as a function where you give it an integer N, and it returns the N'th digit of Chaitin's constant.