Re: Formatting Question
- To: mathgroup at smc.vnet.net
- Subject: [mg118981] Re: Formatting Question
- From: Murray Eisenberg <murray at math.umass.edu>
- Date: Wed, 18 May 2011 07:18:04 -0400 (EDT)
Of course such output is possible. But that kind of output is very "retrograde". The sort of thing one saw while using a teletype machine for input. On 5/17/2011 7:46 AM, Dean Rosenthal wrote: > Hello Mathgroup: > > Quick formatting question for my little program: > > Table[Print["Number of combinations of ", n, " choose ", k, " = ", > Binomial[n, k]], {n, 4}, {k, n}]; Table[ > Print["Combinations of ", n, " choose ", k, " = ", > Subsets[Range[n], {k}]], {n, 4}, {k, n}]; > Table[Print["Permutations of combinations of ", n, " choose ", k, " = ", > Permutations[Range[n], {k}]], {n, 4}, {k, n}]; > > -- > > Is it possible to give the output like this, in this order: > > > Number of combinations of 1 choose 1 = 1 > > Combinations of 1 choose 1 = {{1}} > > Permutations of combinations of 1 choose 1 = {{1}} > > > Number of combinations of 2 choose 1 = 2 > > Combinations of 2 choose 1 = {{1}, {2}} > > Permutations of combinations of 2 choose 1 = {{1}, {2}} > > > etc. > > > Also, how is it possible to count the number of permutations, for example? > As the counts of combinations grow, the number of permutations and > resulting combinations grow. > > > Thanks! > > > Dean > -- Murray Eisenberg murray at 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