Skip to content

Instantly share code, notes, and snippets.

import math
def comb(n, k):
return int(math.factorial(n)/(math.factorial(k)*math.factorial(n-k)))
def lorita_sum(number_machines, available_machines, availability_percent):
result = 0
prob = availability_percent / 100
for i in range(number_machines-available_machines+1):
result += comb(number_machines, i) * math.pow(1-prob, i) * math.pow(prob, number_machines-i)

Keybase proof

I hereby claim:

  • I am francoismalan on github.
  • I am fmalan (https://keybase.io/fmalan) on keybase.
  • I have a public key whose fingerprint is 8ACE DDA4 D562 A349 E02A 80C1 59E1 943B 0B94 AA5E

To claim this, I am signing this object: