Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Emacs Calc - Npr and NCR functions

11 views
Skip to first unread message

Daniel Dalton

unread,
Jul 20, 2011, 4:47:29 AM7/20/11
to help-gnu-emacs
Hi,

Does anyone know how to access the Npr and Ncr functions with Emacs
calc?

Thanks very much,
Dan

Tassilo Horn

unread,
Jul 20, 2011, 6:54:31 AM7/20/11
to help-gn...@gnu.org
Daniel Dalton <d.da...@iinet.net.au> writes:

Hi Daniel,

> Does anyone know how to access the Npr and Ncr functions with Emacs
> calc?

What are those functions?

Anyway, there are quite a few functions bound to prefix keys. For
example, to list all functions bound to the prefix key `k' (those are
combinatorial functions) by typing

k C-h

in the *Calculator* buffer.

HTH,
Tassilo


Peter Dyballa

unread,
Jul 20, 2011, 9:00:54 AM7/20/11
to Tassilo Horn, help-gn...@gnu.org

Am 20.07.2011 um 12:54 schrieb Tassilo Horn:

>> Does anyone know how to access the Npr and Ncr functions with Emacs
>> calc?
>
> What are those functions?

Combinatorics, Binomial coefficients, permutations, combinations. Some desk or pocket calculators provide such functions.

I think nPr is n!/(n-k)! and nCr is n!/k!(n-k)!...

--
Mit friedvollen Grüßen

Pete

Well begun is half done.
– Optimist.
Half done is well begun.
– Realist.
Half begun is well done.
– Australian.

Alberto Luaces

unread,
Jul 20, 2011, 11:55:57 AM7/20/11
to help-gn...@gnu.org
Peter Dyballa writes:

> Am 20.07.2011 um 12:54 schrieb Tassilo Horn:
>
>>> Does anyone know how to access the Npr and Ncr functions with Emacs
>>> calc?
>>
>> What are those functions?
>
> Combinatorics, Binomial coefficients, permutations, combinations. Some
> desk or pocket calculators provide such functions.
>
> I think nPr is n!/(n-k)! and nCr is n!/k!(n-k)!...
>

Try `k c', `H k c' ...

--
Alberto


Tassilo Horn

unread,
Jul 20, 2011, 10:49:36 AM7/20/11
to Peter Dyballa, help-gn...@gnu.org
Peter Dyballa <Peter_...@Web.DE> writes:

Hi Peter,

>>> Does anyone know how to access the Npr and Ncr functions with Emacs
>>> calc?
>>
>> What are those functions?
>
> Combinatorics, Binomial coefficients, permutations, combinations. Some
> desk or pocket calculators provide such functions.
>
> I think nPr is n!/(n-k)! and nCr is n!/k!(n-k)!...

Ok, so the functions and keys are:

,----[ (info "(calc)Combinatorial Functions") ]
| The `k c' (`calc-choose') [`choose'] command computes the binomial
| coefficient `N'-choose-`M', where `M' is the number on the top of the
| stack and `N' is second-to-top. If both arguments are integers, the
| result is an exact integer. Otherwise, the result is a floating-point
| approximation. The binomial coefficient is defined for all real
| numbers by `N! / M! (N-M)!'.
`----

,----[ (info "(calc)Combinatorial Functions") ]
| The `H k c' (`calc-perm') [`perm'] command computes the
| number-of-permutations function `N! / (N-M)!'.
`----

Bye,
Tassilo

Daniel Dalton

unread,
Jul 21, 2011, 7:45:00 AM7/21/11
to help-gn...@gnu.org
Thank you.

Is it possible to use these from quick calc? (c-x * q)

Thanks very much.

Dan

On Wed, Jul 20, 2011 at 05:55:57PM +0200, Alberto Luaces wrote:
> Peter Dyballa writes:
>
> > Am 20.07.2011 um 12:54 schrieb Tassilo Horn:
> >

> >>> Does anyone know how to access the Npr and Ncr functions with Emacs
> >>> calc?
> >>
> >> What are those functions?
> >
> > Combinatorics, Binomial coefficients, permutations, combinations. Some
> > desk or pocket calculators provide such functions.
> >
> > I think nPr is n!/(n-k)! and nCr is n!/k!(n-k)!...
> >
>

0 new messages