## Poll

 I'm stumped too. 2 votes (16.66%) This is easy, Wiz. 3 votes (25%) Just accept the simulation and move on. 2 votes (16.66%) I have some ideas, let me work on it. 3 votes (25%) I don't understand the question No votes (0%) How do I convert HEIC files to JPEG? 1 vote (8.33%) I recommend the International Car Forest 1 vote (8.33%) When are you going to analyze River Hold 'Em? 1 vote (8.33%) Total eclipse reminder 04/08/2024 4 votes (33.33%) I liked the Big Bang Theory ending. 2 votes (16.66%)

12 members have voted

7craps
Joined: Jan 23, 2010
• Posts: 1977
May 20th, 2019 at 5:25:31 PM permalink
Quote: ThatDonGuy

How to get such a count without having to go through all 280 products, I don't know, and presumably, that's why things like Mathematica exist.

what you say is so true.
I looked for the original pari/gp text file that is created from that formula and I do not have it and do not want to make it. I think it was very large and a program as notepad++ only could open it and make things happen.
added: I made that file and it is only 1.9MB in a text file and took less than 1 second to make.

Here is what I do have for x^20 (draw 20)
y^sum is the sum and the coefficient is the number of ways that sum can occur.
this can be compared to by one who really wants to do this

here is 2 numbers and 3 numbers expanded and it should make sense.
`gp > a=prod(i=1, 2, 1 + x*y^i);gp > b=prod(i=1, 3, 1 + x*y^i);gp > a%3 = y^3*x^2 + (y^2 + y)*x + 1gp > b%4 = y^6*x^3 + (y^5 + y^4 + y^3)*x^2 + (y^3 + y^2 + y)*x + 1`

a=prod(i=1, 2, 1 + x*y^i); means we only have 2 numbers (1 and 2)
y^3*x^2 + (y^2 + y)*x + 1 means drawing 2 numbers (x^2) we have only 1 sum and that is y^3 = 3 and only 1 way to get it (1+2)
(y^2 + y)*x means we draw 1 number (x) and the sums are 2 and 1 and 1 way to get each

same concept with numbers {1,2,3}
x^20
1*y^1410
1*y^1409
2*y^1408
3*y^1407
5*y^1406
7*y^1405
11*y^1404
15*y^1403
22*y^1402
30*y^1401
42*y^1400
56*y^1399
77*y^1398
101*y^1397
135*y^1396
176*y^1395
231*y^1394
297*y^1393
385*y^1392
490*y^1391
627*y^1390
791*y^1389
1000*y^1388
1251*y^1387
1568*y^1386
1946*y^1385
2417*y^1384
2980*y^1383
3673*y^1382
4498*y^1381
5507*y^1380
6703*y^1379
8154*y^1378
9871*y^1377
11937*y^1376
14375*y^1375
17293*y^1374
20722*y^1373
24803*y^1372
29588*y^1371
35251*y^1370
41869*y^1369
49668*y^1368
58754*y^1367
69414*y^1366
81801*y^1365
96271*y^1364
113039*y^1363
132559*y^1362
155112*y^1361
181274*y^1360
211428*y^1359
246288*y^1358
286364*y^1357
332557*y^1356
385528*y^1355
446405*y^1354
516054*y^1353
595872*y^1352
686983*y^1351
791131*y^1350
909741*y^1349
1044984*y^1348
1198689*y^1347
1373524*y^1346
1571812*y^1345
1796855*y^1344
2051569*y^1343
2340024*y^1342
2665885*y^1341
3034135*y^1340
3449359*y^1339
3917670*y^1338
4444748*y^1337
5038070*y^1336
5704686*y^1335
6453684*y^1334
7293767*y^1333
8236001*y^1332
9291060*y^1331
10472375*y^1330
11793028*y^1329
13269250*y^1328
14917024*y^1327
16755957*y^1326
18805464*y^1325
21089176*y^1324
23630664*y^1323
26458297*y^1322
29600587*y^1321
33091578*y^1320
36965620*y^1319
41263462*y^1318
46026431*y^1317
51303148*y^1316
57143201*y^1315
63604540*y^1314
70746444*y^1313
78637842*y^1312
87349501*y^1311
96963169*y^1310
107563103*y^1309
119246146*y^1308
132112328*y^1307
146276124*y^1306
161856093*y^1305
178987225*y^1304
197809729*y^1303
218482569*y^1302
241171101*y^1301
266062168*y^1300
293350487*y^1299
323255164*y^1298
356005000*y^1297
391856581*y^1296
431078138*y^1295
473969587*y^1294
520844871*y^1293
572053851*y^1292
627963266*y^1291
688980643*y^1290
755533468*y^1289
828095629*y^1288
907164667*y^1287
993290571*y^1286
1087051347*y^1285
1189084411*y^1284
1300059954*y^1283
1420715489*y^1282
1551826889*y^1281
1694245990*y^1280
1848869496*y^1279
2016679881*y^1278
2198711618*y^1277
2396096082*y^1276
2610024936*y^1275
2841798846*y^1274
3092788314*y^1273
3364486581*y^1272
3658467191*y^1271
3976441876*y^1270
4320214692*y^1269
4691744778*y^1268
5093097335*y^1267
5526511602*y^1266
5994347965*y^1265
6499162145*y^1264
7043648186*y^1263
7630718671*y^1262
8263443950*y^1261
8945138936*y^1260
9679297643*y^1259
10469687646*y^1258
11320279729*y^1257
12235349889*y^1256
13219404469*y^1255
14277290236*y^1254
15414114032*y^1253
16635362300*y^1252
17946814901*y^1251
19354673930*y^1250
20865472184*y^1249
22486212019*y^1248
24224267278*y^1247
26087533643*y^1246
28084323773*y^1245
30223529082*y^1244
32514508546*y^1243
34967262684*y^1242
37592314751*y^1241
40400898786*y^1240
43404832757*y^1239
46616720518*y^1238
50049817550*y^1237
53718247833*y^1236
57636860670*y^1235
61821464449*y^1234
66288674187*y^1233
71056162189*y^1232
76142496873*y^1231
81567411419*y^1230
87351632249*y^1229
93517168095*y^1228
100087127594*y^1227
107086028628*y^1226
114539605867*y^1225
122475141756*y^1224
130921262045*y^1223
139908291043*y^1222
149468034620*y^1221
159634159836*y^1220
170441966142*y^1219
181928790813*y^1218
194133766301*y^1217
207098254570*y^1216
220865589927*y^1215
235481542190*y^1214
250994045973*y^1213
267453694512*y^1212
284913452879*y^1211
303429185857*y^1210
323059354425*y^1209
343865577844*y^1208
365912314318*y^1207
389267459099*y^1206
414002006749*y^1205
440190689221*y^1204
467911618783*y^1203
497246966079*y^1202
528282584833*y^1201
561108732221*y^1200
595819672189*y^1199
632514442353*y^1198
671296435063*y^1197
712274211009*y^1196
755561059108*y^1195
801275859118*y^1194
849542617012*y^1193
900491381529*y^1192
954257753733*y^1191
1010983857544*y^1190
1070817824773*y^1189
1133914822434*y^1188
1200436509276*y^1187
1270552124993*y^1186
1344437917067*y^1185
1422278292091*y^1184
1504265214046*y^1183
1590599420536*y^1182
1681489788194*y^1181
1777154619819*y^1180
1877820975168*y^1179
1983726028916*y^1178
2095116368246*y^1177
2212249424868*y^1176
2335392734382*y^1175
2464825448513*y^1174
2600837554495*y^1173
2743731467669*y^1172
2893821211946*y^1171
3051434096031*y^1170
3216909849508*y^1169
3390602389686*y^1168
3572878910940*y^1167
3764121741811*y^1166
3964727389027*y^1165
4175108488550*y^1164
4395692797816*y^1163
4626925247931*y^1162
4869266881582*y^1161
5123197006289*y^1160
5389212078927*y^1159
5667827963566*y^1158
5959578755669*y^1157
6265019152487*y^1156
6584723213704*y^1155
6919286843610*y^1154
7269326489361*y^1153
7635481738958*y^1152
8018413948848*y^1151
8418808965914*y^1150
8837375680898*y^1149
9274848873719*y^1148
9731987693363*y^1147
10209578630140*y^1146
10708433913262*y^1145
11229394619008*y^1144
11773328981483*y^1143
12341135635235*y^1142
12933741839899*y^1141
13552106861442*y^1140
14197220100303*y^1139
14870104620270*y^1138
15571815175325*y^1137
16303441884554*y^1136
17066108157849*y^1135
17860974520443*y^1134
18689236426307*y^1133
19552128242181*y^1132
20450920942555*y^1131
21386926250737*y^1130
22361494215565*y^1129
23376017513498*y^1128
24431928894154*y^1127
25530705653070*y^1126
26673866939713*y^1125
27862978398196*y^1124
29099649337087*y^1123
30385537541434*y^1122
31722346290416*y^1121
33111829351342*y^1120
34555787837266*y^1119
36056075379039*y^1118
37614594822327*y^1117
39233303581272*y^1116
40914210159126*y^1115
42659379693854*y^1114
44470930294083*y^1113
46351038772509*y^1112
48301936795528*y^1111
50325916807381*y^1110
52425327976532*y^1109
54602582321801*y^1108
56860150445667*y^1107
59200567856702*y^1106
61626430488492*y^1105
64140401221500*y^1104
66745205168528*y^1103
69443636407019*y^1102
72238553020681*y^1101
75132884036461*y^1100
78129624219915*y^1099
81231841219122*y^1098
84442670093739*y^1097
87765320677722*y^1096
91203071830294*y^1095
94759279010024*y^1094
98437368245632*y^1093
102240843924128*y^1092
106173282459017*y^1091
110238340304328*y^1090
114439747308027*y^1089
118781314944316*y^1088
123266929349329*y^1087
127900559773363*y^1086
132686251275763*y^1085
137628133409981*y^1084
142730412563985*y^1083
147997380868998*y^1082
153433408182971*y^1081
159042951225485*y^1080
164830545178892*y^1079
170800813062207*y^1078
176958456936318*y^1077
183308267507535*y^1076
189855114934011*y^1075
196603958660512*y^1074
203559837800120*y^1073
210727881214639*y^1072
218113297456569*y^1071
225721385084601*y^1070
233557522163930*y^1069
241627176819381*y^1068
249935896266269*y^1067
258489317615563*y^1066
267293156421037*y^1065
276353217726061*y^1064
285675384124940*y^1063
295265627053394*y^1062
305129994336046*y^1061
315274621737283*y^1060
325705719979621*y^1059
336429586543371*y^1058
347452592155562*y^1057
358781192841696*y^1056
370421915855964*y^1055
382381372002154*y^1054
394666240991089*y^1053
407283284019903*y^1052
420239328556562*y^1051
433541281180913*y^1050
447196111767398*y^1049
461210866607609*y^1048
475592651976889*y^1047
490348647526558*y^1046
505486089237058*y^1045
521012283085036*y^1044
536934587353256*y^1043
553260426593322*y^1042
569997273279789*y^1041
587152662058258*y^1040
604734170747184*y^1039
622749434876858*y^1038
641206128010489*y^1037
660111976597920*y^1036
679474739604064*y^1035
699302223666421*y^1034
719602262037791*y^1033
740382730055707*y^1032
761651523370470*y^1031
783416573752126*y^1030
805685826594439*y^1029
828467257050350*y^1028
851768846820577*y^1027
875598600626154*y^1026
899964522255079*y^1025
924874631401209*y^1024
950336938960611*y^1023
976359464227661*y^1022
1002950209453776*y^1021
1030117177412699*y^1020
1057868345195045*y^1019
1086211682173956*y^1018
1115155123030642*y^1017
1144706586113291*y^1016
1174873945708909*y^1015
1205665050808215*y^1014
1237087696599984*y^1013
1269149643677458*y^1012
1301858588751637*y^1011
1335222184292444*y^1010
1369248008480895*y^1009
1403943585301204*y^1008
1439316353708705*y^1007
1475373688210195*y^1006
1512122867248405*y^1005
1549571094266055*y^1004
1587725465329523*y^1003
1626592990693830*y^1002
1666180561645293*y^1001
1706494972609528*y^1000
1747542887215360*y^999
1789330860941288*y^998
1831865306428571*y^997
1875152516686548*y^996
1919198629635734*y^995
1964009651915660*y^994
2009591422664545*y^993
2055949637927477*y^992
2103089813703016*y^991
2151017310973098*y^990
2199737298000372*y^989
2249254776027773*y^988
2299574540834782*y^987
2350701209103646*y^986
2402639179270463*y^985
2455392658582214*y^984
2508965623226933*y^983
2563361846130743*y^982
2618584856379097*y^981
2674637967752948*y^980
2731524237478957*y^979
2789246495528881*y^978
2847807302685929*y^977
2907208980659856*y^976
2967453569482805*y^975
3028542858437463*y^974
3090478342825046*y^973
3153261255732853*y^972
3216892524160984*y^971
3281372801682291*y^970
3346702423944313*y^969
3412881442219846*y^968
3479909578328192*y^967
3547786259101073*y^966
3616510570712255*y^965
3686081294113980*y^964
3756496858791478*y^963
3827755379165355*y^962
3899854607818599*y^961
3972791972891010*y^960
4046564530766019*y^959
4121169004511073*y^958
4196601736043217*y^957
4272858725610066*y^956
4349935583482269*y^955
4427827570497986*y^954
4506529549270567*y^953
4586036025851501*y^952
4666341100470600*y^951
4747438510307985*y^950
4829321579817147*y^949
4911983264628415*y^948
4995416101440403*y^947
5079612253106599*y^946
5164563458113973*y^945
5250261076840903*y^944
5336696040671980*y^943
5423858899445150*y^942
5511739770187560*y^941
5600328385803359*y^940
5689614043446161*y^939
5779585654429600*y^938
5870231692286645*y^937
5961540243918360*y^936
6053498957320960*y^935
6146095094019128*y^934
6239315476476153*y^933
6333146541790366*y^932
6427574288835366*y^931
6522584333229145*y^930
6618161854183309*y^929
6714291650789160*y^928
6810958088586958*y^927
6908145157139459*y^926
7005836416368480*y^925
7104015055421622*y^924
7202663838749386*y^923
7301765166303075*y^922
7401301019361722*y^921
7501253022027266*y^920
7601602386843987*y^919
7702329977589080*y^918
7803416254655222*y^917
7904841339170873*y^916
8006584958150181*y^915
8108626509899889*y^914
8210945008978195*y^913
8313519152881939*y^912
8416327266778085*y^911
8519347371498567*y^910
8622557128046053*y^909
8725933906847840*y^908
8829454732072484*y^907
8933096352127635*y^906
9036835183748460*y^905
9140647383762528*y^904
9244508792945678*y^903
9348395008996007*y^902
9452281330191897*y^901
9556142829555643*y^900
9659954298267308*y^899
9763690321033408*y^898
9867325219249981*y^897
9970833127512512*y^896
10074187936558122*y^895
10177363370888455*y^894
10280332931441733*y^893
10383069974340297*y^892
10485547653279647*y^891
10587738999328217*y^890
10689616863061737*y^889
10791153995382729*y^888
10892322989344543*y^887
10993096361994634*y^886
11093446495874170*y^885
11193345721807668*y^884
11292766260101878*y^883
11391680304241666*y^882
11490059961730183*y^881
11587877338692722*y^880
11685104480338701*y^879
11781713456388257*y^878
11877676301179640*y^877
11972965099875122*y^876
12067551928151070*y^875
12161408939178544*y^874
12254508302876326*y^873
12346822293578054*y^872
12438323228868060*y^871
12528983557886059*y^870
12618775799682379*y^869
12707672632154594*y^868
12795646829899064*y^867
12882671353685064*y^866
12968719287824486*y^865
13053763930133222*y^864
13137778728752338*y^863
13220737372587114*y^862
13302613727557896*y^861
13383381927422176*y^860
13463016309475063*y^859
13541491505700427*y^858
13618782377856223*y^857
13694864108945970*y^856
13769712137666260*y^855
13843302250100143*y^854
13915610513550433*y^853
13986613368402674*y^852
14056287561278035*y^851
14124610237055954*y^850
14191558871327486*y^849
14257111362481292*y^848
14321245963481667*y^847
14383941373963924*y^846
14445176671275633*y^845
14504931402574878*y^844
14563185515116493*y^843
14619919448256126*y^842
14675114063011110*y^841
14728750733921081*y^840
14780811277822859*y^839
14831278045561927*y^838
14880133849969280*y^837
14927362057331041*y^836
14972946514599961*y^835
15016871640574771*y^834
15059122352292240*y^833
15099684155916740*y^832
15138543072303315*y^831
15175685727506919*y^830
15211099277556439*y^829
15244771498541818*y^828
15276690710548182*y^827
15306845867323822*y^826
15335226479373283*y^825
15361822703122288*y^824
15386625263213894*y^823
15409625541131887*y^822
15430815496656959*y^821
15450187755959996*y^820
15467735532221058*y^819
15483452713112335*y^818
15497333780632956*y^817
15509373897951036*y^816
15519568828416239*y^815
15527915021776296*y^814
15534409532379142*y^813
15539050104692302*y^812
15541835090752144*y^811
15542763534960598*y^810
15541835090752144*y^809
15539050104692302*y^808
15534409532379142*y^807
15527915021776296*y^806
15519568828416239*y^805
15509373897951036*y^804
15497333780632956*y^803
15483452713112335*y^802
15467735532221058*y^801
15450187755959996*y^800
15430815496656959*y^799
15409625541131887*y^798
15386625263213894*y^797
15361822703122288*y^796
15335226479373283*y^795
15306845867323822*y^794
15276690710548182*y^793
15244771498541818*y^792
15211099277556439*y^791
15175685727506919*y^790
15138543072303315*y^789
15099684155916740*y^788
15059122352292240*y^787
15016871640574771*y^786
14972946514599961*y^785
14927362057331041*y^784
14880133849969280*y^783
14831278045561927*y^782
14780811277822859*y^781
14728750733921081*y^780
14675114063011110*y^779
14619919448256126*y^778
14563185515116493*y^777
14504931402574878*y^776
14445176671275633*y^775
14383941373963924*y^774
14321245963481667*y^773
14257111362481292*y^772
14191558871327486*y^771
14124610237055954*y^770
14056287561278035*y^769
13986613368402674*y^768
13915610513550433*y^767
13843302250100143*y^766
13769712137666260*y^765
13694864108945970*y^764
13618782377856223*y^763
13541491505700427*y^762
13463016309475063*y^761
13383381927422176*y^760
13302613727557896*y^759
13220737372587114*y^758
13137778728752338*y^757
13053763930133222*y^756
12968719287824486*y^755
12882671353685064*y^754
12795646829899064*y^753
12707672632154594*y^752
12618775799682379*y^751
12528983557886059*y^750
12438323228868060*y^749
12346822293578054*y^748
12254508302876326*y^747
12161408939178544*y^746
12067551928151070*y^745
11972965099875122*y^744
11877676301179640*y^743
11781713456388257*y^742
11685104480338701*y^741
11587877338692722*y^740
11490059961730183*y^739
11391680304241666*y^738
11292766260101878*y^737
11193345721807668*y^736
11093446495874170*y^735
10993096361994634*y^734
10892322989344543*y^733
10791153995382729*y^732
10689616863061737*y^731
10587738999328217*y^730
10485547653279647*y^729
10383069974340297*y^728
10280332931441733*y^727
10177363370888455*y^726
10074187936558122*y^725
9970833127512512*y^724
9867325219249981*y^723
9763690321033408*y^722
9659954298267308*y^721
9556142829555643*y^720
9452281330191897*y^719
9348395008996007*y^718
9244508792945678*y^717
9140647383762528*y^716
9036835183748460*y^715
8933096352127635*y^714
8829454732072484*y^713
8725933906847840*y^712
8622557128046053*y^711
8519347371498567*y^710
8416327266778085*y^709
8313519152881939*y^708
8210945008978195*y^707
8108626509899889*y^706
8006584958150181*y^705
7904841339170873*y^704
7803416254655222*y^703
7702329977589080*y^702
7601602386843987*y^701
7501253022027266*y^700
7401301019361722*y^699
7301765166303075*y^698
7202663838749386*y^697
7104015055421622*y^696
7005836416368480*y^695
6908145157139459*y^694
6810958088586958*y^693
6714291650789160*y^692
6618161854183309*y^691
6522584333229145*y^690
6427574288835366*y^689
6333146541790366*y^688
6239315476476153*y^687
6146095094019128*y^686
6053498957320960*y^685
5961540243918360*y^684
5870231692286645*y^683
5779585654429600*y^682
5689614043446161*y^681
5600328385803359*y^680
5511739770187560*y^679
5423858899445150*y^678
5336696040671980*y^677
5250261076840903*y^676
5164563458113973*y^675
5079612253106599*y^674
4995416101440403*y^673
4911983264628415*y^672
4829321579817147*y^671
4747438510307985*y^670
4666341100470600*y^669
4586036025851501*y^668
4506529549270567*y^667
4427827570497986*y^666
4349935583482269*y^665
4272858725610066*y^664
4196601736043217*y^663
4121169004511073*y^662
4046564530766019*y^661
3972791972891010*y^660
3899854607818599*y^659
3827755379165355*y^658
3756496858791478*y^657
3686081294113980*y^656
3616510570712255*y^655
3547786259101073*y^654
3479909578328192*y^653
3412881442219846*y^652
3346702423944313*y^651
3281372801682291*y^650
3216892524160984*y^649
3153261255732853*y^648
3090478342825046*y^647
3028542858437463*y^646
2967453569482805*y^645
2907208980659856*y^644
2847807302685929*y^643
2789246495528881*y^642
2731524237478957*y^641
2674637967752948*y^640
2618584856379097*y^639
2563361846130743*y^638
2508965623226933*y^637
2455392658582214*y^636
2402639179270463*y^635
2350701209103646*y^634
2299574540834782*y^633
2249254776027773*y^632
2199737298000372*y^631
2151017310973098*y^630
2103089813703016*y^629
2055949637927477*y^628
2009591422664545*y^627
1964009651915660*y^626
1919198629635734*y^625
1875152516686548*y^624
1831865306428571*y^623
1789330860941288*y^622
1747542887215360*y^621
1706494972609528*y^620
1666180561645293*y^619
1626592990693830*y^618
1587725465329523*y^617
1549571094266055*y^616
1512122867248405*y^615
1475373688210195*y^614
1439316353708705*y^613
1403943585301204*y^612
1369248008480895*y^611
1335222184292444*y^610
1301858588751637*y^609
1269149643677458*y^608
1237087696599984*y^607
1205665050808215*y^606
1174873945708909*y^605
1144706586113291*y^604
1115155123030642*y^603
1086211682173956*y^602
1057868345195045*y^601
1030117177412699*y^600
1002950209453776*y^599
976359464227661*y^598
950336938960611*y^597
924874631401209*y^596
899964522255079*y^595
875598600626154*y^594
851768846820577*y^593
828467257050350*y^592
805685826594439*y^591
783416573752126*y^590
761651523370470*y^589
740382730055707*y^588
719602262037791*y^587
699302223666421*y^586
679474739604064*y^585
660111976597920*y^584
641206128010489*y^583
622749434876858*y^582
604734170747184*y^581
587152662058258*y^580
569997273279789*y^579
553260426593322*y^578
536934587353256*y^577
521012283085036*y^576
505486089237058*y^575
490348647526558*y^574
475592651976889*y^573
461210866607609*y^572
447196111767398*y^571
433541281180913*y^570
420239328556562*y^569
407283284019903*y^568
394666240991089*y^567
382381372002154*y^566
370421915855964*y^565
358781192841696*y^564
347452592155562*y^563
336429586543371*y^562
325705719979621*y^561
315274621737283*y^560
305129994336046*y^559
295265627053394*y^558
285675384124940*y^557
276353217726061*y^556
267293156421037*y^555
258489317615563*y^554
249935896266269*y^553
241627176819381*y^552
233557522163930*y^551
225721385084601*y^550
218113297456569*y^549
210727881214639*y^548
203559837800120*y^547
196603958660512*y^546
189855114934011*y^545
183308267507535*y^544
176958456936318*y^543
170800813062207*y^542
164830545178892*y^541
159042951225485*y^540
153433408182971*y^539
147997380868998*y^538
142730412563985*y^537
137628133409981*y^536
132686251275763*y^535
127900559773363*y^534
123266929349329*y^533
118781314944316*y^532
114439747308027*y^531
110238340304328*y^530
106173282459017*y^529
102240843924128*y^528
98437368245632*y^527
94759279010024*y^526
91203071830294*y^525
87765320677722*y^524
84442670093739*y^523
81231841219122*y^522
78129624219915*y^521
75132884036461*y^520
72238553020681*y^519
69443636407019*y^518
66745205168528*y^517
64140401221500*y^516
61626430488492*y^515
59200567856702*y^514
56860150445667*y^513
54602582321801*y^512
52425327976532*y^511
50325916807381*y^510
48301936795528*y^509
46351038772509*y^508
44470930294083*y^507
42659379693854*y^506
40914210159126*y^505
39233303581272*y^504
37614594822327*y^503
36056075379039*y^502
34555787837266*y^501
33111829351342*y^500
31722346290416*y^499
30385537541434*y^498
29099649337087*y^497
27862978398196*y^496
26673866939713*y^495
25530705653070*y^494
24431928894154*y^493
23376017513498*y^492
22361494215565*y^491
21386926250737*y^490
20450920942555*y^489
19552128242181*y^488
18689236426307*y^487
17860974520443*y^486
17066108157849*y^485
16303441884554*y^484
15571815175325*y^483
14870104620270*y^482
14197220100303*y^481
13552106861442*y^480
12933741839899*y^479
12341135635235*y^478
11773328981483*y^477
11229394619008*y^476
10708433913262*y^475
10209578630140*y^474
9731987693363*y^473
9274848873719*y^472
8837375680898*y^471
8418808965914*y^470
8018413948848*y^469
7635481738958*y^468
7269326489361*y^467
6919286843610*y^466
6584723213704*y^465
6265019152487*y^464
5959578755669*y^463
5667827963566*y^462
5389212078927*y^461
5123197006289*y^460
4869266881582*y^459
4626925247931*y^458
4395692797816*y^457
4175108488550*y^456
3964727389027*y^455
3764121741811*y^454
3572878910940*y^453
3390602389686*y^452
3216909849508*y^451
3051434096031*y^450
2893821211946*y^449
2743731467669*y^448
2600837554495*y^447
2464825448513*y^446
2335392734382*y^445
2212249424868*y^444
2095116368246*y^443
1983726028916*y^442
1877820975168*y^441
1777154619819*y^440
1681489788194*y^439
1590599420536*y^438
1504265214046*y^437
1422278292091*y^436
1344437917067*y^435
1270552124993*y^434
1200436509276*y^433
1133914822434*y^432
1070817824773*y^431
1010983857544*y^430
954257753733*y^429
900491381529*y^428
849542617012*y^427
801275859118*y^426
755561059108*y^425
712274211009*y^424
671296435063*y^423
632514442353*y^422
595819672189*y^421
561108732221*y^420
528282584833*y^419
497246966079*y^418
467911618783*y^417
440190689221*y^416
414002006749*y^415
389267459099*y^414
365912314318*y^413
343865577844*y^412
323059354425*y^411
303429185857*y^410
284913452879*y^409
267453694512*y^408
250994045973*y^407
235481542190*y^406
220865589927*y^405
207098254570*y^404
194133766301*y^403
181928790813*y^402
170441966142*y^401
159634159836*y^400
149468034620*y^399
139908291043*y^398
130921262045*y^397
122475141756*y^396
114539605867*y^395
107086028628*y^394
100087127594*y^393
93517168095*y^392
87351632249*y^391
81567411419*y^390
76142496873*y^389
71056162189*y^388
66288674187*y^387
61821464449*y^386
57636860670*y^385
53718247833*y^384
50049817550*y^383
46616720518*y^382
43404832757*y^381
40400898786*y^380
37592314751*y^379
34967262684*y^378
32514508546*y^377
30223529082*y^376
28084323773*y^375
26087533643*y^374
24224267278*y^373
22486212019*y^372
20865472184*y^371
19354673930*y^370
17946814901*y^369
16635362300*y^368
15414114032*y^367
14277290236*y^366
13219404469*y^365
12235349889*y^364
11320279729*y^363
10469687646*y^362
9679297643*y^361
8945138936*y^360
8263443950*y^359
7630718671*y^358
7043648186*y^357
6499162145*y^356
5994347965*y^355
5526511602*y^354
5093097335*y^353
4691744778*y^352
4320214692*y^351
3976441876*y^350
3658467191*y^349
3364486581*y^348
3092788314*y^347
2841798846*y^346
2610024936*y^345
2396096082*y^344
2198711618*y^343
2016679881*y^342
1848869496*y^341
1694245990*y^340
1551826889*y^339
1420715489*y^338
1300059954*y^337
1189084411*y^336
1087051347*y^335
993290571*y^334
907164667*y^333
828095629*y^332
755533468*y^331
688980643*y^330
627963266*y^329
572053851*y^328
520844871*y^327
473969587*y^326
431078138*y^325
391856581*y^324
356005000*y^323
323255164*y^322
293350487*y^321
266062168*y^320
241171101*y^319
218482569*y^318
197809729*y^317
178987225*y^316
161856093*y^315
146276124*y^314
132112328*y^313
119246146*y^312
107563103*y^311
96963169*y^310
87349501*y^309
78637842*y^308
70746444*y^307
63604540*y^306
57143201*y^305
51303148*y^304
46026431*y^303
41263462*y^302
36965620*y^301
33091578*y^300
29600587*y^299
26458297*y^298
23630664*y^297
21089176*y^296
18805464*y^295
16755957*y^294
14917024*y^293
13269250*y^292
11793028*y^291
10472375*y^290
9291060*y^289
8236001*y^288
7293767*y^287
6453684*y^286
5704686*y^285
5038070*y^284
4444748*y^283
3917670*y^282
3449359*y^281
3034135*y^280
2665885*y^279
2340024*y^278
2051569*y^277
1796855*y^276
1571812*y^275
1373524*y^274
1198689*y^273
1044984*y^272
909741*y^271
791131*y^270
686983*y^269
595872*y^268
516054*y^267
446405*y^266
385528*y^265
332557*y^264
286364*y^263
246288*y^262
211428*y^261
181274*y^260
155112*y^259
132559*y^258
113039*y^257
96271*y^256
81801*y^255
69414*y^254
58754*y^253
49668*y^252
41869*y^251
35251*y^250
29588*y^249
24803*y^248
20722*y^247
17293*y^246
14375*y^245
11937*y^244
9871*y^243
8154*y^242
6703*y^241
5507*y^240
4498*y^239
3673*y^238
2980*y^237
2417*y^236
1946*y^235
1568*y^234
1251*y^233
1000*y^232
791*y^231
627*y^230
490*y^229
385*y^228
297*y^227
231*y^226
176*y^225
135*y^224
101*y^223
77*y^222
56*y^221
42*y^220
30*y^219
22*y^218
15*y^217
11*y^216
7*y^215
5*y^214
3*y^213
2*y^212
1*y^211
1*y^210
the distribution is symmetrical. 810 being the center value (well known to Keno folks)
Last edited by: 7craps on May 20, 2019
winsome johnny (not Win some johnny)
Wizard
Joined: Oct 14, 2009
• Posts: 25465
May 20th, 2019 at 8:08:11 PM permalink
There is blood all over the wall from me trying to make sense of the above post. Please keep in mind I don't have Mathematica and I'm looking for a way to express the combinations in ordinary mathematical language.
“Extraordinary claims require extraordinary evidence.” -- Carl Sagan
7craps
Joined: Jan 23, 2010
• Posts: 1977
May 20th, 2019 at 8:37:37 PM permalink
Quote: Wizard

