       Special permutation pattern ascending groups sum of subset

• To: mathgroup at smc.vnet.net
• Subject: [mg113187] Special permutation pattern ascending groups sum of subset
• From: me you <coconut_dj at yahoo.com>
• Date: Sun, 17 Oct 2010 06:06:25 -0400 (EDT)

```hi,

i'm very new to Mathematica and i would like  to ask for some help, i need some code which can handle with the following problem

i have a vector of 9 elements {0, 0, 1, 2, 3, 4, 5, 7, 8}
i have k = 3, k is the number of subsets
each subset should contain elements in ascending order
i need to get all the permutation that fit the following conditions
a1 <= a2 <= a3
a2 <= a5 <= a6
a7 <= a8 <= a9
a1 <= a4 <= a7
a1 + a2 + a3 = 10
a4 + a5 + a6 = 10
a7 + a8 + a9 = 10

possible solution would be
{0, 2, 8, 0, 3, 7, 1, 4, 5}
and
{0, 3, 7, 0,2, 8, 1, 4, 5}

the script should be very dynamic because i would like to use it on a largeset of numbers (40)
somehow before we can check for the sum of elements we need to generate just those permutation where elements in subset sare ascending order (a1<=a2<=a3) (a4<=a6<=a6) (a7<=a8<=a9)

Thanks

```