import math
a = int(raw_input('Enter Average:')) # Average number probability
c = int(raw_input('Enter first number:')) #
d = int(raw_input('Enter last number:')) #
e = 2.71828
for b in range(c,d+1):
x = (a**b)/math.factorial(b)*(e**-a)
odd = round (1/x*0.92, 2)
print odd
For expected number of points in the range from-to, it calculates how much the odds for each correct number of points.
示例:如果预期的点数为200,那么范围189-192的奇数是多少? 我计算了189,190,191,192范围内每个数字的赔率。 (43.17,41.0,39.16,37.59) 如何计算最终赔率?
x = 41.0/(41.0/43.17+41.0/39.16+41.0/37.59+1) = **10.03**
但我不知道如何提前计算列表的长度。
答案 0 :(得分:0)
如果我理解正确,请将所有赔率添加到列表中,然后
伪代码:
sum = 1;
for odds in theListOfOdds
sum += (b/odds)
result = b/sum