The result from antibase2 is consistent with residue.

   #.#: i:5
3 4 5 6 7 0 1 2 3 4 5
   (2^3)| i:5
3 4 5 6 7 0 1 2 3 4 5

On Tue, Dec 13, 2011 at 7:32 AM, Dan Bron <j...@bron.us> wrote:

> I'm with you on the desire for simple comparison.  But I can't quite see
> where the trouble arises.
>
> Can you give an example of the difficulty in comparison (or derivation)
> which arises from the negate-the-digits approach?
>
> -Dan
>
> -----Original Message-----
> From: programming-boun...@jsoftware.com
> [mailto:programming-boun...@jsoftware.com] On Behalf Of Marshall Lochbaum
> Sent: Monday, December 12, 2011 7:58 PM
> To: Programming forum
> Subject: Re: [Jprogramming] How #: should have been designed
>
> I suppose my main objection to multiplying the entire base by a sign is
> that it makes it more complicated to assess whether a number can be derived
> from your version of antibase, and thus can be compared directly with
> another via -: . Specifically, your version requires that a number either
> consist of all 0s and 1s or all 0s and _1s; mine just has that digits after
> the first are either 0 or 1.
> However, that test doesn't distinguish between, for example, _1 1 0 0 and
> _1 0 0, so you would additionally have to specify that if the first digit
> is negative, the second cannot have to be zero, and that's just as messy.
> There may be a way around that bit, though.
>
> Marshall
>
> On Mon, Dec 12, 2011 at 7:42 PM, Dan Bron <j...@bron.us> wrote:
>
> > Marshall wrote:
> > >  (negative MSB) version is mathematically more well-founded
> >
> > I am personally not qualified to assess the mathematical virtues of the
> > different formulations.  And I see (more than) enough mathematical
> > horsepower on these Forums to be confident that a sensible conclusion
> will
> > be reached, irrespective of my (mostly uninformed) opinions.  And I'll
> > certainly be comfortable with that conclusion, whatever shape it takes.
> >
> > Plus, your solution is already gaining support, as Henry said:
> >
> > >  I like your leading-digit-negative idea better too.
> >
> > But I'm still a bit reluctant, and the reason is along the lines of
> > something Henry said earlier:
> >
> > >  you can't tell how to interpret a bit-string without
> > >  knowing whether it is signed or unsigned.  You can't
> > >  tell by looking at the bits.
> >
> > That is, sign is an extrinsic quality of a number. Put another way, an
> > integer has two qualities: sign and magnitude*.  So, since the digits of
> a
> > number are reserved for expressing magnitude, I think sign should be
> > carried
> > out-of-band (not cleverly encoded in those bits).
> >
> > Now, in a sense, the negative-MSB approach does use out-of-band
> > information.
> > In particular, the "negativity" of the MSB is out-of-band information,
> that
> > couldn't be carried in a true digit.  That said, it has two drawbacks:
> >
> >        1.  It singles out the MSB as "special".  If one argues
> >          "Hey, the MSB _is_ special: did you see that 'M' in
> >           there?", my counterargument would be "well, yes,
> >           but that M-ness is already encoded in the bit's
> >           position, which is the correct -and only- way to
> >           do it".
> >
> >        2.  It introduces a new order-of-magnitude, which wasn't
> >          there before.  That is, in order to address a value
> >          on order r^N, we all of a sudden had to talk about
> >          values on the order of r^N+1 .  Feels like a
> >          non-sequitor.
> >
> > Now, (1) is a fundamental aspect of the negative-MSB approach, but if
> > Henry's right when he says:
> >
> > >  Rather than prepending a leading _1, you could just change
> > >  the high-order 1 to _1 .
> >
> > then (2) is just an aspect of a particular formulation.  And actually,
> the
> > critical issue (3) from my earlier message goes away too (i.e. the sign
> of
> > a
> > value is unrelated to the number of its digits).  But either I
> > misunderstand
> > him, or I can't get it to work:
> >
> >           #: 5
> >        1 0 1
> >           #.  _1 0 1  NB.  negate MSB, but don't change length of vector
> >        _3
> >
> > But anyway, even if this, or something like it, worked, it would still
> > offend my formed-in-first-grade arithmetical sensibilities.  It just
> > doesn't
> > seem right for a numeric notation to say "First, you start really low,
> then
> > you add values in bits and pieces, til you get closer (but never all the
> > way) to zero".
> >
> > -Dan
> >
> > *  Or I guess you could say a real number has a quality and a quantity.
> >
> >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to