Pearson's χ2 Test P-value calculator and Chi-Squared distribution plotter

This script calculates the significance level, or P-value, of a given value of χ2 for ν degrees of freedom and also plots the whole distribution for the given number of degrees of freedom. If you are unsure about the chi-squared distribution, its motivation, its derivation, or how to compute it, I've written a document: all about the chi-squared distribution. The other bit calculates probabilities from a Gaussian distribution.


2011.12.03: This calculator has been improved. Previously it used a crappy script I wrote that wouldn't work for large values of ν, but now I've rewritten it to work for large values as well.
2011.12.05: Now with PLOTS!