Re: 2button, 1op RPN calculator, again

Stavros Macrakis <[email protected]> Tue, 5 May 2026 13:11:43 -0400
Newsgroups gmane.comp.mathematics.maxima.general
Message-ID <CACLVabWP2uN7v7jcKLGv1M7N8dJ+Vh0qrgW3QjC=bOrU46V5yw@mail.gmail.com>
It has to have some way of entering other inputs if you want to denote
anything but constants. Or maybe you pre-push the inputs onto the stack, in
general multiple instances of them so that they'll be available at the
right place.

On Tue, May 5, 2026 at 12:14 PM Henry Baker <[email protected]> wrote:

> I just realized that this calculator doesn't have any 'regular' buttons at
> all; the only 2 buttons are the parentheses '(' and ')'.
>
> The '(' button pushes '1' onto the stack; the ')' replaces the top 2 elts
> of the stack with the single object eml(x,y), where x,y were the top two
> elements of the stack.
>
> Clearly '(' increments the stack length by 1, while ')' decrements the
> stack length by 1, so we have a *parenthesis language*, and only properly
> paired parentheses are allowed.
>
> The stack comes initialized with a single object '1', because *every*
> legal computation has to start with a push, and the only constant that can
> be pushed onto the stack is a '1', so we needn't bother with that first
> push instruction at all !
>
> The number of legal instruction sequences of length 2n is Catalan(n) =
> binomial(2*n,n)/(n+1).
>
> This means that the fraction of legal instruction sequences approaches
> zero as the length of the sequence grows, so the bit efficiency of ANY
> RPN-type representation isn't going to be particularly good.
>
>
>
> _______________________________________________
> Maxima-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/maxima-discuss
>

_______________________________________________
Maxima-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maxima-discuss