#!/usr/bin/env python import math def findOver100p1(): t = 0 for i in range(0,101): t=t+ (((2*(math.pow(math.e,-((0+(i*.06))/2))) / math.sqrt(2*math.pi)))) return t * .06 def findUnder100p1(): t = 0 for i in range(1,101): t=t+ (((2*(math.pow(math.e,-((0+(i*.06))/2))) / math.sqrt(2*math.pi)))) return t * .06 def findOver1000p1(): t = 0 for i in range(0,1001): t=t+ (((2*(math.pow(math.e,-((0+(i*.006))/2))) / math.sqrt(2*math.pi)))) return t * .006 def findUnder1000p1(): t = 0 for i in range(1,1001): t=t+ (((2*(math.pow(math.e,-((0+(i*.006))/2))) / math.sqrt(2*math.pi)))) return t * .006 def computeAverage100p1(): t, avg = 0, 0 t = findOver100p1() + findUnder100p1() avg = t / 2.00 return avg def computeAverage1000p1(): t, avg = 0, 0 t = findOver1000p1() + findUnder1000p1() avg = t / 2.00 return avg def main(): print "At 100 iteration, we have the following: " print computeAverage100p1() print "At 1000 iteration, we have the following: " print computeAverage1000p1() # added proper main function if __name__ == "__main__": main()