Re: What´s the algorithm that compresses a 20 digit big int, into 8 bytes ?

From: Sampo Syreeni <decoy_at_iki.fi>
Date: Fri, 9 Apr 2010 18:17:57 -0700 (PDT)
Message-ID: <b989c530-0a44-4d3a-898d-1b8cb2c62fa4_at_12g2000yqi.googlegroups.com>


On Apr 9, 6:09 pm, Rafael Anschau <rafael.ansc..._at_gmail.com> wrote:

> Any proof of that, or is it just another hypothesis ? My intuition
> tells me this is true, but I would like to see a proof of that.

The simplest, most efficient proof would be to count to the maximum number in each base before the nearmost forbidden digit switches from 0 to 1. Then compare. Do tack each of the individual numbers on paper, so that you don't forget one of them. Also mail me your notes so that I can doublecheck. There might be a publication there after all, if the count doesn't come up right, so you'd be helped by some peer review if that should happen.

More seriously, there are tons of proofs for this sort of thing. The simplest fully general ones rely on the fact that the exponentiality of any pure place notation translates into additivity in place under a logarithm and behaves monotonously in between in any basis (even a fractional one). That lets you compute relative amounts of digits and the relative remainder by the division algorithm, evenwhile you're really comparing ranges of number systems. Had I done it in that domain, I could have said you lacked a fractional number of bits; and in certain cases that would have made practical sense as well (cf. e.g. arithmetic coding).

No, that's not a proof. It's a high level sketch to one and a pointer to further math, which is all that you would get even from a real mathematician. The point being, if you have to ask that sort of thing, then a) you're avoiding your homework, so we're not going to help you with that, b) you're heckling, so we're not going to entertain you, or c) you really need help, in which case a high level hint helps you help yourself *much* better than outright telling you the answer.

Then, how precisely was your question relevant to database theory? Do you perhaps think your ongoing counts are going wrong because predicate logic is somehow flawed, and that might then affect database practice as well? Maybe you just wanted to probe us folks with an IQ test to see if we're worthy of your attention. Oh, maybe I've encountered my first real troll, reeling the wire in by the written line. How quint.

Whatever the case, stop it and return to the subject of the group or be killfiled: database theory. Preferably the relational kind.

--
Sampo
Received on Sat Apr 10 2010 - 03:17:57 CEST

Original text of this message