Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2010

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

Search the Archive

Re: Arrangements

  • To: mathgroup at
  • Subject: [mg108911] Re: Arrangements
  • From: Bob Hanlon <hanlonr at>
  • Date: Tue, 6 Apr 2010 08:43:46 -0400 (EDT)
  • Reply-to: hanlonr at

lst = Table[{"A", "B"}, {8}] // Flatten


p = Permutations[lst];

Length[p] == Binomial[16, 8]


There are no duplicates

Length[Union[p]] == Length[p]


p[[RandomInteger[{1, Length[p]}]]]


Bob Hanlon

---- John <jwa0 at> wrote: 

Google 6, Windows-Xp

The number of different arrangements of sixteen symbols -- eight
letters A and eight letters B -- is Binomial[16,8]=12870. Is there a
command that will generate all 12870 arrangements one at a time
without duplication? Any order is acceptable.

I used RandomSample[Range[16]] to select a random permutation of
sixteen different symbols. Assigning the letter A to the first eight
numbers in the random permutation and the letter B to the last eight
letters in the permutation created a randomly selected arrangement.
Awkward, but it works because Binomial[2n,n](n!)(n!)=(2n)!).


  • Prev by Date: Re: Integration error
  • Next by Date: Simplifying multiple expressions
  • Previous by thread: Re: Arrangements
  • Next by thread: Re: Arrangements