COMB PART,L / PART=PARTITIONS,<n> lists all partitions of interger <n>. COMB PART,L / PART=PARTITIONS,<n>,<m> lists partitions of <n> consisting of <m> parts. ................................................................................ In both forms of partitions the sizes of parts can be limited by MIN and MAX specifications. Example: COMB PART1,CUR+1 / PART1=PARTITIONS,12,4 MIN=2 MAX=4 Partitions 4 of 12: N[PART1]=3 2 2 4 4 2 3 3 4 3 3 3 3 ................................................................................ By the DISTINCT specification only partitions with distinct parts are accepted. Example: COMB PART1,CUR+1 / PART1=PARTITIONS,18,4 MIN=2 MAX=10 DISTINCT=1 Partitions 4 of 18: N[PART1]=5 2 3 4 9 2 3 5 8 2 3 6 7 2 4 5 7 3 4 5 6 ................................................................................ COMB P,L / P=PARTITIONS,<n> PARTS=<ascending_list_of_positive_integers> lists all partitions of <n> using only integers given by PARTS. COMB P,L / PART=PARTITIONS,<n>,<m> PARTS=<ascending_list_of_positive_integers> lists partitions of <n> consisting of <m> parts using the PARTS integers. As a special case, PARTS=POWERS,k is the same as PARTS=1,2^k,3^k,4^k,... Examples: COMB P,CUR+1 / P=PARTITIONS,1729,2 PARTS=POWERS,3 Partitions 2 of 1729: N[P]=2 1 1728 729 1000 ................................................................................ PARTS=1,5,10,20,50,100,500,1000 (metal and paper moneys in Finland) COMB P,CUR+1 / P=PARTITIONS,1000 RESULTS=0 Partitions of 1000: N[P]=2720784 ................................................................................ COMB P,L / P=PARTITIONS,<n>,<m> DISTINCT=1 OFF=i1,i2,... makes partitions of size <m> for <n> with distinct elements and excluding elements i1,i2,... listed by an OFF specification. ................................................................................ Example: COMB P,CUR+1 / P=PARTITIONS,25,3 DISTINCT=1 OFF=2,4,6,8,10 Partitions 3 of 25: N[P]=10 1 3 21 1 5 19 1 7 17 1 9 15 1 11 13 3 5 17 3 7 15 3 9 13 5 7 13 5 9 11 ................................................................................ COMB P,L / P=PARTITIONS,<n> GREATEST=<m> lists partitions of <n> with <m> as the greatest part. Example: COMB P,CUR+1 / P=PARTITIONS,10 GREATEST=3 Partitions of 10: N[P]=8 1 3 3 3 2 2 3 3 1 1 2 3 3 1 2 2 2 3 1 1 1 1 3 3 1 1 1 2 2 3 1 1 1 1 1 2 3 1 1 1 1 1 1 1 3 The number of these partitions is the same as those obtained by PARTITIONS,<n>,<m> since there there is a bijective mapping between these two types of partitions proved simply by transposing the Ferrers graph. ................................................................................ COMB P,L / P=PARTITIONS,<n>,<m> MIN=<min> MAX=<max> MULTIN=1 both makes partitions of size <m> for <n> and - by assuming that each partition f1+f2+...+fm=n represents frequencies of an n-fold trial with m possible outcomes with equal probabilities 1/m - computes also the probability that the conditions <min> <= fi <= <max>, i=1,2,...,m are fulfilled. This probability is computed if MULTIN=1 is given. Example on the next page! ................................................................................ Example: What is the probability that in 600 tosses of an unbiased dice the frequencies of each of the numbers 1,2,3,4,5,6 fall in the closed interval [90,110] ? TIME COUNT START COMB P,CUR+2 / P=PARTITIONS,600,6 MIN=90 MAX=110 MULTIN=1 RESULTS=0 TIME COUNT END 0.220 Restricted partitions of 600: N[P]=5444 P=0.215947 Thus the probability is P=0.215947 . Checking that the sum of all multinomial probabilities is 1: Please note that it takes "some time". This is computed on a 700 MHz PC. TIME COUNT START COMB P,CUR+2 / P=PARTITIONS,600,6 MIN=0 MAX=600 MULTIN=1 RESULTS=0 TIME COUNT END 1406.632 Restricted partitions of 600: N[P]=981355696 P=1 C = Other forms of COMB