Please keep in mind I don't have Mathematica

LOL
Mathematica it is not required.
a program that can expand a product function accurately is all that is needed. That is why I use pari/gp as it is free (windows 64 version) and the learning curve is not steep at all if you already know another language.
Quote: Wizard

and I'm looking for a way to express the combinations in ordinary mathematical language.

Don showed why the formula works and it is actually very simple once you understand the concept of a generating function.

I guess I just got lucky as the light switch went on for me. On a scale of 1 to 10 , my math skills are about a 2
your math skills may be way different from mine, but this method of using a generating function is very basic, as generating functions go.

IF you can understand how a GF works with 2d6 and dice sums, you can get this product function.

(x+x^2+x^3+x^4+x^5+x^6)^2. most know how to expand this the long way. we learned this way back in school.
now we have computers that do it for us in 0 ms

you will get it in no time.
winsome johnny (not Win some johnny)
ThatDonGuy
Joined: Jun 22, 2011
• Posts: 5753
May 20th, 2019 at 8:58:42 PM permalink
Quote: ThatDonGuy

How to get such a count without having to go through all 280 products, I don't know, and presumably, that's why things like Mathematica exist.

I did find this, however, which explains the problem and a way to find the solution
ZPP
Joined: Feb 7, 2010
• Posts: 31
May 21st, 2019 at 12:12:49 AM permalink
Using a computer, this can be calculated using a recurrence:
Let A[n][k][m] be the number of ways to choose k numbers from {1..n} that sum to m.
Suppose we are trying to calculate A[n][k][m] and have already calculated all values for A[n-1][k][m].
We add together the number of ways that do not include n and the number of ways that do include n. This is exhaustive and disjoint.
1. The number of ways that do not include n is A[n-1][k][m], the number of ways to choose k numbers from {1..n-1} that sum to m.
2. If m>=n, the number of ways that do include n is A[n-1][k-1][m-n], the number of ways to choose k-1 numbers from {1..n-1} that sum to m-n. (If m<n, the number of ways to sum to m that do include n is 0.)

