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.02

additional: the constant added to the base probability upon failures. between 0 and 1. eg 0.02

threshold: how many successive failures to trigger. nonnegative. eg 50

Methods

def have_first_success_at_n(self, n)

the chance for one fails for n-1 times, then succeed at n-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 within n 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 trails

p 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 at n-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