Biophysical Chemistry Textbook (Work in Progress)

by John Della Rosa

Monte Carlo Practice Problems

  1. Given a function, use Monte Carlo to determine the area under the curve in the region indicated:
    1. \(f(x)=3x+2\) for \(0\leq x\leq 3\)
    2. \(f(x)=x^2\) for \(-2\leq x\leq 2\)
    3. \(f(x)=ln(x+1)\) for \(0\leq x\leq 2\)
    4. \(f(x)=\exp(-x)\) for \(0\leq x\leq 2\)
    5. \(f(x)=\exp(-x^2)\) for \(-3\leq x\leq 3\),
    6. \(f(x)=\sqrt{x}\) for \(0\leq x\leq 3\)
    7. \(f(x)=\frac{1}{1+x^2}\) for \(-1\leq x\leq 1\)
    8. \(f(x)=\frac{1}{1+e^{-x}}\) for \(-1\leq x\leq 1\)
  2. Estimate the area of an ellipse given by the equation $$\frac{x^2}{9}+\frac{y^2}{16}=1$$
  3. Use Monte Carlo to estimate the mean of the X where \(X\sim |N(0,1)|\)
  4. Use Monte Carlo to calculate \(\mathbf{E}[e^X]\) where \(X\sim N(0,1)\)
  5. Use Monte Carlo to calculate \(\mathbf{E}[X^3]\) where \(X\sim N(0,1)\)
  6. Use Monte Carlo to calculate \(\mathbf{E}[e^X]\) where \(X\sim Bin(n=25,p=0.75)\)
  7. Use Monte Carlo to calculate \(\mathbf{E}[X^2]\) where \(X\sim Bin(n=14,p=0.4)\)
  8. Use Monte Carlo to calculate \(\mathbf{E}[\frac{1}{1+x}]\) where \(X\sim Bin(n=20,p=0.5)\)
  9. Let \(X\sim U(0,1)\) and \(x_1,x_2\) to be two realizations from that distribution. Use Monte Carlo to determine the probability that \(|x_1|+|x_2|\geq 1.25\)
  10. Use Monte Carlo to estimate the volume equivalent of a 4-dimensional sphere with radius 1.