This is very fast: using bounds for n, k, and m of 80, 20, and 80*20 (which is overkill, could be 1410), the number of elements to calculate is 80*20*80*20=2,560,000, and each element is at most two array lookups and an addition. It takes less than 10 milliseconds on my laptop.

Here is a C program that does this calculation:
`#include <stdio.h>#include <stdint.h>#define MAXK 20#define MAXN 80#define MAXM (MAXK*MAXN)// Since 80 choose 20 < 2^64, we can get exact counts with 64-bit ints// (but note that 80 choose 22 >= 2^64)typedef uint64_t num_t;// Just index by size_ttypedef size_t index_t;// a[n][k][m] is the number of ways to choose k numbers from {1..n} that sum to mnum_t a[MAXN+1][MAXK+1][MAXM+1];// (Note that because we only reference a[n-1] when calculating a[n],// we only need two (current and previous) 2-dimensional arrays of size// MAXK+1 by MAXM+1, not a 3-dimensional array, but nowadays the// memory needed is nothing.)int main(void){    for (index_t n = 0; n <= MAXN; n++) {        // For any set (including the empty set for n==0), there is 1        // way to choose k==0 numbers and get a sum of 0 and no other        // sum is possible by choosing 0 numbers.        a[n][0][0] = 1;        // Now calculate for choosing more than k>0 numbers.        // We iterate k from 1 to min(n,MAXK).        // Note that therefore we skip this loop if n==0.        index_t maxk = (n < MAXK ? n : MAXK);        for (index_t k = 1; k <= maxk; k++) {            // maxm could be tighter, but this is already fast enough.            index_t maxm = n * k;            for (index_t m = 0; m <= maxm; m++) {                // Calculate a[n][k][m] by adding the number of ways                // that do not include n in the sum and the number of                // ways that do include n in the sum, both of which                // are already calculated in the array.                //                // The number of ways that do not include n is the                // number of ways to choose k numbers from {1..n-1}                // that sum to m.                num_t c = a[n-1][k][m];                // The number of ways that do include n is the number of                // ways to choose k-1 numbers from {1..n-1} that sum                // to m-n, or 0 if m<n.                if (n <= m)                    c += a[n-1][k-1][m-n];                a[n][k][m] = c;            }        }    }    // Print results, which are a table listing M and the number of    // ways of choosing MAXK numbers from {1..MAXN} that sum to M    num_t total = 0;    num_t *p = a[MAXN][MAXK];    for (index_t m = 0; m <= MAXM; m++) {        total += p[m];        if (p[m] != 0)            printf("%4zu %19llu\n", m, p[m]);    }    // Total number of ways can be checked to equal MAXN choose MAXK    printf("Sum: %19llu\n", total);    return 0;}`

