<?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_434%2C_2016%3A_Discrete_randomness</id>
	<title>Physics 434, 2016: Discrete randomness - 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_434%2C_2016%3A_Discrete_randomness"/>
	<link rel="alternate" type="text/html" href="https://nemenmanlab.org/~ilya/index.php?title=Physics_434,_2016:_Discrete_randomness&amp;action=history"/>
	<updated>2026-05-17T08:50:25Z</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_434,_2016:_Discrete_randomness&amp;diff=545&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_434,_2016:_Discrete_randomness&amp;diff=545&amp;oldid=prev"/>
		<updated>2018-07-04T16:28:43Z</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_434,_2016:_Discrete_randomness&amp;diff=544&amp;oldid=prev</id>
		<title>nemenman&gt;Ilya: /* General notes */</title>
		<link rel="alternate" type="text/html" href="https://nemenmanlab.org/~ilya/index.php?title=Physics_434,_2016:_Discrete_randomness&amp;diff=544&amp;oldid=prev"/>
		<updated>2016-08-31T13:50:43Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;General notes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{PHYS434-2016}}&lt;br /&gt;
&lt;br /&gt;
During these lectures, we study concepts of probability theory, such as probability distributions, conditionals, marginals, expectations, etc. We derive the law of large numbers. We study some specific useful probability distributions over discrete variables. In the course of this whole lecture block, we should be thinking about ''E. coli'' chemotaxis, neural firing, and bacterial mutations in the background -- all of these concepts will be applicable.&lt;br /&gt;
&lt;br /&gt;
====Side story, Lecture 2====&lt;br /&gt;
Let's talk a bit about life at low Reynolds number / high viscosity.&lt;br /&gt;
# We discussed ''E. coli'' swimming last time. Can ''E. coli'' swim by paddling an oar? It's fun to see the following movie of a [http://www.youtube.com/watch?v=PhsmOc7Hb8Q&amp;amp;t=3m6s kinematic reversibility of Low Reynolds number flows movie].&lt;br /&gt;
# Let's now watch [http://www.youtube.com/watch?v=25FtMdIFtXM a demo of ''E. coli'' flagellar bundling]. A question is: how does the spiral motion propel the bug? In other words: how will a tilted bar fall in corn syrup?&lt;br /&gt;
The outcome of these discussions is that life for cells is very different from the life in the macroscopic world that we are so used to. So throw away all your preconceived notions and keep on asking questions!&lt;br /&gt;
&lt;br /&gt;
===General notes===&lt;br /&gt;
There are now two good collections of notes that you can follow for this block of lectures. The first are Chapters 3, 4 from the Nelson's book. Another 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;
As we discuss probability theory, think of an ''E. coli'' that moves in a run/tumble strategy, a neuron that fires randomly, or the Luria-Delbruck experiment. All of these should give you a good intuition about the random distributions that we are discussing.&lt;br /&gt;
&lt;br /&gt;
During these lectures, we are also often stopping and doing some simple Matlab simulations -- to illustrate what we are discussing theoretically, and also to prepare us to do more interesting computational problems.&lt;br /&gt;
&lt;br /&gt;
===Introducing concepts of randomness===&lt;br /&gt;
Some examples of random variables are: position of ''E. coli'', time to neural action potential; number of bacteria with a given mutation; number of molecules of a nutrient near a bacterium. 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;
Good place for a randomness demo is http://faculty.rhodes.edu/wetzel/random/mainbody.html. Test yourself -- can you generate a random sequence?&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;
===Characterizing probability distributions===&lt;br /&gt;
Probability distributions are typically characterized by what's known as ''expectation values'', or the anticipated averaged of various functions of the random variables. That is, the expectation of &amp;lt;math&amp;gt;f(x)&amp;lt;/math&amp;gt; is defined as.  &amp;lt;math&amp;gt; E(f(x))=\langle f(x)\rangle=\sum_{x\in X}f(x)P(x)&amp;lt;/math&amp;gt;. Expectation values add, whether for the same or for different variables, so that &amp;lt;math&amp;gt;E(f(x)+g(x))=E(f(x))+E(g(x))&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;E(f(x)+g(y))=E(f(x))+E(g(y))&amp;lt;/math&amp;gt;. Importantly, for independent variables &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt;, expectations of products are also products of expectations: &amp;lt;math&amp;gt;E(f(x)g(y))= \sum_{x\in X}\sum_{y\in y}f(x)g(y)P(x,y)=\sum_{x\in X}\sum_{y\in y}f(x)g(y)P(x)P(y)= E(f(x))E(g(y))&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A certain set of particular expectations are very useful and commonly used to characterize probability distributions. These are expectations of powers of the random variable, and they are called ''moments'' &amp;lt;math&amp;gt;\mu_n=\langle x^n\rangle=\sum_{x\in X} x^nP(x)&amp;lt;/math&amp;gt;. Moments do not always exist, specifically for long-tailed probability distributions, as discussed at length in Nelson's book. The lower order moments are the most commonly used, if exist, and they got their own names. &lt;br /&gt;
*The first moment is the mean: &amp;lt;math&amp;gt;\mu_1=\langle x\rangle=\mu&amp;lt;/math&amp;gt;&lt;br /&gt;
*The second moment allows us to define the variance, or the spread of the distribution: &amp;lt;math&amp;gt;\sigma^2=\langle (x-\mu)^2\rangle=\langle x^2\rangle - \langle x\rangle^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
Interestingly, the additivity/multiplicativity of expectations discussed above then gives for two independent variables &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt;:&lt;br /&gt;
*&amp;lt;math&amp;gt;\mu(x+y)=\mu(x)+\mu(y)&amp;lt;/math&amp;gt;, and&lt;br /&gt;
*&amp;lt;math&amp;gt;\sigma^2(x+y)=\sigma^2(x)+\sigma^2(y)&amp;lt;/math&amp;gt;.&lt;br /&gt;
'''That is, means and variances of independent variables ad!''' This is a very important result, which will follow us through the entire course.&lt;br /&gt;
&lt;br /&gt;
Finally, it some times makes sense to define what is called the ''central moments'', which measure properties such as spread and skewness of the distribution relative to its mean. &amp;lt;math&amp;gt;c_n=\langle (x-\mu)^n\rangle=\sum_{x\in X} (x-\mu)^nP(x)&amp;lt;/math&amp;gt;. Note that the variance is the second central moment.&lt;br /&gt;
&lt;br /&gt;
===Specific probability distributions===&lt;br /&gt;
We then discussed some useful discrete probability distributions. We built all of them from the simple coin-toss (Bernoulli) distribution, step-by-step. However, while working with coins, it is useful to keep some physics in mind. A coin coming heads up could be a mutation happening, an action potential generated in a neuron, or a ligand molecule grabbed by a bacterial receptor. &lt;br /&gt;
*Bernoulli distribution: &amp;lt;math&amp;gt;P(0)=q&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;P(1)=p&amp;lt;/math&amp;gt;.&lt;br /&gt;
*Binomial distribution: the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; of heads out of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; trials: &amp;lt;math&amp;gt;P(n|N,p)={m \choose n}p^nq^{N-n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
*Geometric distribution: the number of trials to the next head, &amp;lt;math&amp;gt;P(n|p)=pq^{n-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
*Poisson: the number of heads out of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; trials, when the probability of a head is small. This is the &amp;lt;math&amp;gt;p\to0&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;pN\to {\rm const}&amp;lt;/math&amp;gt; limit of the binomial distribution: &amp;lt;math&amp;gt;P(n|\lambda=pN)= \frac{e^{-\lambda}\lambda^n}{n!}&amp;lt;/math&amp;gt;.&lt;br /&gt;
Again, for all of these distributions we can think of the number of mutations in a bacterium, or the number of spikes produced by a neuron, or a number of molecules captured by a cell. In class and in various homework problems, we then calculated the means and the variances of our basic discrete probability distributions. &lt;br /&gt;
*Bernoulli: &amp;lt;math&amp;gt;\mu=p&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma^2=pq&amp;lt;/math&amp;gt;.&lt;br /&gt;
*Binomial distribution: &amp;lt;math&amp;gt;\mu=Np&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma^2=Npq&amp;lt;/math&amp;gt;.&lt;br /&gt;
*Geometric distribution: &amp;lt;math&amp;gt;\mu=1/p&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma^2=q/p^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
*Poisson distribution: &amp;lt;math&amp;gt;\mu=\lambda&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma^2=\lambda&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Moment  generating function===&lt;br /&gt;
This is a complicated beast, and it's not immediately obvious why we even bother introducing it. So let's stay tuned for a few lectures.&lt;br /&gt;
&lt;br /&gt;
Moment generating function (MGF) is defined as &amp;lt;math&amp;gt;M_x(\lambda)=\langle e^{\lambda x}\rangle&amp;lt;/math&amp;gt;. It is thus an expectation of &amp;lt;math&amp;gt;e^{\lambda x}&amp;lt;/math&amp;gt;. Of course, it won't always exist. For it to exist, the distribution must fall off exponentially or faster in its tails. The utility of MGF comes from writing down the exponential as its taylor series, which then gives: &amp;lt;math&amp;gt;M(\lambda)=1+ \mu_1\lambda+\frac{\mu_2}{2}\lambda^2+\frac{\mu_3}{3!}\lambda^3+\cdots&amp;lt;/math&amp;gt;. In other words, &amp;lt;math&amp;gt;\mu_n=\left.\frac{d^n M_x(\lambda)}{d\lambda^n}\right|_{\lambda=0}&amp;lt;/math&amp;gt; -- one can calculate the MGF just once, and then get all moments of the distribution from it by a simple differentiation. Additionally, MGF has the following useful properties:&lt;br /&gt;
*&amp;lt;math&amp;gt;M_{x+a}(\lambda)=e^{a\lambda}M_x(\lambda)&amp;lt;/math&amp;gt;. &lt;br /&gt;
*If &amp;lt;math&amp;gt;z=x+y&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; are independent, then &amp;lt;math&amp;gt;M_z(\lambda)=M_x(\lambda)M_y(\lambda)&amp;lt;/math&amp;gt;. That is, MGFs of sums of independent variables are products of their individuals MGFs.&lt;br /&gt;
&lt;br /&gt;
To illustrate this, in class we explicitly calculated the MGF for the Poisson distribution &amp;lt;math&amp;gt;P(n|rT)&amp;lt;/math&amp;gt;, obtaining &amp;lt;math&amp;gt;M_n(\lambda)=e^{rT(e^\lambda-1)}&amp;lt;/math&amp;gt;. And, indeed, the known results for the mean and the variance of the poisson distribution follow from this immediately.&lt;br /&gt;
&lt;br /&gt;
While we didn't do this in class, it does make sense to define another generating function, the so called ''cumulant generating function'', &amp;lt;math&amp;gt;F_x(\lambda)=\log M_x(\lambda)&amp;lt;/math&amp;gt;. One  can similarly expand this function near &amp;lt;math&amp;gt;\lambda=0&amp;lt;/math&amp;gt; in a Taylor series, &amp;lt;math&amp;gt;F(\lambda)=1+ \xi_1\lambda+\frac{\xi_2}{2}\lambda^2+\frac{\xi_3}{3!}\lambda^3+\cdots&amp;lt;/math&amp;gt;. In other words, one can define &amp;lt;math&amp;gt;\xi_n=\left.\frac{d^n F_x(\lambda)}{d\lambda^n}\right|_{\lambda=0}&amp;lt;/math&amp;gt;. The quantities &amp;lt;math&amp;gt;\xi_n&amp;lt;/math&amp;gt; are called ''cumulants.'' These are combinations of various moments of probability distribution, utility of which will become useful when we study the Gaussian distribution. But notice that &amp;lt;math&amp;gt;\xi_1=\left.\frac{d F_x(\lambda)}{d\lambda}\right|_{\lambda=0}=\mu&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\xi_2=\left.\frac{d^2 F_x(\lambda)}{d\lambda^2}\right|_{\lambda=0}=\sigma^2&amp;lt;/math&amp;gt;. That is, the first cumulant is the mean, and the second cumulant is the variance. This provides us a taste of what the cumulants are -- they are special moments of the probability distribution that characterize its features in such a way that measure of the distribution width (2nd cumulant) is not influenced by the mean (the 1st cumulant), and the one characterizing the skewness (3rd cumulant) is not influenced by the value of the 2nd, and so on. This is in contrast to the usual second moment, which is the sum of the variance and the square of the mean.&lt;/div&gt;</summary>
		<author><name>nemenman&gt;Ilya</name></author>
		
	</entry>
</feed>