function gaussian_curve ($expected, $variance
{
$a = 1/(sqrt$variancepi()*2));
$b = $expected
$c = sqrt$variance);
// gaussian function:
// f(x) = ae^(-((x-b)^2)/(2*c^2))
// http://en.wikipedia.org/wiki/Gaussian_function
$f = array'*', $a,
array'^', exp(1),
array'neg',
array'/'
array'^', array'-', 'x', $b), 2),
array'*', 2, array'^', $c, 2))))));
// evaluate
$max = evaluate_for_x$f, $b);
$width = 600;
$height = ceil$max$width/10);
if ($height<200) $height = 200;
return plot_function$f, 'x', $b-5, $b+5, $width, $height, 1);
}