Here are the results I get:
` 210                   1 211                   1 212                   2 213                   3 214                   5 215                   7 216                  11 217                  15 218                  22 219                  30 220                  42 221                  56 222                  77 223                 101 224                 135 225                 176 226                 231 227                 297 228                 385 229                 490 230                 627 231                 791 232                1000 233                1251 234                1568 235                1946 236                2417 237                2980 238                3673 239                4498 240                5507 241                6703 242                8154 243                9871 244               11937 245               14375 246               17293 247               20722 248               24803 249               29588 250               35251 251               41869 252               49668 253               58754 254               69414 255               81801 256               96271 257              113039 258              132559 259              155112 260              181274 261              211428 262              246288 263              286364 264              332557 265              385528 266              446405 267              516054 268              595872 269              686983 270              791131 271              909741 272             1044984 273             1198689 274             1373524 275             1571812 276             1796855 277             2051569 278             2340024 279             2665885 280             3034135 281             3449359 282             3917670 283             4444748 284             5038070 285             5704686 286             6453684 287             7293767 288             8236001 289             9291060 290            10472375 291            11793028 292            13269250 293            14917024 294            16755957 295            18805464 296            21089176 297            23630664 298            26458297 299            29600587 300            33091578 301            36965620 302            41263462 303            46026431 304            51303148 305            57143201 306            63604540 307            70746444 308            78637842 309            87349501 310            96963169 311           107563103 312           119246146 313           132112328 314           146276124 315           161856093 316           178987225 317           197809729 318           218482569 319           241171101 320           266062168 321           293350487 322           323255164 323           356005000 324           391856581 325           431078138 326           473969587 327           520844871 328           572053851 329           627963266 330           688980643 331           755533468 332           828095629 333           907164667 334           993290571 335          1087051347 336          1189084411 337          1300059954 338          1420715489 339          1551826889 340          1694245990 341          1848869496 342          2016679881 343          2198711618 344          2396096082 345          2610024936 346          2841798846 347          3092788314 348          3364486581 349          3658467191 350          3976441876 351          4320214692 352          4691744778 353          5093097335 354          5526511602 355          5994347965 356          6499162145 357          7043648186 358          7630718671 359          8263443950 360          8945138936 361          9679297643 362         10469687646 363         11320279729 364         12235349889 365         13219404469 366         14277290236 367         15414114032 368         16635362300 369         17946814901 370         19354673930 371         20865472184 372         22486212019 373         24224267278 374         26087533643 375         28084323773 376         30223529082 377         32514508546 378         34967262684 379         37592314751 380         40400898786 381         43404832757 382         46616720518 383         50049817550 384         53718247833 385         57636860670 386         61821464449 387         66288674187 388         71056162189 389         76142496873 390         81567411419 391         87351632249 392         93517168095 393        100087127594 394        107086028628 395        114539605867 396        122475141756 397        130921262045 398        139908291043 399        149468034620 400        159634159836 401        170441966142 402        181928790813 403        194133766301 404        207098254570 405        220865589927 406        235481542190 407        250994045973 408        267453694512 409        284913452879 410        303429185857 411        323059354425 412        343865577844 413        365912314318 414        389267459099 415        414002006749 416        440190689221 417        467911618783 418        497246966079 419        528282584833 420        561108732221 421        595819672189 422        632514442353 423        671296435063 424        712274211009 425        755561059108 426        801275859118 427        849542617012 428        900491381529 429        954257753733 430       1010983857544 431       1070817824773 432       1133914822434 433       1200436509276 434       1270552124993 435       1344437917067 436       1422278292091 437       1504265214046 438       1590599420536 439       1681489788194 440       1777154619819 441       1877820975168 442       1983726028916 443       2095116368246 444       2212249424868 445       2335392734382 446       2464825448513 447       2600837554495 448       2743731467669 449       2893821211946 450       3051434096031 451       3216909849508 452       3390602389686 453       3572878910940 454       3764121741811 455       3964727389027 456       4175108488550 457       4395692797816 458       4626925247931 459       4869266881582 460       5123197006289 461       5389212078927 462       5667827963566 463       5959578755669 464       6265019152487 465       6584723213704 466       6919286843610 467       7269326489361 468       7635481738958 469       8018413948848 470       8418808965914 471       8837375680898 472       9274848873719 473       9731987693363 474      10209578630140 475      10708433913262 476      11229394619008 477      11773328981483 478      12341135635235 479      12933741839899 480      13552106861442 481      14197220100303 482      14870104620270 483      15571815175325 484      16303441884554 485      17066108157849 486      17860974520443 487      18689236426307 488      19552128242181 489      20450920942555 490      21386926250737 491      22361494215565 492      23376017513498 493      24431928894154 494      25530705653070 495      26673866939713 496      27862978398196 497      29099649337087 498      30385537541434 499      31722346290416 500      33111829351342 501      34555787837266 502      36056075379039 503      37614594822327 504      39233303581272 505      40914210159126 506      42659379693854 507      44470930294083 508      46351038772509 509      48301936795528 510      50325916807381 511      52425327976532 512      54602582321801 513      56860150445667 514      59200567856702 515      61626430488492 516      64140401221500 517      66745205168528 518      69443636407019 519      72238553020681 520      75132884036461 521      78129624219915 522      81231841219122 523      84442670093739 524      87765320677722 525      91203071830294 526      94759279010024 527      98437368245632 528     102240843924128 529     106173282459017 530     110238340304328 531     114439747308027 532     118781314944316 533     123266929349329 534     127900559773363 535     132686251275763 536     137628133409981 537     142730412563985 538     147997380868998 539     153433408182971 540     159042951225485 541     164830545178892 542     170800813062207 543     176958456936318 544     183308267507535 545     189855114934011 546     196603958660512 547     203559837800120 548     210727881214639 549     218113297456569 550     225721385084601 551     233557522163930 552     241627176819381 553     249935896266269 554     258489317615563 555     267293156421037 556     276353217726061 557     285675384124940 558     295265627053394 559     305129994336046 560     315274621737283 561     325705719979621 562     336429586543371 563     347452592155562 564     358781192841696 565     370421915855964 566     382381372002154 567     394666240991089 568     407283284019903 569     420239328556562 570     433541281180913 571     447196111767398 572     461210866607609 573     475592651976889 574     490348647526558 575     505486089237058 576     521012283085036 577     536934587353256 578     553260426593322 579     569997273279789 580     587152662058258 581     604734170747184 582     622749434876858 583     641206128010489 584     660111976597920 585     679474739604064 586     699302223666421 587     719602262037791 588     740382730055707 589     761651523370470 590     783416573752126 591     805685826594439 592     828467257050350 593     851768846820577 594     875598600626154 595     899964522255079 596     924874631401209 597     950336938960611 598     976359464227661 599    1002950209453776 600    1030117177412699 601    1057868345195045 602    1086211682173956 603    1115155123030642 604    1144706586113291 605    1174873945708909 606    1205665050808215 607    1237087696599984 608    1269149643677458 609    1301858588751637 610    1335222184292444 611    1369248008480895 612    1403943585301204 613    1439316353708705 614    1475373688210195 615    1512122867248405 616    1549571094266055 617    1587725465329523 618    1626592990693830 619    1666180561645293 620    1706494972609528 621    1747542887215360 622    1789330860941288 623    1831865306428571 624    1875152516686548 625    1919198629635734 626    1964009651915660 627    2009591422664545 628    2055949637927477 629    2103089813703016 630    2151017310973098 631    2199737298000372 632    2249254776027773 633    2299574540834782 634    2350701209103646 635    2402639179270463 636    2455392658582214 637    2508965623226933 638    2563361846130743 639    2618584856379097 640    2674637967752948 641    2731524237478957 642    2789246495528881 643    2847807302685929 644    2907208980659856 645    2967453569482805 646    3028542858437463 647    3090478342825046 648    3153261255732853 649    3216892524160984 650    3281372801682291 651    3346702423944313 652    3412881442219846 653    3479909578328192 654    3547786259101073 655    3616510570712255 656    3686081294113980 657    3756496858791478 658    3827755379165355 659    3899854607818599 660    3972791972891010 661    4046564530766019 662    4121169004511073 663    4196601736043217 664    4272858725610066 665    4349935583482269 666    4427827570497986 667    4506529549270567 668    4586036025851501 669    4666341100470600 670    4747438510307985 671    4829321579817147 672    4911983264628415 673    4995416101440403 674    5079612253106599 675    5164563458113973 676    5250261076840903 677    5336696040671980 678    5423858899445150 679    5511739770187560 680    5600328385803359 681    5689614043446161 682    5779585654429600 683    5870231692286645 684    5961540243918360 685    6053498957320960 686    6146095094019128 687    6239315476476153 688    6333146541790366 689    6427574288835366 690    6522584333229145 691    6618161854183309 692    6714291650789160 693    6810958088586958 694    6908145157139459 695    7005836416368480 696    7104015055421622 697    7202663838749386 698    7301765166303075 699    7401301019361722 700    7501253022027266 701    7601602386843987 702    7702329977589080 703    7803416254655222 704    7904841339170873 705    8006584958150181 706    8108626509899889 707    8210945008978195 708    8313519152881939 709    8416327266778085 710    8519347371498567 711    8622557128046053 712    8725933906847840 713    8829454732072484 714    8933096352127635 715    9036835183748460 716    9140647383762528 717    9244508792945678 718    9348395008996007 719    9452281330191897 720    9556142829555643 721    9659954298267308 722    9763690321033408 723    9867325219249981 724    9970833127512512 725   10074187936558122 726   10177363370888455 727   10280332931441733 728   10383069974340297 729   10485547653279647 730   10587738999328217 731   10689616863061737 732   10791153995382729 733   10892322989344543 734   10993096361994634 735   11093446495874170 736   11193345721807668 737   11292766260101878 738   11391680304241666 739   11490059961730183 740   11587877338692722 741   11685104480338701 742   11781713456388257 743   11877676301179640 744   11972965099875122 745   12067551928151070 746   12161408939178544 747   12254508302876326 748   12346822293578054 749   12438323228868060 750   12528983557886059 751   12618775799682379 752   12707672632154594 753   12795646829899064 754   12882671353685064 755   12968719287824486 756   13053763930133222 757   13137778728752338 758   13220737372587114 759   13302613727557896 760   13383381927422176 761   13463016309475063 762   13541491505700427 763   13618782377856223 764   13694864108945970 765   13769712137666260 766   13843302250100143 767   13915610513550433 768   13986613368402674 769   14056287561278035 770   14124610237055954 771   14191558871327486 772   14257111362481292 773   14321245963481667 774   14383941373963924 775   14445176671275633 776   14504931402574878 777   14563185515116493 778   14619919448256126 779   14675114063011110 780   14728750733921081 781   14780811277822859 782   14831278045561927 783   14880133849969280 784   14927362057331041 785   14972946514599961 786   15016871640574771 787   15059122352292240 788   15099684155916740 789   15138543072303315 790   15175685727506919 791   15211099277556439 792   15244771498541818 793   15276690710548182 794   15306845867323822 795   15335226479373283 796   15361822703122288 797   15386625263213894 798   15409625541131887 799   15430815496656959 800   15450187755959996 801   15467735532221058 802   15483452713112335 803   15497333780632956 804   15509373897951036 805   15519568828416239 806   15527915021776296 807   15534409532379142 808   15539050104692302 809   15541835090752144 810   15542763534960598 811   15541835090752144 812   15539050104692302 813   15534409532379142 814   15527915021776296 815   15519568828416239 816   15509373897951036 817   15497333780632956 818   15483452713112335 819   15467735532221058 820   15450187755959996 821   15430815496656959 822   15409625541131887 823   15386625263213894 824   15361822703122288 825   15335226479373283 826   15306845867323822 827   15276690710548182 828   15244771498541818 829   15211099277556439 830   15175685727506919 831   15138543072303315 832   15099684155916740 833   15059122352292240 834   15016871640574771 835   14972946514599961 836   14927362057331041 837   14880133849969280 838   14831278045561927 839   14780811277822859 840   14728750733921081 841   14675114063011110 842   14619919448256126 843   14563185515116493 844   14504931402574878 845   14445176671275633 846   14383941373963924 847   14321245963481667 848   14257111362481292 849   14191558871327486 850   14124610237055954 851   14056287561278035 852   13986613368402674 853   13915610513550433 854   13843302250100143 855   13769712137666260 856   13694864108945970 857   13618782377856223 858   13541491505700427 859   13463016309475063 860   13383381927422176 861   13302613727557896 862   13220737372587114 863   13137778728752338 864   13053763930133222 865   12968719287824486 866   12882671353685064 867   12795646829899064 868   12707672632154594 869   12618775799682379 870   12528983557886059 871   12438323228868060 872   12346822293578054 873   12254508302876326 874   12161408939178544 875   12067551928151070 876   11972965099875122 877   11877676301179640 878   11781713456388257 879   11685104480338701 880   11587877338692722 881   11490059961730183 882   11391680304241666 883   11292766260101878 884   11193345721807668 885   11093446495874170 886   10993096361994634 887   10892322989344543 888   10791153995382729 889   10689616863061737 890   10587738999328217 891   10485547653279647 892   10383069974340297 893   10280332931441733 894   10177363370888455 895   10074187936558122 896    9970833127512512 897    9867325219249981 898    9763690321033408 899    9659954298267308 900    9556142829555643 901    9452281330191897 902    9348395008996007 903    9244508792945678 904    9140647383762528 905    9036835183748460 906    8933096352127635 907    8829454732072484 908    8725933906847840 909    8622557128046053 910    8519347371498567 911    8416327266778085 912    8313519152881939 913    8210945008978195 914    8108626509899889 915    8006584958150181 916    7904841339170873 917    7803416254655222 918    7702329977589080 919    7601602386843987 920    7501253022027266 921    7401301019361722 922    7301765166303075 923    7202663838749386 924    7104015055421622 925    7005836416368480 926    6908145157139459 927    6810958088586958 928    6714291650789160 929    6618161854183309 930    6522584333229145 931    6427574288835366 932    6333146541790366 933    6239315476476153 934    6146095094019128 935    6053498957320960 936    5961540243918360 937    5870231692286645 938    5779585654429600 939    5689614043446161 940    5600328385803359 941    5511739770187560 942    5423858899445150 943    5336696040671980 944    5250261076840903 945    5164563458113973 946    5079612253106599 947    4995416101440403 948    4911983264628415 949    4829321579817147 950    4747438510307985 951    4666341100470600 952    4586036025851501 953    4506529549270567 954    4427827570497986 955    4349935583482269 956    4272858725610066 957    4196601736043217 958    4121169004511073 959    4046564530766019 960    3972791972891010 961    3899854607818599 962    3827755379165355 963    3756496858791478 964    3686081294113980 965    3616510570712255 966    3547786259101073 967    3479909578328192 968    3412881442219846 969    3346702423944313 970    3281372801682291 971    3216892524160984 972    3153261255732853 973    3090478342825046 974    3028542858437463 975    2967453569482805 976    2907208980659856 977    2847807302685929 978    2789246495528881 979    2731524237478957 980    2674637967752948 981    2618584856379097 982    2563361846130743 983    2508965623226933 984    2455392658582214 985    2402639179270463 986    2350701209103646 987    2299574540834782 988    2249254776027773 989    2199737298000372 990    2151017310973098 991    2103089813703016 992    2055949637927477 993    2009591422664545 994    1964009651915660 995    1919198629635734 996    1875152516686548 997    1831865306428571 998    1789330860941288 999    17475428872153601000    17064949726095281001    16661805616452931002    16265929906938301003    15877254653295231004    15495710942660551005    15121228672484051006    14753736882101951007    14393163537087051008    14039435853012041009    13692480084808951010    13352221842924441011    13018585887516371012    12691496436774581013    12370876965999841014    12056650508082151015    11748739457089091016    11447065861132911017    11151551230306421018    10862116821739561019    10578683451950451020    10301171774126991021    10029502094537761022     9763594642276611023     9503369389606111024     9248746314012091025     8999645222550791026     8755986006261541027     8517688468205771028     8284672570503501029     8056858265944391030     7834165737521261031     7616515233704701032     7403827300557071033     7196022620377911034     6993022236664211035     6794747396040641036     6601119765979201037     6412061280104891038     6227494348768581039     6047341707471841040     5871526620582581041     5699972732797891042     5532604265933221043     5369345873532561044     5210122830850361045     5054860892370581046     4903486475265581047     4755926519768891048     4612108666076091049     4471961117673981050     4335412811809131051     4202393285565621052     4072832840199031053     3946662409910891054     3823813720021541055     3704219158559641056     3587811928416961057     3474525921555621058     3364295865433711059     3257057199796211060     3152746217372831061     3051299943360461062     2952656270533941063     2856753841249401064     2763532177260611065     2672931564210371066     2584893176155631067     2499358962662691068     2416271768193811069     2335575221639301070     2257213850846011071     2181132974565691072     2107278812146391073     2035598378001201074     1966039586605121075     1898551149340111076     1833082675075351077     1769584569363181078     1708008130622071079     1648305451788921080     1590429512254851081     1534334081829711082     1479973808689981083     1427304125639851084     1376281334099811085     1326862512757631086     1279005597733631087     1232669293493291088     1187813149443161089     1144397473080271090     1102383403043281091     1061732824590171092     1022408439241281093      984373682456321094      947592790100241095      912030718302941096      877653206777221097      844426700937391098      812318412191221099      781296242199151100      751328840364611101      722385530206811102      694436364070191103      667452051685281104      641404012215001105      616264304884921106      592005678567021107      568601504456671108      546025823218011109      524253279765321110      503259168073811111      483019367955281112      463510387725091113      444709302940831114      426593796938541115      409142101591261116      392333035812721117      376145948223271118      360560753790391119      345557878372661120      331118293513421121      317223462904161122      303855375414341123      290996493370871124      278629783981961125      266738669397131126      255307056530701127      244319288941541128      233760175134981129      223614942155651130      213869262507371131      204509209425551132      195521282421811133      186892364263071134      178609745204431135      170661081578491136      163034418845541137      155718151753251138      148701046202701139      141972201003031140      135521068614421141      129337418398991142      123411356352351143      117733289814831144      112293946190081145      107084339132621146      102095786301401147       97319876933631148       92748488737191149       88373756808981150       84188089659141151       80184139488481152       76354817389581153       72693264893611154       69192868436101155       65847232137041156       62650191524871157       59595787556691158       56678279635661159       53892120789271160       51231970062891161       48692668815821162       46269252479311163       43956927978161164       41751084885501165       39647273890271166       37641217418111167       35728789109401168       33906023896861169       32169098495081170       30514340960311171       28938212119461172       27437314676691173       26008375544951174       24648254485131175       23353927343821176       22122494248681177       20951163682461178       19837260289161179       18778209751681180       17771546198191181       16814897881941182       15905994205361183       15042652140461184       14222782920911185       13444379170671186       12705521249931187       12004365092761188       11339148224341189       10708178247731190       10109838575441191        9542577537331192        9004913815291193        8495426170121194        8012758591181195        7555610591081196        7122742110091197        6712964350631198        6325144423531199        5958196721891200        5611087322211201        5282825848331202        4972469660791203        4679116187831204        4401906892211205        4140020067491206        3892674590991207        3659123143181208        3438655778441209        3230593544251210        3034291858571211        2849134528791212        2674536945121213        2509940459731214        2354815421901215        2208655899271216        2070982545701217        1941337663011218        1819287908131219        1704419661421220        1596341598361221        1494680346201222        1399082910431223        1309212620451224        1224751417561225        1145396058671226        1070860286281227        1000871275941228         935171680951229         873516322491230         815674114191231         761424968731232         710561621891233         662886741871234         618214644491235         576368606701236         537182478331237         500498175501238         466167205181239         434048327571240         404008987861241         375923147511242         349672626841243         325145085461244         302235290821245         280843237731246         260875336431247         242242672781248         224862120191249         208654721841250         193546739301251         179468149011252         166353623001253         154141140321254         142772902361255         132194044691256         122353498891257         113202797291258         104696876461259          96792976431260          89451389361261          82634439501262          76307186711263          70436481861264          64991621451265          59943479651266          55265116021267          50930973351268          46917447781269          43202146921270          39764418761271          36584671911272          33644865811273          30927883141274          28417988461275          26100249361276          23960960821277          21987116181278          20166798811279          18488694961280          16942459901281          15518268891282          14207154891283          13000599541284          11890844111285          10870513471286           9932905711287           9071646671288           8280956291289           7555334681290           6889806431291           6279632661292           5720538511293           5208448711294           4739695871295           4310781381296           3918565811297           3560050001298           3232551641299           2933504871300           2660621681301           2411711011302           2184825691303           1978097291304           1789872251305           1618560931306           1462761241307           1321123281308           1192461461309           1075631031310            969631691311            873495011312            786378421313            707464441314            636045401315            571432011316            513031481317            460264311318            412634621319            369656201320            330915781321            296005871322            264582971323            236306641324            210891761325            188054641326            167559571327            149170241328            132692501329            117930281330            104723751331             92910601332             82360011333             72937671334             64536841335             57046861336             50380701337             44447481338             39176701339             34493591340             30341351341             26658851342             23400241343             20515691344             17968551345             15718121346             13735241347             11986891348             10449841349              9097411350              7911311351              6869831352              5958721353              5160541354              4464051355              3855281356              3325571357              2863641358              2462881359              2114281360              1812741361              1551121362              1325591363              1130391364               962711365               818011366               694141367               587541368               496681369               418691370               352511371               295881372               248031373               207221374               172931375               143751376               119371377                98711378                81541379                67031380                55071381                44981382                36731383                29801384                24171385                19461386                15681387                12511388                10001389                 7911390                 6271391                 4901392                 3851393                 2971394                 2311395                 1761396                 1351397                 1011398                  771399                  561400                  421401                  301402                  221403                  151404                  111405                   71406                   51407                   31408                   21409                   11410                   1Sum: 3535316142212174320`

