# Mast Kalandar

bandar's colander of random jamun aur aam

# Computational Exercise

(I am teaching a course on Measure and Probability and was quite happy to find the following computational exercise to give to the students.)

The following computational exercise may help clarify the different methods of integrating functions and their relative utility.

Take an any "algebraic function" f (like a polynomial or rational function or something like f(x) = (()1 − x2) ) which is continuous on [0, 1] .

1. Integrate it using High-School methods and calculate the value. (You may need to use a power series method to integrate term-by-term.)
2. Integrate it numerically by Simpson's rule (or trapezoidal rule) by choosing a sufficiently fine partition of [0, 1] into small intervals.
3. Integrate it by Monte-Carlo. Choose a uniformly random large finite sequence xn in [0, 1] (by using a Pseudo-random generator) and calculating the average value of f(xn) .

After writing the program you should test which method is faster.

Note that if you know the function only approximately, then (1) is not available but (2) may still give a reasonable answer.

If you know only a large number of (x, f(x)) values (experimental data) then (2) is also not available and you can only use (3).

Method (1) is Newton/Liebnitz integration, (2) is Riemann integration and (3) is Lebesgue integration.

### Tue, 21 Sep 2010

#### Archives

 < January 2014 > Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005, 2004, 2003, 2002, 2001, 2000, 1999, 1997, 1995,