Re: Arrangements
- To: mathgroup at smc.vnet.net
- Subject: [mg108910] Re: Arrangements
- From: dh <dh at metrohm.com>
- Date: Tue, 6 Apr 2010 08:21:35 -0400 (EDT)
- References: <hpf5iu$orh$1@smc.vnet.net>
On 06.04.2010 13:23, John 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)!). > > John > Hi John, you may create all arrangements in one go by: Needs ["Combinatorica`"]; t = DistinctPermutations[Join[Table["a", {8}], Table["b", {8}]]]; cheers, Daniel -- Daniel Huber Metrohm Ltd. Oberdorfstr. 68 CH-9100 Herisau Tel. +41 71 353 8585, Fax +41 71 353 8907 E-Mail:<mailto:dh at metrohm.com> Internet:<http://www.metrohm.com>