       Re: Combinations

• To: mathgroup at smc.vnet.net
• Subject: [mg30787] Re: [mg30769] Combinations
• From: "Michael" <michael at science.edu>
• Date: Wed, 19 Sep 2001 00:16:26 -0400 (EDT)
• References: <200109100043.UAA00680@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```
> Hello.  I have Mathematica 4.1
>
> In a Program like Excel, or a hand-held calculator, one can return the
> number of combinations and permutations.
>
> However, I can not find an equivalent function in Mathematica.
> For example, Permutations[ ] returns a long list of all the "Actual"
> permutations.
> I am looking for just the final number.
> If there is one, could you include 'how' you found it.  I have looked
> everywhere.
> I know DiscreteMath`Combinatorica` has some stuff in it, but the Help
system
> appears not to explain many of them.
>
> I can write a custom function, but I am curious to find out if this
function
> is built in to Mathematica.
>
> I hope the answer is not to take the Length[ ]  of a rather long list.
>
> TIA.  Dana
>
> (I posted this question a month ago, but it never showed up in the
> newsgroup, or in the archives.
> I hope I am not doing something wrong.)
>

The number of permutations is simply Factorial[n] (n!).  A quick
double-check can be obtained by calling  following function with small
integers to see if you always get True:

verifyP[x_Integer] := Length[Permutations[Range[x]]] == x!

If you want to see how many ways you can take a subset of n items out of a
total of m items, you can use the Binomial function.  For example, how many
different ways can you choose 5 objects from 49?

In:= Binomial[49, 5]
Out= 1906884

Hope this helps.

Michael

```

• References:
• Prev by Date: Possible Mathematica 4.0 bug
• Next by Date: Re: Re: System for which Solve and NSolve both fail