Monte Carlo Simulation Part.1 - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Monte Carlo Simulation Part.1

Description:

Monte Carlo Simulation Part.1 Dept. Phys., Tunghai Univ. Numerical Methods, C. T. Shih If we want to find the numerical ... – PowerPoint PPT presentation

Number of Views:438
Avg rating:3.0/5.0
Slides: 15
Provided by: CT90
Category:

less

Transcript and Presenter's Notes

Title: Monte Carlo Simulation Part.1


1
Monte Carlo Simulation Part.1
  • Dept. Phys., Tunghai Univ.
  • Numerical Methods, C. T. Shih

2
?????????????
  • If we want to find the numerical integration
  • We can simply divide the region 0,1 evenly into
    M slices and the integral can be approximated by

3
Simple Sampling
  • On the other hand, we can select xn for
    n1,2,...,M from a uniform random number
    generator(?????)
  • If M is large enough, xn is set of numbers
    uniformly distributed in the region 0,1

4
Simple Sampling (conti.)
  • The integral can be approximated by
  • Now the error in the integral comes from the
    fluctuation of the distribution of xn

5
f(x)
0
1
6
Random Number Generator
  • Indeed, there is no real random number generator
    in a computer program the program always
    follows the commands by the programmer
  • We can only have a pseudo-random number
    generator
  • A good random number generator very long period,
    good randomness (small correlation), fast

7
Pseudo-RNG
  • Long period what is the possible longest period
    on a computer?
  • Answer the largest integer, i.e., 231-1
    2,147,483,647 on a 32-bit computer

8
Linear Congruent Scheme
  • The random numbers are generated by
  • a, b, c are magic numbers which determine the
    quality of the RNG
  • One possible choice (tested OK) a 75 16807,
    b 0, and c 231-1 2,147,483,647
  • Also you need a seed of your RNG as the initial
    x

9
Procedure of the RNG
  • ??????(????TIME()??)??ISEED,???x0
  • ?? ??x1
  • ?x1????ISEED,???? random number ? x1/c
  • ????,???????? (0,1) ???????

10
Overflow ??
  • ?? ????
    overflow,?????????

11
??
  • ??Monte Carlo??????????,M(???? 100, 1000, 1000),a
    ? 0.2, 0.5, 1, 5, 10,????????????

12
Alternative
  • ??????????????????????
  • ??????????(x,y),x ????????? a,b ??,y ???? c,d
    ??,? c ??? f(x) ? a,b ?????,d ???f(x) ? a,b
    ?????
  • ? 0ltyltf(x) ? N ???,? f(x)ltylt0? N- ???,????? N
    ???,????????

13
(No Transcript)
14
???????????
  • ???????? N ???,?????S
  • ?????? M ?,???? M ? Si, i1,2,...,M
  • ?? M ? S ???????? ltSgt
  • ???
Write a Comment
User Comments (0)
About PowerShow.com