Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #2412
| From | Murray Eisenberg <murray@math.umass.edu> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Combinations and Counting |
| Date | 2011-05-16 07:34 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <iqqk2d$286$1@smc.vnet.net> (permalink) |
You say you want a program that "counted" the combinations, but then you
seem to be suggesting that you really want the actual subsets. Which?
If the former -- just the count -- then no "program" in the usual sense
of the word is required. Just formation of a table:
Table[Binomial[n, k], {n, 1, 20}, {k, 1, n}] // TableForm
And if you want to see the corresponding {n,k} values:
Table[{{n, k}, Binomial[n, k]}, {n, 1, 20}, {k, 1, n}] // TableForm
On 5/15/2011 7:05 AM, Dean Rosenthal wrote:
> What might be the most efficient way to write a little program that counted
> combinations in the following way:
>
> 1 choose 1, 2 choose 1, 2 choose 2, 3 choose 1, 3 choose 2, 3 choose 3, 4
> choose 1, 4 choose 2, 4 choose 3 ... continuing the pattern ...
>
> So that I would be able to derive each subset in that order? Invoking
> "subsets" in the most rudimentary way *almost* gets me there, but I would
> like to see the output of this series of combinations in this special order,
> in column form, and be able to carry out my search much further.
>
> Suggestions?
>
> Thanks!
>
> DR
--
Murray Eisenberg murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Combinations and Counting Murray Eisenberg <murray@math.umass.edu> - 2011-05-16 07:34 +0000
csiph-web