Mast Kalandar

bandar's colander of random jamun aur aam

Fri, 24 Jan 2014

Computational Exercise


computational, integration, numerical, randomness [link] [comments ()] [raw]

(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.


Archives

< January 2014 >
SuMoTuWeThFrSa
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
262728293031 

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