changeset 34:66a5e7f7c10f

Added a check to see if we were calculating the probabilities correctly.
author Brian Neal <bgneal@gmail.com>
date Wed, 09 Jan 2013 20:19:49 -0600
parents cfb7f28678c7
children 10db8c3a6b83
files ch5ex6.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ch5ex6.py	Wed Jan 09 20:11:53 2013 -0600
+++ b/ch5ex6.py	Wed Jan 09 20:19:49 2013 -0600
@@ -127,6 +127,8 @@
     vals.sort(key=lambda t: t[0])
     x, y = zip(*vals)
 
+    assert abs(sum(y) - 1.0) < 1e-6
+
     pyplot.clf()
     pyplot.xscale('log')
     pyplot.yscale('log')