Module lvbdist
Classes
class LVBdistribution (base, additional, threshold)
-
Linearly varying "binomial" distribution
The probability of success given some trails will increase given successive failures util it hits 1, and the probability will reset to base if one success occurs
base
: the starting probability to success. between 0 and 1. eg. 0.02additional
: the constant added to the base probability upon failures. between 0 and 1. eg 0.02threshold
: how many successive failures to trigger. nonnegative. eg 50Methods
def have_first_success_at_n(self, n)
-
the chance for one fails for
n-1
times, then succeed atn
-th def have_first_success_at_n_E(self)
-
average waiting trails until a success
def have_m_or_more_successes_within_n_attempts(self, n, m)
-
the chance of having m or more successes within
n
trails def have_m_successes_within_n_attempts(self, n, m)
-
the chance of having
m
successes withinn
trails def have_m_successes_within_n_attempts_E(self, n)
-
average number of successes given
n
trails def have_special_success_within_n_attempts(self, n, p)
-
an event with probability
p
given a success can be marked as a special success.the chance of having at least one such special success within
n
trailsp
is between 0 and 1 exclusively. def have_special_success_within_n_attempts_E(self, p)
-
an event with probability
p
given a success can be marked as a special success.the average waiting trails until a success
p
is between 0 and 1 exclusively. def have_success_given_no_successes_before(self, n)
-
given that one failed for
n-1
times, the chance of success atn
-th def have_success_within_n_attempts(self, n)
-
the chance of having at least one success within
n
trails def max_times_to_ensure_success(self)
-
the index of trail where the success chance is 1