22
Probability in Modeling D. E. Stevenson Shodor Education Foundation [email protected]

Probability in Modeling D. E. Stevenson Shodor Education Foundation [email protected]

Embed Size (px)

Citation preview

Page 1: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

Probability in Modeling

D. E. Stevenson

Shodor Education Foundation

[email protected]

Page 2: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

An Aside on Matlab

Page 3: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

Population in Stella Revisited

Page 4: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

Stella Model with Random Population Change

Pop(t+1) = Pop(t)average rate of change

+ random deviation [-6,6] ratePop(t)2.

Page 5: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

Diffusion

Page 6: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

Diffusion Processes

“Diffusion refers to the process by which molecules intermingle as a result of their kinetic energy of random motion. Molecules are in constant motion and make numerous collisions.”

(edited version from hyperphysics.phy-astr.gsu.edu)

Page 7: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

Modeling the Physics

• Kinetic Energy is mv2/2.

• Temperature

T in K = E(mv2/3/k)

k = 1.3810-23 joules/ K

• Assume motion in all three dimensions.

kTv m

Page 8: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

Some Real Stuff

• What does this all mean for a pile of sugar?– Mass of sucrose is 342 daltons.– Velocity in sucrose 81 m/sec.– Mean free path about 4.510-10 cm (durn rough

estimate).– Mean time between collisions 5.610-10 sec.

Page 9: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

Random Walks

Page 10: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

Model=Random Walk

• Let x(n) be the location of a particle at time t. x(0)=0

• The particle moves a fixed (unit) distance every time interval at a speed of u for an effective length of u.

• The probability that particle moves to the right is p and to the left q.

• Time step directions are independent.

Page 11: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

Question 1: Where do the particles end up?

Page 12: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

• Assume that the particles don’t transfer momentum. Consider the trajectory of a single particle. Assume p=q=1/2.

• Where does the particle end up?

• Matlab

d1drwalk1.m

d1drwalk2.m

Final Location

Page 13: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

• Let xi(n) the position of particle i at time n.

• The rule is

• So the average is

Computing Ensemble Average

( ) ( 1) ( )i ix n x n rv

1

1 1( ) ( ) [ ( 1) ( )]

N

i ii

X n x n x n rvN N

Page 14: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

Finalizing

• The average of the steps is zero if p=q.

• Then the average location at time n is the same as that of n-1.

• Recursively, then the average location is the same as the starting location…zero.

Page 15: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

Computing Ensembles

• Now let’s consider many particles, all starting at X(0)=0. Assume these do not collide with one another. All these particles together form an ensemble.

• What can we say about the ensemble?d1drwalk4.m

• But isn’t it zero?d1drwalk4bin.m

Page 16: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

Ensemble Average

• Here’s the uncertainty. We ran a small number of trials (M=100) for a short period of time (N=500 steps).

• I need to consider– Is M big enough?– Is N big enough?– Ah, is the random sequence good enough?

d1drwalk5.m

Page 17: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

So What?

Page 18: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

Summary

• We have considered some of the history of probability in science as opposed to its use as a mathematical subject.

• We considered very briefly the diffusion process and random walks as a implementation.

• We saw that ensembles may or may not be well constructed by Matlab.

Page 19: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

A Little Background

Page 20: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

A little history

• Jakob (Jacques) Bernoulli, Ars Conjectandi, 1713.• Thomas Bayes, Essay towards solving a problem

in the doctrine of chances, 1764.• Pierre-Simon Laplace, Essai philosophique sur les

probabilités, 1812. • George Boole, An investigation into the Laws of

Thought, on Which are founded the Mathematical Theories of Logic and Probabilities, 1854.

Page 21: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org
Page 22: Probability in Modeling D. E. Stevenson Shodor Education Foundation Steve@shodor.org

More Modern…

• Copenhagen Meeting, 1927.• William Feller, Introduction to Probability Theory

and its Applications (1950-61).• Sir Harold Jefferys, Theory of Probability, 1939. • Samuel Karlin, A First Course in Stochastic

Processes, 1969. A Second Course in Stochastic Processes, 1981.

• Edwin T. James, Probability as Extended Logic, 1995 (bayes.wustl.edu)