# AND HERE TIZZ: the full thing!

[ Follow Ups ] [ Post Followup ] [ Main Message Board ] [ FAQ ]

Posted by Denis Borris on October 22, 2002 at 18:54:17:

In Reply to: the formula.... posted by Denis Borris on October 22, 2002 at 13:36:29:

The formula:
Take 1 1 1 3 3 3 3 3 3 4 5 5 (one of 197 "number combos" that add up to 35)
We have 3 of same, 6 of same, 1 of same, 2 of same:
12! / (3! * 6! * 1! * 2!) = 55440
n! / [n(1)! * n(2)! ... * n(i)!]

This is the results for ALL the sums:
(columns: sums, number arrangements, total combos)
12/72 001 000000001
13/71 001 000000012
14/70 002 000000078
15/69 003 000000364
16/68 005 000001365
17/67 007 000004368
18/66 010 000012364
19/65 013 000031680
20/64 018 000074646
21/63 023 000163592
22/62 030 000336336
23/61 037 000653016
24/60 047 001203632
25/59 056 002115048
26/58 068 003555564
27/57 080 005734664
28/56 094 008895393
29/55 107 013297284
30/54 123 019188950
31/53 137 026771316
32/52 154 036154767
33/51 168 047315840
34/50 184 060060936
35/49 197 074005152
36/48 212 088573343
37/47 222 103027860
38/46 233 116523342
39/45 240 128184068
40/44 247 137194629
41/43 249 142891320
00042 252 144840476
Total:2,176,782,336

My program (half in English!):

loop A from 1 to 6
loop B from A to 6
loop C from B to 6
...
loop K from J to 6
loop L from K to 6

store above in array V(12) : V(1)=A, V(2)=B, ... V(12)=L
X = A + B + C ... + K + L : get current sum
W(X) = W(X) + 1 : update number for this sum in array W(72)

(This section gets info for, and uses the formula)
P = 1 : cumulative product of denominator
N = 1 : number of "like numbers"
loop M from 2 to 12 : to go thru array V(12)
if V(M) = V(M-1) then N = N + 1 : update N and go to next loop
else P = P * N! and N = 1 : update cumulative product
endloop M
P = P * N! : last portion up to M = 12

Q = 12! / P : total combos for this number arrangement
Y(X) = Y(X) + Q : update combos in array Y(72)

Z = Z + Q : update grand total of combos; will end at 6^12

endloops A-L

Print arrays W(72) and Y(72) from 12 to 72
(small sample:)
12 1 1
13 1 12
...
42 252 144840476
...
71 1 12
72 1 1

Send this to Las Vegas? :)

Name:
E-Mail:

Subject: