MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Formatting Question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg118941] Formatting Question
  • From: Dean Rosenthal <deanrosenthal at gmail.com>
  • Date: Tue, 17 May 2011 07:46:04 -0400 (EDT)

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

-- 
Dean Rosenthal

cell: 646 733 6966
www.deanrosenthal.org
www.the-open-space.org


  • Prev by Date: Re: doesn't work
  • Next by Date: Re: Plot image changes size during animation
  • Previous by thread: Re: doesn't work
  • Next by thread: Re: Formatting Question