Question: How to count the same random sequence as one

RandomCompositions:= proc(n::posint, k::posint)
local
C,
Compositions:= [seq(C-~1, C= combinat:-composition(n+k, k))],
Rand:= rand(1..nops(Compositions))
;
()-> Compositions[Rand()]
end proc:

R:= RandomCompositions(9,6):
n:= 10:
S:= 'R()' $ n;

S := [4, 1, 1, 1, 2, 0], [3, 2, 1, 1, 0, 2], [0, 1, 1, 0, 0, 7], [0, 1, 1, 5, 0, 2], [1, 0, 3, 1, 3, 1],

        [1, 3, 1, 1, 0, 3], [1, 4, 2, 0, 2, 0], [5, 0, 0, 3, 1, 0], [1, 1, 1, 4, 0, 2], [0, 1, 2, 1, 0, 5]

 

[4, 1, 1, 1, 2, 0] , [1, 1, 1, 4, 0, 2]  and [0, 1, 1, 5, 0, 2] , [0, 1, 2, 1, 0, 5]  are same number 

  but different order.

There are two same sequence. I want to  count  as one, and compile statistics the summation, and 

divide by 8.

the result

0=14/8

1=17/8

2=6/8

...

4=2/8

5=2/8

...

 

Please Wait...