There is a direct correspondence between this method and the method others have posted of expanding a very large polynomial and looking at certain coefficients. But I wrote this code before realizing how direct the correspondence was, and also no one else has really explained how an efficient calculation of the coefficients works, so here we are.

With regard to the part of the comment by ThatDonGuy specifically about looking at all 280 products, this is not necessary because the largest term, expanding the full polynomial that includes sums of more the 20 balls, is x80y1410. If you collect like terms, there are "only" 81*1411=114291 terms in the full product. If you collect like terms at each stage (each multiplication by (1+xyn)), the number of terms remains manageable at each stage.

However, I think ThatDonGuy has a great explanation of why the polynomial expansion works and I have nothing to add to it. (I just have an explanation of how to efficiently do this calculation.)
weezrDASvegas
Joined: Feb 2, 2018
• Posts: 69
May 21st, 2019 at 2:25:23 AM permalink
Quote: Wizard

I am doing a software review of a company that offers prop bets on the sum of the balls in keno. As a reminder, in keno the game draws 20 numbers from a 80 balls numbered 1 to 80. The problem at hand is finding a probability of any given total without using a simulation.

I do know simulations are a perfectly valid way of analyzing casino games, but I also feel more satisfied finding an exact answer. At first I wrote a simple program to loop through 3,535,316,142,212,180,000 possible ways to choose 20 out of 80 balls. Needless to say, it would have taken centuries to cycle through them all. I've also toyed with shortcut code, but I fear I'll die before the program is done running.

