Skip to content

Instantly share code, notes, and snippets.

@mehitabel
Created August 19, 2013 04:21
Show Gist options
  • Select an option

  • Save mehitabel/6265743 to your computer and use it in GitHub Desktop.

Select an option

Save mehitabel/6265743 to your computer and use it in GitHub Desktop.
from math import sqrt
def std_dev_over_mean(n, p):
""" increment a counter by 1/p with probability p, n times. (independently) """
q = 1 - p
var = n * q / p
return sqrt(var) / n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment