
Posted by Moby Dick
![]()
on 20/6/2009, 11:55 pm, in reply to "Re: Singing Competition"
Sorry - you are correct. Since all groups of the same size have already allowed for having all competitors in them, they should not be permuted.
Here is my corrected code:
(tot: 0,
parts: integer_partitions(11),
for part in parts do (
ptot: length(part)!,
divBy: 1,
available: 11,
for p in part do (
ptot: ptot * combination(available, p),
available: available - p
),
for p in setify(part) do
divBy: divBy * (length(part) - length(delete(p,part)))!,
tot: tot + (ptot / divBy)
),
print(tot)
)$
1622632573



Message Thread:
![]()
« Back to thread