Simulates a
random variable with the selected disribution,
in the given interval, (a, b), or these values
as parameters (Beta, Gaussian).
For the (symmetric) triangular, it is:
x = √(r/2) for r ≤ ½, and
x = 1 − √[(1−r)/2], from
F1 = 2x² and
F2 = −2x² + 4x − 1 .
For the "generalized U-quadratic", a is the
parabola "rise" (Pt, flecha, height of the parabola apex).
Draws plots of: theoretical and simulated curves.
Computation structure — A PHP file
(this page: 'P-distrib.php') calls (via
'action=...') an intermediate PHP file ('Distrib.php'), which
(through $_POST) sends the problem data as command line arguments to a
Python script. This last does the computing, and makes 'subprocess' calls
to 'gnuplot', for the final (temporary) webpage.
Languages used: PHP, for the web page;
Python for computing; and 'gnuplot', for plotting.
Files involved:
P-distrib.php (this one),
Distrib.php,
distrib.py.
Keywords: PHP, Python script, subprocess,
gnuplot. |