def PERT(low, peak, high, g=<NUM_LIT>, tag=None):
a, b, c = [float(x) for x in [low, peak, high]]<EOL>assert a <= b <= c, '<STR_LIT>'<EOL>assert g >= <NUM_LIT:0>, '<STR_LIT>'<EOL>mu = (a + g * b + c) / (g + <NUM_LIT:2>)<EOL>if mu == b:<EOL><INDENT>a1 = a2 = <NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>a1 = ((mu - a) * (<NUM_LIT:2> * b - a - c)) / ((b - mu) * (c - a))<EOL>a2 = a1 * (c - mu) / (mu - a)<EOL><DEDENT>return Beta(a1, a2, a, c, tag)<EOL>
A PERT random variate

Parameters
----------
low : scalar
    Lower bound of the distribution support
peak : scalar
    The location of the distribution's peak (low <= peak <= high)
high : scalar
    Upper bound of the distribution support

Optional
--------
g : scalar
    Controls the uncertainty of the distribution around the peak. Smaller
    values make the distribution flatter and more uncertain around the 
    peak while larger values make it focused and less uncertain around
    the peak. (Default: 4)