This is my first Computer Science note so I would love a bit of feed back in the comments.
\(\textbf{A Probabilistic World:}\)
The most comforting thing about Newtonian Mechanics is that everything happens for a reason.For example,if you push one end of the lever,the other end goes up.You throw an object and it travels in a parabolic path.The physical world is a completely deterministic placeall the future states are derived form the previous s ones.For centuries we had this prevailing scientific wisdom,then came the Copenhagen doctrine,led by Bohr and Heisenberg.The proponents of this doctrine argued that at the most fundamental level,the behavior of a physical system cannot be determined.This led to a serious debate regarding the validity of causal nondeterminism,ie every event is not caused by previous events.People like Einstein and Schrodinger found this philosophy unacceptable as exemplified by Einstein's often repeated comment  "God does not play dice".The question of causal nondeterminism is still unsettled but there is ample evidence to prove that certain systems can only be modeled accurately by stochastic processes.A process is called stochastic if it's next step depends on both previous states and some random event.
\(\textbf{Interpreting basic results:}\)
We all know how to calculate the basic probability of occurrence of certain events.But how do we interpret the significance of the results obtained?The answer is in this age of fast computers we can run multiple simulations of an event and record the outcomes and compare the results with the mathematically calculated value!Then in front of our own eyes we can see how powerful the theory of probability is!
\(\textbf{The Story of Blaise Pascal:}\)
We all know that one of the most influential figures in the history of Probability Theory was Blaise Pascal.His interest in the field began when a friend asked him the following question
"Would it be profitable given 24 rolls of a pair of fair dice to bet against there being at least one double six"
Pascal and Fermat exchanged a number of letters to solve this issue which apparently looks easy in the 21st century.Let us calculate it.
The probability of rolling \(6\) on one dice = \(\frac{1}{6}\)
The probability of rolling \(6\) on both dice = \(\frac{1}{6^{2}}\) = \(\frac{1}{36}\)
The probability of not rolling a double \(6\) on first roll = \((1  \frac{1}{36})\) = \(\frac{35}{36}\)
The probability of not rolling a double \(6\) on 24 rolls = \((\frac{35}{36})^{24}\) = \(0.508596123869\).
\(\textbf{The Law of Large Numbers:}\)
It states that in repeated independent tests,with actual probability \(p\) of a particular outcome in each test,the change that the fraction of times that outcome occurs differs from \(p\) converges to \(0\) as the number of trails go to infinity.
In other words we are going to organize a large number of trails of Pascal's experiment and expect that the simulation results will get very close to the mathematically calculated value.
\(\textbf{Constructing a Stochastic Program:}\)
The programming language we are going to use is Python.We will use Python's random module to construct a program to check the results.It is given by the following code with the comments explaining each line.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 

When I ran the program, the outcome was \(0.5067892\).Pretty close to Pascal's math!Try it out in a Python 2.7 interpreter!!
\(\textbf{Footnotes:}\)
This note was inspired by a chapter from "Introduction to Computaion and programming in Python" by John V.Guttag.
Those of you wondering about the matrix picture it is because the movie depicts the ultimate computer simulation.
Comments
Sort by:
Top NewestEddie, nice note. One thing tangential to your main thrust, but still important: you should be very careful about the notion that "events aren't caused by previous events". Even in quantum mechanics, if you know the state of the system at some time \(t=0\) the state at any future time can be explicitly calculated. Hence QM is also thoroughly deterministic in this sense. The Copenhagen interpretation, in the popular lingo that randomly one particular value is picked when a measurement occurs, has gone through a lot of adjustment in the last few decades and we now have a much better idea as to how this can actually happen in a manner that respects the deterministic nature of quantum mechanics. If you want to explore, read a little more about decoherence. – David Mattingly Staff · 3 years, 2 months ago
Log in to reply
– Eddie The Head · 3 years, 2 months ago
Thank you for your comment Sir.I read up on decoherence. But can Heisenberg's uncertainty principle also be interpreted deterministically??Log in to reply
– David Mattingly Staff · 3 years, 2 months ago
What are the values that you want to be precisely determined and evolved deterministically? position and momentum?Log in to reply
– Eddie The Head · 3 years, 2 months ago
Yes sir,that's what I meant........Log in to reply
– David Mattingly Staff · 3 years, 1 month ago
those are measurements on the fundamentally evolving object. Requiring that position and momentum are always determined and evolving according to some rule is not a correct belief about nature.Log in to reply
Eddie i really love your notes and pics but may you plz tell me smthng about fermat's no. theory..... (Y) – Adarsh Singh · 3 years, 1 month ago
Log in to reply
– Eddie The Head · 3 years, 1 month ago
Fermat made many significant contributions to the theory of numbers the most famous of which is Fermat's Last theorem....which one do u mean?Log in to reply
luv what u have written – Umang Vasani · 3 years, 1 month ago
Log in to reply
I do love the pic, and nice code to replicate Pascal. – Justin Wong · 3 years, 2 months ago
Log in to reply
I ran it 6 times and got results ranging from .5036 to .5138, but I did need to change the indentation of the print statement. Maybe this will help others that try it out.
Thanks for the interesting discussion! – Steven Perkins · 2 years, 12 months ago
Log in to reply