I've also just counted combinations by hand, hoping to find a pattern (maybe some variant of Fibonaci), but so far have not found anything. So, at this point I open it up to the forum. You do not have to put replies in spoiler tags and may refer to any outside sources. This isn't the usual math puzzle thread.

The question for the poll is what are your thoughts on it?

In this spoiler tag are the results of my simulation. I excluded extreme totals where the probability was less than 1 in a million. It's a big table, so I won't clutter up the thread with it, unless you want to see it. The third column is the expected count per million games.

Aint a formula for that. gotta do it in soft code - iterate thru all combos in the game.

There is a website that shows the sums for many lottery games but no keno. probably keno has too many combos compared 2 lottos, even mega mills or powerball.

Total powerball combos (5 of 69 & 1 26)=292,201,338
Total keno combos (20 from 80)=3.53531614221217E+18 (19 digit number... very, very large for the computers).

But looks like the right algo exists and applicable to any lotto game.

https://saliu.com/forum/lottery-sums.html

Powerball 5/69 & 1/26 Lottery SUMS Chart

Sum-total Combinations Percentage

16 1 0.00%
17 2 0.00%
18 4 0.00%
19 7 0.00%
20 12 0.00%
21 19 0.00%
22 29 0.00%
23 42 0.00%
24 60 0.00%
25 83 0.00%
26 113 0.00%
27 150 0.00%
28 197 0.00%
29 254 0.00%
30 324 0.00%
31 408 0.00%
32 509 0.00%
33 628 0.00%
34 769 0.00%
35 933 0.00%
36 1125 0.00%
37 1346 0.00%
38 1601 0.00%
39 1892 0.00%
40 2225 0.00%
41 2602 0.00%
42 3028 0.00%
43 3507 0.00%
44 4045 0.00%
45 4645 0.00%
46 5314 0.00%
47 6055 0.00%
48 6876 0.00%
49 7781 0.00%
50 8777 0.00%
51 9869 0.00%
52 11065 0.00%
53 12370 0.00%
54 13792 0.00%
55 15337 0.01%
56 17014 0.01%
57 18828 0.01%
58 20789 0.01%
59 22903 0.01%
60 25180 0.01%
61 27627 0.01%
62 30253 0.01%
63 33066 0.01%
64 36077 0.01%
65 39293 0.01%
66 42725 0.01%
67 46381 0.02%
68 50273 0.02%
69 54409 0.02%
70 58801 0.02%
71 63458 0.02%
72 68392 0.02%
73 73613 0.03%
74 79133 0.03%
75 84962 0.03%
76 91114 0.03%
77 97598 0.03%
78 104428 0.04%
79 111615 0.04%
80 119173 0.04%
81 127112 0.04%
82 135446 0.05%
83 144186 0.05%
84 153346 0.05%
85 162936 0.06%
86 172970 0.06%
87 183457 0.06%
88 194412 0.07%
89 205843 0.07%
90 217763 0.07%
91 230181 0.08%
92 243109 0.08%
93 256554 0.09%
94 270528 0.09%
95 285037 0.10%
96 300092 0.10%
97 315697 0.11%
98 331862 0.11%
99 348590 0.12%
100 365890 0.13%
101 383763 0.13%
102 402215 0.14%
103 421247 0.14%
104 440864 0.15%
105 461063 0.16%
106 481848 0.16%
107 503215 0.17%
108 525166 0.18%
109 547695 0.19%
110 570802 0.20%
111 594480 0.20%
112 618727 0.21%
113 643534 0.22%
114 668897 0.23%
115 694806 0.24%
116 721256 0.25%
117 748233 0.26%
118 775731 0.27%
119 803736 0.28%
120 832239 0.28%
121 861224 0.29%
122 890680 0.30%
123 920590 0.32%
124 950942 0.33%
125 981716 0.34%
126 1012898 0.35%
127 1044467 0.36%
128 1076408 0.37%
129 1108697 0.38%
130 1141317 0.39%
131 1174244 0.40%
132 1207458 0.41%
133 1240933 0.42%
134 1274648 0.44%
135 1308575 0.45%
136 1342692 0.46%
137 1376968 0.47%
138 1411379 0.48%
139 1445894 0.49%
140 1480487 0.51%
141 1515124 0.52%
142 1549777 0.53%
143 1584412 0.54%
144 1618999 0.55%
145 1653501 0.57%
146 1687887 0.58%
147 1722119 0.59%
148 1756165 0.60%
149 1789986 0.61%
150 1823548 0.62%
151 1856813 0.64%
152 1889746 0.65%
153 1922308 0.66%
154 1954464 0.67%
155 1986176 0.68%
156 2017409 0.69%
157 2048124 0.70%
158 2078287 0.71%
159 2107861 0.72%
160 2136812 0.73%
161 2165104 0.74%
162 2192703 0.75%
163 2219576 0.76%
164 2245691 0.77%
165 2271015 0.78%
166 2295518 0.79%
167 2319170 0.79%
168 2341943 0.80%
169 2363809 0.81%
170 2384742 0.82%
171 2404718 0.82%
172 2423713 0.83%
173 2441705 0.84%
174 2458673 0.84%
175 2474598 0.85%
176 2489462 0.85%
177 2503247 0.86%
178 2515938 0.86%
179 2527521 0.86%
180 2537983 0.87%
181 2547312 0.87%
182 2555497 0.87%
183 2562530 0.88%
184 2568403 0.88%
185 2573109 0.88%
186 2576643 0.88%
187 2579001 0.88%

188 2580181 0.88%
189 2580181 0.88%

