Testing OpenID login...also deleted and reposted because I can't count.
Anyway, experimental verification. What I was interested in is the probability that, given that your chance of dying is universal (x), seven people out of one pool of nine would die, and fourteen out of a second pool of forty-six would die (I think this is how your numbers work). Unfortunately, I got a different answer...
My calculation (indentations all screwed up):
#!/usr/bin/env python
import random
def probCalculator(nTimes = 1000): """ Silly calculator for running probabilities
""" random.seed()
results = {}
for prob in [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]: results[prob] = 0 for iteration in range(nTimes): # Do this however many times you want nPOC = 0 nWh = 0 for person in range(9): # Do it over nine people if random.uniform(0.0, 1.0) < prob: nPOC += 1 for person in range(46): # Do it 46 people if random.uniform(0.0, 1.0) < prob: nWh += 1
if nPOC >= 7 and nWh <= 14: # If we meet the critera, record it results[prob] += 1
for prob in results.keys(): print "The percentage chance of this happening for probability %f is %f" % (prob, float(results[prob])/nTimes)
Results from first iteration: >>> probCalculator(nTimes = 500000) The percentage chance of this happening for probability 0.500000 is 0.000510 The percentage chance of this happening for probability 0.200000 is 0.000334 The percentage chance of this happening for probability 0.400000 is 0.002974 The percentage chance of this happening for probability 0.800000 is 0.000000 The percentage chance of this happening for probability 0.300000 is 0.002680 The percentage chance of this happening for probability 0.600000 is 0.000008 The percentage chance of this happening for probability 0.100000 is 0.000004 The percentage chance of this happening for probability 0.900000 is 0.000000 The percentage chance of this happening for probability 0.700000 is 0.000000
For the second iteration, scan over probabilities from 0.30 to 0.45: The percentage chance of this happening for probability 0.430000 is 0.002090 The percentage chance of this happening for probability 0.360000 is 0.003758 The percentage chance of this happening for probability 0.400000 is 0.002928 The percentage chance of this happening for probability 0.330000 is 0.003212 The percentage chance of this happening for probability 0.440000 is 0.001822 The percentage chance of this happening for probability 0.370000 is 0.003514 The percentage chance of this happening for probability 0.300000 is 0.002574 The percentage chance of this happening for probability 0.410000 is 0.002774 The percentage chance of this happening for probability 0.340000 is 0.003388 The percentage chance of this happening for probability 0.450000 is 0.001474 The percentage chance of this happening for probability 0.380000 is 0.003612 The percentage chance of this happening for probability 0.310000 is 0.002910 The percentage chance of this happening for probability 0.420000 is 0.002558 The percentage chance of this happening for probability 0.350000 is 0.003500 The percentage chance of this happening for probability 0.390000 is 0.003142 The percentage chance of this happening for probability 0.320000 is 0.003112
So I'm getting the chances being even lower, that is for a maximal chance of about 36% that a given character dies, the chance of 7 or more characters out of nine dying while fourteen or less out of forty-six die is 0.376%, or 99.7%, much less then you calculated. Since this is a deterministic problem and the Chi squared method should be absolute, I've obviously screwed up a number somewhere, or there's a very narrow peak...
no subject
Date: 10 Jun 2010 02:15 pm (UTC)Anyway, experimental verification. What I was interested in is the probability that, given that your chance of dying is universal (x), seven people out of one pool of nine would die, and fourteen out of a second pool of forty-six would die (I think this is how your numbers work). Unfortunately, I got a different answer...
My calculation (indentations all screwed up):
#!/usr/bin/env python
import random
def probCalculator(nTimes = 1000):
"""
Silly calculator for running probabilities
"""
random.seed()
results = {}
for prob in [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]:
results[prob] = 0
for iteration in range(nTimes):
# Do this however many times you want
nPOC = 0
nWh = 0
for person in range(9):
# Do it over nine people
if random.uniform(0.0, 1.0) < prob:
nPOC += 1
for person in range(46):
# Do it 46 people
if random.uniform(0.0, 1.0) < prob:
nWh += 1
if nPOC >= 7 and nWh <= 14:
# If we meet the critera, record it
results[prob] += 1
for prob in results.keys():
print "The percentage chance of this happening for probability %f is %f" % (prob, float(results[prob])/nTimes)
Results from first iteration:
>>> probCalculator(nTimes = 500000)
The percentage chance of this happening for probability 0.500000 is 0.000510
The percentage chance of this happening for probability 0.200000 is 0.000334
The percentage chance of this happening for probability 0.400000 is 0.002974
The percentage chance of this happening for probability 0.800000 is 0.000000
The percentage chance of this happening for probability 0.300000 is 0.002680
The percentage chance of this happening for probability 0.600000 is 0.000008
The percentage chance of this happening for probability 0.100000 is 0.000004
The percentage chance of this happening for probability 0.900000 is 0.000000
The percentage chance of this happening for probability 0.700000 is 0.000000
For the second iteration, scan over probabilities from 0.30 to 0.45:
The percentage chance of this happening for probability 0.430000 is 0.002090
The percentage chance of this happening for probability 0.360000 is 0.003758
The percentage chance of this happening for probability 0.400000 is 0.002928
The percentage chance of this happening for probability 0.330000 is 0.003212
The percentage chance of this happening for probability 0.440000 is 0.001822
The percentage chance of this happening for probability 0.370000 is 0.003514
The percentage chance of this happening for probability 0.300000 is 0.002574
The percentage chance of this happening for probability 0.410000 is 0.002774
The percentage chance of this happening for probability 0.340000 is 0.003388
The percentage chance of this happening for probability 0.450000 is 0.001474
The percentage chance of this happening for probability 0.380000 is 0.003612
The percentage chance of this happening for probability 0.310000 is 0.002910
The percentage chance of this happening for probability 0.420000 is 0.002558
The percentage chance of this happening for probability 0.350000 is 0.003500
The percentage chance of this happening for probability 0.390000 is 0.003142
The percentage chance of this happening for probability 0.320000 is 0.003112
So I'm getting the chances being even lower, that is for a maximal chance of about 36% that a given character dies, the chance of 7 or more characters out of nine dying while fourteen or less out of forty-six die is 0.376%, or 99.7%, much less then you calculated. Since this is a deterministic problem and the Chi squared method should be absolute, I've obviously screwed up a number somewhere, or there's a very narrow peak...