<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nemenmanlab.org/~ilya/index.php?action=history&amp;feed=atom&amp;title=Physics_212%2C_2018%3A_Lecture_18</id>
	<title>Physics 212, 2018: Lecture 18 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nemenmanlab.org/~ilya/index.php?action=history&amp;feed=atom&amp;title=Physics_212%2C_2018%3A_Lecture_18"/>
	<link rel="alternate" type="text/html" href="https://nemenmanlab.org/~ilya/index.php?title=Physics_212,_2018:_Lecture_18&amp;action=history"/>
	<updated>2026-04-05T22:49:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://nemenmanlab.org/~ilya/index.php?title=Physics_212,_2018:_Lecture_18&amp;diff=747&amp;oldid=prev</id>
		<title>Ilya: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://nemenmanlab.org/~ilya/index.php?title=Physics_212,_2018:_Lecture_18&amp;diff=747&amp;oldid=prev"/>
		<updated>2018-07-04T16:28:45Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 16:28, 4 July 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Ilya</name></author>
		
	</entry>
	<entry>
		<id>https://nemenmanlab.org/~ilya/index.php?title=Physics_212,_2018:_Lecture_18&amp;diff=746&amp;oldid=prev</id>
		<title>nemenman&gt;Ilya: Created page with &quot;{{PHYS212-2018}}  ===General notes=== A good introduction to probability theory, one of my favorites, but more on the mathematical side, can be found at  [http://www.dartmouth...&quot;</title>
		<link rel="alternate" type="text/html" href="https://nemenmanlab.org/~ilya/index.php?title=Physics_212,_2018:_Lecture_18&amp;diff=746&amp;oldid=prev"/>
		<updated>2018-03-28T13:53:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{PHYS212-2018}}  ===General notes=== A good introduction to probability theory, one of my favorites, but more on the mathematical side, can be found at  [http://www.dartmouth...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{PHYS212-2018}}&lt;br /&gt;
&lt;br /&gt;
===General notes===&lt;br /&gt;
A good introduction to probability theory, one of my favorites, but more on the mathematical side, can be found at &lt;br /&gt;
[http://www.dartmouth.edu/~chance/teaching_aids/books_articles/probability_book/pdf.html Introduction to Probability] by CM Grinstead and JL Snell.&lt;br /&gt;
&lt;br /&gt;
===Why do we need random numbers?===&lt;br /&gt;
*Some processes are fundamentally random (quantum mechanics, statistical mechanics, mutations, chemical reactions).&lt;br /&gt;
*Some calculations are easier done using random numbers than using deterministic approaches (e.g., calculating area of a complex object).&lt;br /&gt;
*Avatars for randomness: a coin toss, a dice, a number of molecules in a certain volume of air, time to a click of a Geiger counter.&lt;br /&gt;
&lt;br /&gt;
===Introducing concepts of randomness===&lt;br /&gt;
To define the necessary probabilistic concepts, we need &lt;br /&gt;
*To define a set of outcomes that a random variable can take (e.g., head or tails, six sides of a die, etc.).&lt;br /&gt;
*Then we define a probability of a certain outcome &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; as a limit of frequencies after many random draws, or events. That is, if after &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; draws, the outcome happened &amp;lt;math&amp;gt;n_x&amp;lt;/math&amp;gt; times, then it's frequency is &amp;lt;math&amp;gt;f_x=n_x/N&amp;lt;/math&amp;gt;, and the probability is  &amp;lt;math&amp;gt;P(x)=\lim_{N\to\infty}f_x=\lim_{N\to\infty}\frac{n_x}{N}&amp;lt;/math&amp;gt;.&lt;br /&gt;
Probabilities satisfy the following properties, which follow from their definition of limits of frequencies:&lt;br /&gt;
*nonnegativity: &amp;lt;math&amp;gt;P_i\ge0&amp;lt;/math&amp;gt;&lt;br /&gt;
*unit normalization: &amp;lt;math&amp;gt;\sum_{i=1}^N P_i=1&amp;lt;/math&amp;gt;&lt;br /&gt;
*nesting: if &amp;lt;math&amp;gt;A\subset B&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;P(A)\le P(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
*additivity (for non-disjoint events): &amp;lt;math&amp;gt; P(A\cup B)=P(A)+P(B)-P(A\cap B)&amp;lt;/math&amp;gt;&lt;br /&gt;
*complementarity &amp;lt;math&amp;gt;P(not\, A)=1-P(A)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====What if we are studying more than one random variable?====&lt;br /&gt;
Multivariate distributions &amp;lt;math&amp;gt;P(x,y)&amp;lt;/math&amp;gt; is the probability of both events happening. It contains all of the information about the variables, including&lt;br /&gt;
*Marginal distribution: &amp;lt;math&amp;gt;P(x)=\sum_{y\in Y} P(x,y)&amp;lt;/math&amp;gt;&lt;br /&gt;
*The conditional distribution, which can then be defined as &amp;lt;math&amp;gt;P(y|x)=P(x,y)/P(x)&amp;lt;/math&amp;gt;, so that the probability of both events is the probability of the first happening, and then the probability of the second happening given that the first one has happened.&lt;br /&gt;
&lt;br /&gt;
The conditional distributions are related using the Bayes theorem, which says: &amp;lt;math&amp;gt;P(x,y)=P(x|y)P(y)=P(y|x)P(x)&amp;lt;/math&amp;gt;, so that &amp;lt;math&amp;gt;P(x|y)=\frac{P(y|x)P(x)}{P(y)}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We can also now formalize the intuitive concept of dependence among variables. Two random variables are considered to be statistically independent if and only if &amp;lt;math&amp;gt;P(x,y)=P(x)P(y)&amp;lt;/math&amp;gt;, or, equivalently, &amp;lt;math&amp;gt;P(x|y)=P(x)&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;P(y|x)=P(y)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===How easy is it to generate random numbers?===&lt;br /&gt;
*Do exercises on [http://faculty.rhodes.edu/wetzel/random/mainbody.html this web page] to get a better feel for random numbers. Were you successful in generating random numbers without the help of a coin?&lt;br /&gt;
*Linear congruential method for generating random numbers. See http://apps.nrbook.com/c/index.html, Chapter 7.1 for details.&lt;br /&gt;
*Many standard systems use: multiplier = 7**5, modulus = 2**31-1, increment = 0&lt;br /&gt;
&lt;br /&gt;
===Your turn===&lt;br /&gt;
*Download the [[media:rnd_generation.txt | rnd_generation]] script and play with different multiples and moduli for the linear congruential method.&lt;br /&gt;
*Histogram your results. Do all values of the parameters produce good random numbers?&lt;br /&gt;
*[https://docs.google.com/forms/d/e/1FAIpQLSeNvrPddCgvMfHdlSA8uYDddBFqLK81Rrr4l7jfozud6J7iww/viewform Submit your work].&lt;/div&gt;</summary>
		<author><name>nemenman&gt;Ilya</name></author>
		
	</entry>
</feed>