Question intéressante !
Ma réponse est un peu tardive et aboutit aux mêmes conclusions que les autres, mais je tenais à l'inclure car elle fournit des valeurs exactes qui manquent dans les réponses précédentes.
Je me suis concentré sur la distribution des chances d'obtenir chaque nombre d'utilisations pour votre dé. J'ai inclus quelques graphiques pour être complet.
Elle a été calculée en créant des séries infinies où le coefficient de x^n
correspond à la probabilité d'obtenir n
d'une potion. Je développe le polynôme par termes.
par exemple :
d4 = (3/4 * x) * sum(i=0..inf) (x * 1/4)^i
d6 = (3/6 * x) * sum(i=0..inf) (x * 3/6)^i * d4
d8 = (3/8 * x) * sum(i=0..inf) (x * 5/8)^i * d6
d10 = (3/10 * x) * sum(i=0..inf)(x * 7/10)^i * d8
Et calculez le coefficient à l'aide d'une multiplication (à peu près équivalente à la méthode python ci-dessous) :
def _coef(n, *args):
# Sum all possible products such that the total exponent adds to n
# This can be calculated recursively, e.g.:
# f(2, a,b,c) -> a^2 + ab + ac + b^2 + bc + c^2
# a(a+b+c) + b(b+c) + c(c)
# a*f(1, a,b,c) + b*f(1, b,c) + c*f(1, c)
if n <= 0:
ret = 1
elif n == 1:
ret = sum(args)
else:
total = 0
for i, a in enumerate(args):
total += a * _coef(n - 1, *args[i:])
ret = total
return ret
def coef(n, *args):
if n < len(args):
return 0
fail_factor = product((1 - a) for a in args)
coef_factor = _coef(n - len(args), *args)
return fail_factor * coef_factor
Toutes mes excuses aux utilisateurs de téléphones portables.
Pour le dé d4
+--------+---------------+--------------+---------------------+--------------------+
| Uses | Probability | Cumulative | Probability Exact | Cumulative Exact |
+========+===============+==============+=====================+====================+
| 0 | 0 | 0 | 0 | 0 |
+--------+---------------+--------------+---------------------+--------------------+
| 1 | 0.75 | 0.75 | 3/4 | 3/4 |
+--------+---------------+--------------+---------------------+--------------------+
| 2 | 0.1875 | 0.9375 | 3/16 | 15/16 |
+--------+---------------+--------------+---------------------+--------------------+
| 3 | 0.046875 | 0.984375 | 3/64 | 63/64 |
+--------+---------------+--------------+---------------------+--------------------+
| 4 | 0.0117188 | 0.996094 | 3/256 | 255/256 |
+--------+---------------+--------------+---------------------+--------------------+
| 5 | 0.00292969 | 0.999023 | 3/1024 | 1023/1024 |
+--------+---------------+--------------+---------------------+--------------------+
Pour le dé d6
+--------+---------------+--------------+---------------------+--------------------+
| Uses | Probability | Cumulative | Probability Exact | Cumulative Exact |
+========+===============+==============+=====================+====================+
| 0 | 0 | 0 | 0 | 0 |
+--------+---------------+--------------+---------------------+--------------------+
| 1 | 0 | 0 | 0 | 0 |
+--------+---------------+--------------+---------------------+--------------------+
| 2 | 0.375 | 0.375 | 3/8 | 3/8 |
+--------+---------------+--------------+---------------------+--------------------+
| 3 | 0.28125 | 0.65625 | 9/32 | 21/32 |
+--------+---------------+--------------+---------------------+--------------------+
| 4 | 0.164062 | 0.820312 | 21/128 | 105/128 |
+--------+---------------+--------------+---------------------+--------------------+
| 5 | 0.0878906 | 0.908203 | 45/512 | 465/512 |
+--------+---------------+--------------+---------------------+--------------------+
| 6 | 0.0454102 | 0.953613 | 93/2048 | 1953/2048 |
+--------+---------------+--------------+---------------------+--------------------+
| 7 | 0.0230713 | 0.976685 | 189/8192 | 8001/8192 |
+--------+---------------+--------------+---------------------+--------------------+
| 8 | 0.0116272 | 0.988312 | 381/32768 | 32385/32768 |
+--------+---------------+--------------+---------------------+--------------------+
| 9 | 0.00583649 | 0.994148 | 765/131072 | 130305/131072 |
+--------+---------------+--------------+---------------------+--------------------+
| 10 | 0.00292397 | 0.997072 | 1533/524288 | 522753/524288 |
+--------+---------------+--------------+---------------------+--------------------+
| 11 | 0.00146341 | 0.998536 | 3069/2097152 | 2094081/2097152 |
+--------+---------------+--------------+---------------------+--------------------+
| 12 | 0.000732064 | 0.999268 | 6141/8388608 | 8382465/8388608 |
+--------+---------------+--------------+---------------------+--------------------+
Pour le dé d8
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| Uses | Probability | Cumulative | Probability Exact | Cumulative Exact |
+========+===============+==============+===================================+=======================================+
| 0 | 0 | 0 | 0 | 0 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 1 | 0 | 0 | 0 | 0 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 2 | 0 | 0 | 0 | 0 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 3 | 0.140625 | 0.140625 | 9/64 | 9/64 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 4 | 0.193359 | 0.333984 | 99/512 | 171/512 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 5 | 0.182373 | 0.516357 | 747/4096 | 2115/4096 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 6 | 0.146942 | 0.6633 | 4815/32768 | 21735/32768 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 7 | 0.108868 | 0.772167 | 28539/262144 | 202419/262144 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 8 | 0.076694 | 0.848861 | 160839/2097152 | 1780191/2097152 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 9 | 0.052294 | 0.901155 | 877347/16777216 | 15118875/16777216 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 10 | 0.0348724 | 0.936028 | 4680495/134217728 | 125631495/134217728 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 11 | 0.0228917 | 0.958919 | 24579819/1073741824 | 1029631779/1073741824 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 12 | 0.0148561 | 0.973775 | 127613079/8589934592 | 8364667311/8589934592 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 13 | 0.0095596 | 0.983335 | 656930547/68719476736 | 67574269035/68719476736 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 14 | 0.00611204 | 0.989447 | 3360131775/549755813888 | 543954284055/549755813888 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 15 | 0.00388868 | 0.993336 | 17102611899/4398046511104 | 4368736884339/4398046511104 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 16 | 0.00246476 | 0.995801 | 86720945319/35184372088832 | 35036616020031/35184372088832 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 17 | 0.00155764 | 0.997358 | 438436417347/281474976710656 | 280731364577595/281474976710656 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 18 | 0.000982107 | 0.99834 | 2211509144655/2251799813685248 | 2248062425765415/2251799813685248 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 19 | 0.000618109 | 0.998958 | 11134854544779/18014398509481984 | 17995634260668099/18014398509481984 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
| 20 | 0.000388464 | 0.999347 | 55983509189559/144115188075855872 | 144021057594534351/144115188075855872 |
+--------+---------------+--------------+-----------------------------------+---------------------------------------+
Pour le dé d10
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| Uses | Probability | Cumulative | Probability Exact | Cumulative Exact |
+========+===============+==============+===================================================================================+=======================================================================================+
| 0 | 0 | 0 | 0 | 0 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 1 | 0 | 0 | 0 | 0 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 2 | 0 | 0 | 0 | 0 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 3 | 0 | 0 | 0 | 0 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 4 | 0.0421875 | 0.0421875 | 27/640 | 27/640 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 5 | 0.0875391 | 0.129727 | 2241/25600 | 3321/25600 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 6 | 0.115989 | 0.245716 | 118773/1024000 | 251613/1024000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 7 | 0.125275 | 0.370991 | 5131269/40960000 | 15195789/40960000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 8 | 0.120353 | 0.491344 | 197186157/1638400000 | 805017717/1638400000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 9 | 0.107255 | 0.598599 | 7029078021/65536000000 | 39229786701/65536000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 10 | 0.0907668 | 0.689366 | 237939825213/2621440000000 | 1807131293253/2621440000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 11 | 0.0739985 | 0.763364 | 7759306121589/104857600000000 | 80044557851709/104857600000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 12 | 0.0586665 | 0.822031 | 246065046795117/4194304000000000 | 3447847360863477/4194304000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 13 | 0.0455234 | 0.867554 | 7637554195028901/167772160000000000 | 145551448629567981/167772160000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 14 | 0.0347342 | 0.902288 | 233097529579949853/6710886400000000000 | 6055155474762669093/6710886400000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 15 | 0.0261476 | 0.928436 | 7018937631217111509/268435456000000000000 | 249225156621723875229/268435456000000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 16 | 0.0194699 | 0.947906 | 209056580748542012877/10737418240000000000000 | 10178062845617497022037/10737418240000000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 17 | 0.0143684 | 0.962274 | 6171165847820748626181/429496729600000000000000 | 413293679672520629507661/429496729600000000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 18 | 0.0105251 | 0.972799 | 180820654310520268173693/17179869184000000000000000 | 16712567841211345448480133/17179869184000000000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 19 | 0.00766224 | 0.980462 | 5265448029983050174879029/687194767360000000000000000 | 673768161678436868114084349/687194767360000000000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 20 | 0.005549 | 0.986011 | 152529676741737471547003437/27487790694400000000000000000 | 27103256143879212196110377397/27487790694400000000000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 21 | 0.00400084 | 0.990012 | 4398967032423950869575861861/1099511627776000000000000000000 | 1088529212787592438713990957741/1099511627776000000000000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 22 | 0.00287374 | 0.992885 | 126388634748253166004618272733/43980465111040000000000000000000 | 43667557146251950714564256582373/43980465111040000000000000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 23 | 0.00205751 | 0.994943 | 3619603834210652189541665152149/1759218604441600000000000000000000 | 1750321889684288680772111928447069/1759218604441600000000000000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 24 | 0.00146901 | 0.996412 | 103372621197087349842475462150797/70368744177664000000000000000000000 | 70116248208568634580726952600033557/70368744177664000000000000000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 25 | 0.00104632 | 0.997458 | 2945139485679173008972033887487941/2814749767106560000000000000000000000 | 2807595067828424556238050137888830221/2814749767106560000000000000000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 26 | 0.000743706 | 0.998202 | 83733822826925024585784972531302973/112589990684262400000000000000000000000 | 112387536535963907274107790488084511813/112589990684262400000000000000000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 27 | 0.000527654 | 0.998729 | 2376340268332105196766179822917498869/4503599627370496000000000000000000000000 | 4497877801706888396161077799346297971389/4503599627370496000000000000000000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+
| 28 | 0.000373775 | 0.999103 | 67333264212391058218558049842715358957/180143985094819840000000000000000000000000 | 179982445332487926904661670023694634214517/180143985094819840000000000000000000000000 |
+--------+---------------+--------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+