190 2579001 0.88%
191 2576643 0.88%
192 2573109 0.88%
193 2568403 0.88%
194 2562530 0.88%
195 2555497 0.87%
196 2547312 0.87%
197 2537983 0.87%
198 2527521 0.86%
199 2515938 0.86%
200 2503247 0.86%
201 2489462 0.85%
202 2474598 0.85%
203 2458673 0.84%
204 2441705 0.84%
205 2423713 0.83%
206 2404718 0.82%
207 2384742 0.82%
208 2363809 0.81%
209 2341943 0.80%
210 2319170 0.79%
211 2295518 0.79%
212 2271015 0.78%
213 2245691 0.77%
214 2219576 0.76%
215 2192703 0.75%
216 2165104 0.74%
217 2136812 0.73%
218 2107861 0.72%
219 2078287 0.71%
220 2048124 0.70%
221 2017409 0.69%
222 1986176 0.68%
223 1954464 0.67%
224 1922308 0.66%
225 1889746 0.65%
226 1856813 0.64%
227 1823548 0.62%
228 1789986 0.61%
229 1756165 0.60%
230 1722119 0.59%
231 1687887 0.58%
232 1653501 0.57%
233 1618999 0.55%
234 1584412 0.54%
235 1549777 0.53%
236 1515124 0.52%
237 1480487 0.51%
238 1445894 0.49%
239 1411379 0.48%
240 1376968 0.47%
241 1342692 0.46%
242 1308575 0.45%
243 1274648 0.44%
244 1240933 0.42%
245 1207458 0.41%
246 1174244 0.40%
247 1141317 0.39%
248 1108697 0.38%
249 1076408 0.37%
250 1044467 0.36%
251 1012898 0.35%
252 981716 0.34%
253 950942 0.33%
254 920590 0.32%
255 890680 0.30%
256 861224 0.29%
257 832239 0.28%
258 803736 0.28%
259 775731 0.27%
260 748233 0.26%
261 721256 0.25%
262 694806 0.24%
263 668897 0.23%
264 643534 0.22%
265 618727 0.21%
266 594480 0.20%
267 570802 0.20%
268 547695 0.19%
269 525166 0.18%
270 503215 0.17%
271 481848 0.16%
272 461063 0.16%
273 440864 0.15%
274 421247 0.14%
275 402215 0.14%
276 383763 0.13%
277 365890 0.13%
278 348590 0.12%
279 331862 0.11%
280 315697 0.11%
281 300092 0.10%
282 285037 0.10%
283 270528 0.09%
284 256554 0.09%
285 243109 0.08%
286 230181 0.08%
287 217763 0.07%
288 205843 0.07%
289 194412 0.07%
290 183457 0.06%
291 172970 0.06%
292 162936 0.06%
293 153346 0.05%
294 144186 0.05%
295 135446 0.05%
296 127112 0.04%
297 119173 0.04%
298 111615 0.04%
299 104428 0.04%
300 97598 0.03%
301 91114 0.03%
302 84962 0.03%
303 79133 0.03%
304 73613 0.03%
305 68392 0.02%
306 63458 0.02%
307 58801 0.02%
308 54409 0.02%
309 50273 0.02%
310 46381 0.02%
311 42725 0.01%
312 39293 0.01%
313 36077 0.01%
314 33066 0.01%
315 30253 0.01%
316 27627 0.01%
317 25180 0.01%
318 22903 0.01%
319 20789 0.01%
320 18828 0.01%
321 17014 0.01%
322 15337 0.01%
323 13792 0.00%
324 12370 0.00%
325 11065 0.00%
326 9869 0.00%
327 8777 0.00%
328 7781 0.00%
329 6876 0.00%
330 6055 0.00%
331 5314 0.00%
332 4645 0.00%
333 4045 0.00%
334 3507 0.00%
335 3028 0.00%
336 2602 0.00%
337 2225 0.00%
338 1892 0.00%
339 1601 0.00%
340 1346 0.00%
341 1125 0.00%
342 933 0.00%
343 769 0.00%
344 628 0.00%
345 509 0.00%
346 408 0.00%
347 324 0.00%
348 254 0.00%
349 197 0.00%
350 150 0.00%
351 113 0.00%
352 83 0.00%
353 60 0.00%
354 42 0.00%
355 29 0.00%
356 19 0.00%
357 12 0.00%
358 7 0.00%
359 4 0.00%
360 2 0.00%
361 1 0.00%

Total: 346 292201338 100%

Quote: Wizard

Note: Post formatting corrected by management.

Last edited by: unnamed administrator on May 21, 2019
Wizard
Joined: Oct 14, 2009
• Posts: 25465
May 21st, 2019 at 6:40:07 AM permalink
I get the theory about finding the generating function, but to actually do it would be the equal amount of work as just cycling through all combin(80,20) balls by brute force.

ZPP, thanks for the code, I think I will try that method next. I started to go down that road, but didn't finishing, thinking it would only cut down centuries of computer time to years. Let's see what happens....
“Extraordinary claims require extraordinary evidence.” -- Carl Sagan
7craps
Joined: Jan 23, 2010
• Posts: 1977
May 21st, 2019 at 7:28:40 AM permalink
Quote: Wizard

I get the theory about finding the generating function, but to actually do it would be the equal amount of work as just cycling through all combin(80,20) balls by brute force.

the generating function is also easily changed for the values on the balls. say instead of 1 to 80 they were 0 to 79. simple adjustment

it takes 0ms on my 10 year old Dell 2 core laptop for all the calculations (according to pari/gp calculator) and it is actually doing all the draws from 0 to 80 inclusive and prints to a text file.

from there it is easy (for me) to get what is needed into Excel or work on the results further in pari.
generating functions go way back and it makes sense why.(they had no computers to do it then)
even poker gurus now (like BA) uses GFs to describe getting particular hands and so on.

of course there are 'expert computer guys and gals' that can do excellent code for almost any problem.

some get (and can use) generating functions and add them to their toolbox, others never get them for whatever reason(s).

added: reminds me of learning inclusion-exclusion and wondering why we have to do it this way. add and subtract over-counts seemed way confusing and not required as they were always another way to solve the problem. Most now, that even do not understand PIE, still use it in a computer to solve some problems because it IS so easy and follows basic counting methods. example code for coupon collecting problem: n=6;\\number of coupons
t=10;\\number of draws
x=sum(k=0,n,(-1)^k*binomial(n,k)*(1-(k/n))^t);

this was so confusing at 1st: (-1)^k*binomial(n,k)*(1-(k/n))^t
Last edited by: 7craps on May 21, 2019
winsome johnny (not Win some johnny)
charliepatrick
Joined: Jun 17, 2011
• Posts: 2828
Thanks for this post from:
May 21st, 2019 at 7:34:51 AM permalink
I'm about to go out (it's afternoon shoping here) but here's an idea I might look at later.
(i) Split the numbers into blocks 1-10, 11-20 etc. (consider 1-10 as 0*10+1 thru 0*10+10, 2-20 at 1*10+1 thru 1*10+10...)
(ii) Similar to working out poker hands, you can have a pattern of (a) 10 in one block, 10 in another (b) 10 9 1 (c) 10 8 2 (d) 10 8 1 1 etc.
(iii) Work out the permutations for various numbers of balls within a block for the digits. (e..g 1 number in block can be 1:1 2:1 ... 10:1).
(iv) Work out the permutations for various blocks being used, this will only affect the tens value of the total.
(v) Add together the digits part from (iii) and the tens part from (iv).
e.g. Looking at {10,10}, the sum of the digits part is fixed at 55+55=110. The sum of the tens part can be 10*0+10*10, 10*0+10*20, 10*10+10*10 etc. This gets 1 combination for 210 etc.
e.g. Looking at (10,9,1), the sum of the digits part can be {55}+{45,47,48,49...54)+(1,2,3,4,...,9,10}. Then the tens can be 10*0+9*10+1*20 etc.
gordonm888
Joined: Feb 18, 2015
• Posts: 4409
May 21st, 2019 at 10:21:34 AM permalink
Quote: charliepatrick

I'm about to go out (it's afternoon shoping here) but here's an idea I might look at later.
(i) Split the numbers into blocks 1-10, 11-20 etc. (consider 1-10 as 0*10+1 thru 0*10+10, 2-20 at 1*10+1 thru 1*10+10...)
(ii) Similar to working out poker hands, you can have a pattern of (a) 10 in one block, 10 in another (b) 10 9 1 (c) 10 8 2 (d) 10 8 1 1 etc.
(iii) Work out the permutations for various numbers of balls within a block for the digits. (e..g 1 number in block can be 1:1 2:1 ... 10:1).
(iv) Work out the permutations for various blocks being used, this will only affect the tens value of the total.
(v) Add together the digits part from (iii) and the tens part from (iv).
e.g. Looking at {10,10}, the sum of the digits part is fixed at 55+55=110. The sum of the tens part can be 10*0+10*10, 10*0+10*20, 10*10+10*10 etc. This gets 1 combination for 210 etc.
e.g. Looking at (10,9,1), the sum of the digits part can be {55}+{45,47,48,49...54)+(1,2,3,4,...,9,10}. Then the tens can be 10*0+9*10+1*20 etc.

I like this approach, ingenious. I wonder whether it might be slightly more efficient in base 9.

edit: Or 4-tier it in base 3.
Last edited by: gordonm888 on May 21, 2019
So many better men, a few of them friends, are dead. And a thousand thousand slimy things live on, and so do I.