From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: Emacs Calc - Npr and NCR functions Date: Wed, 20 Jul 2011 16:49:36 +0200 Message-ID: <87ei1lknwf.fsf@tsdh.uni-koblenz.de> References: <20110720084729.GA13679@gwsc.vic.edu.au> <87ipqxkys8.fsf@tsdh.uni-koblenz.de> <8A6A663F-52C9-4D8D-AE7A-24294B3D5847@Web.DE> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1311224525 8074 80.91.229.12 (21 Jul 2011 05:02:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 21 Jul 2011 05:02:05 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Peter Dyballa Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 21 07:02:00 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QjlOY-00073F-E5 for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Jul 2011 07:01:58 +0200 Original-Received: from localhost ([::1]:57104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjlOY-0004cy-0c for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Jul 2011 01:01:58 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:44064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjY5n-0003OW-Oe for help-gnu-emacs@gnu.org; Wed, 20 Jul 2011 10:49:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjY5l-0006h0-1i for help-gnu-emacs@gnu.org; Wed, 20 Jul 2011 10:49:43 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:33314) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjY5k-0006ga-Nf for help-gnu-emacs@gnu.org; Wed, 20 Jul 2011 10:49:40 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 89A04D22DF; Wed, 20 Jul 2011 16:49:38 +0200 (CEST) X-Virus-Scanned: amavisd-new at uni-koblenz.de Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LfuNr0yJMT6O; Wed, 20 Jul 2011 16:49:38 +0200 (CEST) X-CHKRCPT: Envelopesender noch tassilo@member.fsf.org Original-Received: from tsdh.uni-koblenz.de (tsdh.uni-koblenz.de [141.26.67.142]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 4955FD22DC; Wed, 20 Jul 2011 16:49:37 +0200 (CEST) In-Reply-To: <8A6A663F-52C9-4D8D-AE7A-24294B3D5847@Web.DE> (Peter Dyballa's message of "Wed, 20 Jul 2011 15:00:54 +0200") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 141.26.64.15 X-Mailman-Approved-At: Thu, 21 Jul 2011 01:01:51 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81707 Peter Dyballa 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