<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Courts of Chaos</title>
	<atom:link href="http://systematicchaos.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://systematicchaos.wordpress.com</link>
	<description>Just another random weblog</description>
	<lastBuildDate>Thu, 08 Apr 2010 02:12:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='systematicchaos.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The Courts of Chaos</title>
		<link>http://systematicchaos.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://systematicchaos.wordpress.com/osd.xml" title="The Courts of Chaos" />
	<atom:link rel='hub' href='http://systematicchaos.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Washrooms in a plane</title>
		<link>http://systematicchaos.wordpress.com/2010/04/08/washrooms-in-a-plane/</link>
		<comments>http://systematicchaos.wordpress.com/2010/04/08/washrooms-in-a-plane/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 02:12:26 +0000</pubDate>
		<dc:creator>jonsn0w</dc:creator>
				<category><![CDATA[none]]></category>

		<guid isPermaLink="false">http://systematicchaos.wordpress.com/?p=244</guid>
		<description><![CDATA[Most people have some familiarity with the following situation: you&#8217;re in the plane, already crammed into your seat and you need to go to the washroom. But, at least in the planes I&#8217;ve been, the washroom seems to be occupied all the time. So you go, stay in line, get in, and when you get [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=244&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
Most people have some familiarity with the following situation: you&#8217;re in the plane, already crammed into your seat and you need to go to the washroom. But, at least in the planes I&#8217;ve been, the washroom seems to be occupied all the time. So you go, stay in line, get in, and when you get out the line is still there &#8211; other people waiting to take your place.
</p>
<p>
What is the actual probability to have the washroom occupied during your flight? This should be relatively easy to answer. Suppose we have <i>N</i> people in a plane with <i>Nw</i> washrooms. We want to know <i>P(all washrooms are occupied)</i> and we will denote it with <i>P</i>:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P+%3D+%5Cprod_%7Bk+%3D+1%7D%5E%7BNw%7D+P%28%5Ctext%7Bwashroom+%7D+k+%5Ctext%7B+is+occupied%7D%29+%5Cquad+%281%29+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P = &#92;prod_{k = 1}^{Nw} P(&#92;text{washroom } k &#92;text{ is occupied}) &#92;quad (1) ' title='P = &#92;prod_{k = 1}^{Nw} P(&#92;text{washroom } k &#92;text{ is occupied}) &#92;quad (1) ' class='latex' /></p>
<p>We can safely multiply in the previous relation since the probability that a washroom is occupied is independent of other washrooms being occupied or not.
</p>
<p>
To calculate the probability that a washroom is occupied we need to know in average how many times a man uses the washroom and for how long.
</p>
<p>
We can infer the first value by knowing the <a href="http://www.nlm.nih.gov/medlineplus/ency/article/003146.htm" target="_blank">normal volume of urination</a> and the <a href="http://hypertextbook.com/facts/2001/DanielShaw.shtml" target="_blank">volume of the human bladder</a>. Let&#8217;s call this <i>Np</i> and based on the previous links it can be anywhere from 3 to 6.
</p>
<p>
For the second parameter I couldn&#8217;t find any &#8230; informative links so let&#8217;s just call this <i>tw</i> and give it a reasonable value of 3 minutes.
</p>
<p>
The probability that a man will be in the washroom is:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_%7Bhp%7D+%3D+%5Cfrac%7BNp+%5Ccdot+tw%7D%7B60+%5Ccdot+24%7D+%3D+%5Cfrac%7BNp+%5Ccdot+tw%7D%7B1440%7D+%5Capprox+0.0083+%5Cquad+%282%29+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_{hp} = &#92;frac{Np &#92;cdot tw}{60 &#92;cdot 24} = &#92;frac{Np &#92;cdot tw}{1440} &#92;approx 0.0083 &#92;quad (2) ' title='P_{hp} = &#92;frac{Np &#92;cdot tw}{60 &#92;cdot 24} = &#92;frac{Np &#92;cdot tw}{1440} &#92;approx 0.0083 &#92;quad (2) ' class='latex' />
</p>
<p>
Of course you can try your own calculations using your preferred values for <i>Np</i> and <i>tw</i>. Also I had friends arguing that my whole argument is not valid since they know people who stay more or less than my assumed values. Of course I&#8217;m aiming here for an &#8220;average&#8221; probability, and if you want to know exactly the value for your particular flight/home/work place, you can experimentally find the above probability per person and plug it in the equations below.
</p>
<p>
If we have <i>N</i> people in the same place and one washroom, the probability that the washroom is occupied will be:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28%5Ctext%7Bwashroom+is+occupied%7D%29+%3D+1+-+P%28%5Ctext%7Bnobody+is+in+the+washroom%7D%29+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(&#92;text{washroom is occupied}) = 1 - P(&#92;text{nobody is in the washroom}) ' title='P(&#92;text{washroom is occupied}) = 1 - P(&#92;text{nobody is in the washroom}) ' class='latex' /></p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28%5Ctext%7Bwashroom+is+occupied%7D%29+%3D+1+-+%281+-+P_%7Bhp%7D%29%5EN+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(&#92;text{washroom is occupied}) = 1 - (1 - P_{hp})^N ' title='P(&#92;text{washroom is occupied}) = 1 - (1 - P_{hp})^N ' class='latex' /></p>
<p>since <i>P(nobody is in the washroom)</i> equals <i>P(person 1 is not in the washroom) and P(person 2 is not in the washroom) and &#8230; and P(person N is not in the washroom)</i> which are independent events and thus can be multiplied together.
</p>
<p>
Going back to equation <i>(1)</i> we can write now:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P+%3D+%5Cprod_%7Bk+%3D+1%7D%5E%7BNw%7D+%5B1+-+%281+-+P_%7Bhp%7D%29%5E%7B%28N+-+k+%2B+1%29%7D%5D+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P = &#92;prod_{k = 1}^{Nw} [1 - (1 - P_{hp})^{(N - k + 1)}] ' title='P = &#92;prod_{k = 1}^{Nw} [1 - (1 - P_{hp})^{(N - k + 1)}] ' class='latex' /></p>
<p>
And to finish with a mental image here is a plot of the <i>P(all washrooms are occupied)</i> for different values of <i>N</i> and <i>Nw</i>. Considering that a reasonable plane capacity is around or above <i>N</i> = 200 you can see for yourself that there&#8217;s a good reason the washroom is almost always  occupied.</p>
<p><a href="http://systematicchaos.files.wordpress.com/2010/04/chaos008-01.png"><img src="http://systematicchaos.files.wordpress.com/2010/04/chaos008-01.png?w=450&#038;h=337" alt="" title="chaos008-01" class="alignnone size-full wp-image-264" height="337" width="450" /></a></p>
<br />Filed under: <a href='http://systematicchaos.wordpress.com/category/none/'>none</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/systematicchaos.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/systematicchaos.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/systematicchaos.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/systematicchaos.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/systematicchaos.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/systematicchaos.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/systematicchaos.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/systematicchaos.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/systematicchaos.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/systematicchaos.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/systematicchaos.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/systematicchaos.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/systematicchaos.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/systematicchaos.wordpress.com/244/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=244&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://systematicchaos.wordpress.com/2010/04/08/washrooms-in-a-plane/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0ee9c50780ed9f50107c6a8abd4ccdfe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jonsn0w</media:title>
		</media:content>

		<media:content url="http://systematicchaos.files.wordpress.com/2010/04/chaos008-01.png" medium="image">
			<media:title type="html">chaos008-01</media:title>
		</media:content>
	</item>
		<item>
		<title>Justice is blind</title>
		<link>http://systematicchaos.wordpress.com/2010/02/15/justice-is-blind/</link>
		<comments>http://systematicchaos.wordpress.com/2010/02/15/justice-is-blind/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 04:22:42 +0000</pubDate>
		<dc:creator>jonsn0w</dc:creator>
				<category><![CDATA[chaos]]></category>
		<category><![CDATA[probability]]></category>

		<guid isPermaLink="false">http://systematicchaos.wordpress.com/?p=220</guid>
		<description><![CDATA[There can be no denying that chance is a part of justice. After all that is why all statues that represent it are blind. And (un)fortunately it will probably stay that way as long as humans are part of it. Also jury trial is probably as old as the concept of justice itself. What it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=220&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
There can be no denying that chance is a part of justice. After all that is why all statues that represent it are <a href="http://en.wikipedia.org/wiki/Lady_Justice">blind</a>. And (un)fortunately it will probably stay that way as long as humans are part of it. Also jury trial is probably as old as the concept of justice itself. What it means, in the current times, is that a group of people is chosen to decide questions of fact in a trial. What I&#8217;m interested in this post is to see how the bias of the general populace can influence jury decisions.
</p>
<p>
In the modern justice systems there is also this concept called presumption of innocence. It is a very nice concept in theory but as usual in practice sometimes it&#8217;s not easy to follow it. Sometimes people just assume that if you&#8217;re on trial you must be guilty. Sometimes the trial involves powerful emotions an it&#8217;s easier to follow them then try to reason logically. As I said the jury is made of people, and people have their <a href="http://en.wikipedia.org/wiki/List_of_cognitive_biases"> biases</a>.
</p>
<p>
Let&#8217;s suppose the following scenario: there are N people in a jury, and they have to decide if the defendant is guilty or not. But the trial was not extremely conclusive (which is normal, because if the verdict would be obvious this post would have no purpose). So either the lawyers were really good (or really bad) or the evidence was not strong enough for any side, but the jury members have to basically give a guilty/not guilty verdict by chance. Of course each member of the jury will use its own rationalization to justify the answer that (s)he gave but I&#8217;m aiming for a probability problem here, not a sociology one.
</p>
<p>
In most cases a jury needs unanimity to give a verdict. So let&#8217;s add some more constraints to our problem. Let&#8217;s suppose that if the majority of the jury will vote one way (guilty or not guilty) they will convince the rest to vote the same way. Also if the guilty/not guilty votes are equal the jury will vote again (randomly) until we have majority in which case we apply the first rule.
</p>
<p>
So we can have multiple results of the jury vote depending on the number of members in the jury. If N is even there are 3 possible resulting scenarios:
</p>
<ul>
<li>the defendant goes to jail if more than <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7BN%7D%7B2%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;frac{N}{2}' title='&#92;frac{N}{2}' class='latex' /> members of the jury vote that he&#8217;s guilty </li>
<li>the defendant goes free if less than <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7BN%7D%7B2%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;frac{N}{2}' title='&#92;frac{N}{2}' class='latex' /> members of the jury vote that he&#8217;s guilty</li>
<li>the jury will vote again if the votes are split equally. This scenario is here just for completeness since the jury will have to vote again</li>
</ul>
<p>
If N is odd we have only the first two. From now on I will consider <i>N = 12</i> for the purpose of getting some actual calculations done.
</p>
<h3>All jury members are NOT biased</h3>
<p>
In this case each jury member will give the guilty/not guilty verdict with probability of 0.5. So the defendant has equal chances to end up in jail or free, which makes sense since the trial was inconclusive and there is no way to take a clear decision.
</p>
<h3>All jury members are identically biased</h3>
<p>
In this case each jury member will give the guilty/not guilty verdict with probability different from 0.5. An easy model for this is to imagine we have a big bowl with black and white balls, and the probability to extract a black ball (guilty) is equal to the bias of the jury. We then proceed and extract N times (with replacement) from that bowl.
</p>
<p>
The probabilities corresponding to the 3 possible scenarios described earlier are:</p>
<p><img src='http://s0.wp.com/latex.php?latex=p%28%5Ctext%7Bjail%7D%29+%3D+%5Csum_%7Bi%3D%5Cleft%28+%5Cfrac%7BN%7D%7B2%7D%2B1+%5Cright%29%7D%5E%7BN%7D+C%28N%2C+i%29+%5Ccdot+p%5Ei+%5Ccdot+%281-p%29%5E%7B%28N-i%29%7D+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='p(&#92;text{jail}) = &#92;sum_{i=&#92;left( &#92;frac{N}{2}+1 &#92;right)}^{N} C(N, i) &#92;cdot p^i &#92;cdot (1-p)^{(N-i)} ' title='p(&#92;text{jail}) = &#92;sum_{i=&#92;left( &#92;frac{N}{2}+1 &#92;right)}^{N} C(N, i) &#92;cdot p^i &#92;cdot (1-p)^{(N-i)} ' class='latex' /></p>
<p><img src='http://s0.wp.com/latex.php?latex=p%28%5Ctext%7Bfree%7D%29+%3D+%5Csum_%7Bi%3D0%7D%5E%7B%5Cleft%28+%5Cfrac%7BN%7D%7B2%7D-1+%5Cright%29%7D+C%28N%2C+i%29+%5Ccdot+p%5Ei+%5Ccdot+%281-p%29%5E%7B%28N-i%29%7D+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='p(&#92;text{free}) = &#92;sum_{i=0}^{&#92;left( &#92;frac{N}{2}-1 &#92;right)} C(N, i) &#92;cdot p^i &#92;cdot (1-p)^{(N-i)} ' title='p(&#92;text{free}) = &#92;sum_{i=0}^{&#92;left( &#92;frac{N}{2}-1 &#92;right)} C(N, i) &#92;cdot p^i &#92;cdot (1-p)^{(N-i)} ' class='latex' /></p>
<p><img src='http://s0.wp.com/latex.php?latex=p%28%5Ctext%7Bre-vote%7D%29+%3D+C%5Cleft%28N%2C+%5Cfrac%7BN%7D%7B2%7D%5Cright%29+%5Ccdot+p%5E%7B%5Cfrac%7BN%7D%7B2%7D%7D+%5Ccdot+%281-p%29%5E%7B%5Cfrac%7BN%7D%7B2%7D%7D+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='p(&#92;text{re-vote}) = C&#92;left(N, &#92;frac{N}{2}&#92;right) &#92;cdot p^{&#92;frac{N}{2}} &#92;cdot (1-p)^{&#92;frac{N}{2}} ' title='p(&#92;text{re-vote}) = C&#92;left(N, &#92;frac{N}{2}&#92;right) &#92;cdot p^{&#92;frac{N}{2}} &#92;cdot (1-p)^{&#92;frac{N}{2}} ' class='latex' />
</p>
<p><a href="http://systematicchaos.files.wordpress.com/2010/02/chaos007-01.png"><img src="http://systematicchaos.files.wordpress.com/2010/02/chaos007-01.png?w=450&#038;h=337" alt="" title="chaos007-01" class="alignnone size-full wp-image-227" height="337" width="450"></a></p>
<h3>Only ONE jury member is biased</h3>
<p>
In this case each jury member will give the guilty/not guilty verdict with probability of 0.5 except one of them which is biased. An easy model for this is to imagine we have two big bowls with black and white balls, one with an equal number of black and white balls from which we extract (with replacement) <i>N-1</i> times and one from which we extract once where the probability to extract a black ball (guilty) is equal to the bias of the single jury member.
</p>
<p>
We can organize the possible outcomes in the following table (just to make it easy to see what terms we need to add):
</p>
<table border="1">
<tbody>
<tr>
<td></td>
<td>1-p(bias)</td>
<td>p(bias)</td>
</tr>
<tr>
<td>C(11, 0)0.5<sup>11</sup></td>
<td>free</td>
<td>free</td>
</tr>
<tr>
<td>C(11, 1)0.5<sup>11</sup></td>
<td>free</td>
<td>free</td>
</tr>
<tr>
<td>C(11, 2)0.5<sup>11</sup></td>
<td>free</td>
<td>free</td>
</tr>
<tr>
<td>C(11, 3)0.5<sup>11</sup></td>
<td>free</td>
<td>free</td>
</tr>
<tr>
<td>C(11, 4)0.5<sup>11</sup></td>
<td>free</td>
<td>free</td>
</tr>
<tr>
<td>C(11, 5)0.5<sup>11</sup></td>
<td>free</td>
<td>re-vote</td>
</tr>
<tr>
<td>C(11, 6)0.5<sup>11</sup></td>
<td>re-vote</td>
<td>guilty</td>
</tr>
<tr>
<td>C(11, 7)0.5<sup>11</sup></td>
<td>guilty</td>
<td>guilty</td>
</tr>
<tr>
<td>C(11, 8)0.5<sup>11</sup></td>
<td>guilty</td>
<td>guilty</td>
</tr>
<tr>
<td>C(11, 9)0.5<sup>11</sup></td>
<td>guilty</td>
<td>guilty</td>
</tr>
<tr>
<td>C(11, 10)0.5<sup>11</sup></td>
<td>guilty</td>
<td>guilty</td>
</tr>
<tr>
<td>C(11, 11)0.5<sup>11</sup></td>
<td>guilty</td>
<td>guilty</td>
</tr>
</tbody>
</table>
<p>
The terms in the first column are the probabilities for possible outcomes of the (N-1) judge members who have no bias. The first row shows how the biased single member can vote. To get the probabilities of each possible scenario just add all the products as described in the table.
</p>
<p><a href="http://systematicchaos.files.wordpress.com/2010/02/chaos007-02.png"><img src="http://systematicchaos.files.wordpress.com/2010/02/chaos007-02.png?w=450&#038;h=337" alt="" title="chaos007-02" class="alignnone size-full wp-image-227" height="337" width="450"></a></p>
<br />Filed under: <a href='http://systematicchaos.wordpress.com/category/chaos/'>chaos</a>, <a href='http://systematicchaos.wordpress.com/category/probability/'>probability</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/systematicchaos.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/systematicchaos.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/systematicchaos.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/systematicchaos.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/systematicchaos.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/systematicchaos.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/systematicchaos.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/systematicchaos.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/systematicchaos.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/systematicchaos.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/systematicchaos.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/systematicchaos.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/systematicchaos.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/systematicchaos.wordpress.com/220/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=220&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://systematicchaos.wordpress.com/2010/02/15/justice-is-blind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0ee9c50780ed9f50107c6a8abd4ccdfe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jonsn0w</media:title>
		</media:content>

		<media:content url="http://systematicchaos.files.wordpress.com/2010/02/chaos007-01.png" medium="image">
			<media:title type="html">chaos007-01</media:title>
		</media:content>

		<media:content url="http://systematicchaos.files.wordpress.com/2010/02/chaos007-02.png" medium="image">
			<media:title type="html">chaos007-02</media:title>
		</media:content>
	</item>
		<item>
		<title>How to get probabilities wrong</title>
		<link>http://systematicchaos.wordpress.com/2010/01/30/how-to-get-probabilities-wrong/</link>
		<comments>http://systematicchaos.wordpress.com/2010/01/30/how-to-get-probabilities-wrong/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 04:25:38 +0000</pubDate>
		<dc:creator>jonsn0w</dc:creator>
				<category><![CDATA[gambling]]></category>
		<category><![CDATA[probability]]></category>

		<guid isPermaLink="false">http://systematicchaos.wordpress.com/?p=198</guid>
		<description><![CDATA[A couple of days ago, one of my friends asked me to calculate some probability related to Texas hold&#8217;em. The probability he wanted to calculate was quite simple, but exactly this is the problem. The easier it looks to calculate, the more opportunities for mistake. This reverse can be also true, if it&#8217;s hard to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=198&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
A couple of days ago, one of my friends asked me to calculate some probability related to Texas hold&#8217;em. The probability he wanted to calculate was quite simple, but exactly this is the problem. The easier it looks to calculate, the more opportunities for mistake. This reverse can be also true, if it&#8217;s hard to calculate you probably won&#8217;t even try.
</p>
<p>
The problem is the following: given that the 2 cards you have in your hand are of the same suit, what is the probability that you will get 4 cards of the same suit after the flop.
</p>
<p>
Since people learn from their mistakes, but smart people learn from other people&#8217;s mistakes, lets see how to calculate this probability. The way it works is that you know 2 cards so you have 50 left. Now, it can be argued that the other players have each 2 cards too, thus it will be less than 50 cards in the game. But from your point of view it really doesn&#8217;t matter if the other players have cards or how many players are there. Imagine the following scenarios:
</p>
<ul>
<li>You have a pack of 52 cards. You give yourself 2 cards, then you draw some cards and just leave them on the table, then you draw 3 more and put them face up (the flop in Texas hold&#8217;em). Here it is obvious that you have 50 cards and you just draw 3 of them randomly</li>
<li>You have a pack of 52 cards. You give 2 cards to you and a number of other players and then draw 3 more and place them face up. There is no difference in the way the cards are drawn compared to the previous scenario.</li>
</ul>
<p>
Of course if you would knew the cards of the other players you could calculate more accurately the probability that we&#8217;re looking for. But based only on the knowledge of your 2 cards you can use the first scenario regardless of the number of players at the table. It&#8217;s the same as if you have a dice. If you just know it&#8217;s just a dice you can say the probability to get the number <i>1</i> is 1/6. But if you would know in detail the mass distribution of the material of the dice, the initial position of the dice, and the initial force and moment you could give a more accurate probability to get number <i>1</i>. But this is already getting into the philosophy of probability so lets leave this for another post.
</p>
<p>
So we have 50 cards and we draw 3 of them. This means <i>C(50, 3)</i> is the total number of outcomes. But we already have 2 card of a particular suit and we want 2 more of the same suit. Since we are left with 11 cards of our suit of interest in the rest of the cards, and we want any 2 of them that means <i>C(11, 2)</i> favorable outcomes. And for the third card in the flop we can have anything else, so that means <i>50 &#8211; 2 = 48</i> outcomes. This gives us:</p>
<p><img src='http://s0.wp.com/latex.php?latex=p+%3D+%5Cfrac%7BC%2811%2C+2%29+%5Ccdot+49%7D%7BC%2850%2C+3%29%7D+%3D+13.47%5C%25+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='p = &#92;frac{C(11, 2) &#92;cdot 49}{C(50, 3)} = 13.47&#92;% ' title='p = &#92;frac{C(11, 2) &#92;cdot 49}{C(50, 3)} = 13.47&#92;% ' class='latex' /></p>
<p>
(Un)fortunately we had the right result, and it wasn&#8217;t what we got. The mistake was that for the third card we multiplied by the number of cards remaining in the deck. However there are cards of the same suit after we draw the 4 we were interested in. So what we calculated was the probability to get 4 <b>or 5</b> cards of the same suit after the flop. The requirement was to calculate the probability to get <b>only</b> 4 cards of the same suit.
</p>
<p>
So the correct answer if that for the third card we can have any card of another suit. That means 39 outcomes giving the right result of:</p>
<p><img src='http://s0.wp.com/latex.php?latex=p+%3D+%5Cfrac%7BC%2811%2C+2%29+%5Ccdot+39%7D%7BC%2850%2C+3%29%7D+%3D+10.94%5C%25+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='p = &#92;frac{C(11, 2) &#92;cdot 39}{C(50, 3)} = 10.94&#92;% ' title='p = &#92;frac{C(11, 2) &#92;cdot 39}{C(50, 3)} = 10.94&#92;% ' class='latex' /></p>
<br />Filed under: <a href='http://systematicchaos.wordpress.com/category/probability/gambling/'>gambling</a>, <a href='http://systematicchaos.wordpress.com/category/probability/'>probability</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/systematicchaos.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/systematicchaos.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/systematicchaos.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/systematicchaos.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/systematicchaos.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/systematicchaos.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/systematicchaos.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/systematicchaos.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/systematicchaos.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/systematicchaos.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/systematicchaos.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/systematicchaos.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/systematicchaos.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/systematicchaos.wordpress.com/198/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=198&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://systematicchaos.wordpress.com/2010/01/30/how-to-get-probabilities-wrong/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0ee9c50780ed9f50107c6a8abd4ccdfe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jonsn0w</media:title>
		</media:content>
	</item>
		<item>
		<title>Binomial probability</title>
		<link>http://systematicchaos.wordpress.com/2009/12/28/binomial-probability/</link>
		<comments>http://systematicchaos.wordpress.com/2009/12/28/binomial-probability/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 21:17:47 +0000</pubDate>
		<dc:creator>jonsn0w</dc:creator>
				<category><![CDATA[probability]]></category>

		<guid isPermaLink="false">http://systematicchaos.wordpress.com/?p=185</guid>
		<description><![CDATA[Life is usually complicated. But sometimes you can simplify some specific problems to yes/no or good/bad answers. If you have a sequence of independent repetitions of an event, with two possible outcomes, and the probabilities of those outcomes does not vary between repetitions, we call that a Bernoulli trial. If all the above conditions are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=185&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
Life is usually complicated. But sometimes you can simplify some specific problems to yes/no or good/bad answers. If you have a sequence of independent repetitions of an event, with two possible outcomes, and the probabilities of those outcomes does not vary between repetitions, we call that a <a href="http://en.wikipedia.org/wiki/Jakob_Bernoulli">Bernoulli</a> trial.
</p>
<p>
If all the above conditions are fulfilled, we can denote <i>p</i> as the probability of success and <i>q = (1 &#8211; p)</i> the probability of failure for one such event. For a sequence of <i>n</i> events we have the probability to be successful in <i>k</i> of them:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P+%3D+C%28n%2C+k%29+%5Ccdot+p%5E%7Bk%7D+%5Ccdot+q%5E%7Bn+-+k%7D+%281%29+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P = C(n, k) &#92;cdot p^{k} &#92;cdot q^{n - k} (1) ' title='P = C(n, k) &#92;cdot p^{k} &#92;cdot q^{n - k} (1) ' class='latex' /></p>
<p>
While this may seem a bit boring, we can get use the above relation for various probability estimates, as long as we apply it correctly, and the events are Bernoulli trials.
</p>
<h4>Example 1</h4>
<p>
Let&#8217;s say you have to pass a <a href="http://www.cic.gc.ca/english/citizenship/cit-test.asp">test</a>. There are 20 multiple choice questions, each one with 4 choices and one correct answer. What is the probability to pass if you do not study? That would be the probability to answer correctly to 12 questions from 20, with <i>p</i> being 0.25 (1 out of 4 possible choices): </p>
<p><img src='http://s0.wp.com/latex.php?latex=P+%3D+C%2820%2C+12%29+%5Ccdot+0.25%5E%7B12%7D+%5Ccdot+0.75%5E%7B8%7D+%5Capprox+0.000752+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P = C(20, 12) &#92;cdot 0.25^{12} &#92;cdot 0.75^{8} &#92;approx 0.000752 ' title='P = C(20, 12) &#92;cdot 0.25^{12} &#92;cdot 0.75^{8} &#92;approx 0.000752 ' class='latex' /></p>
<p>
A probability of 0.075% is really low, so you will probably fail without study. However this particular test also has other rules like: 3 questions are mandatory to answer correctly, or you fail regardless of the other answers. So let&#8217;s suppose you study somewhat so you&#8217;ll correctly answer those 3 mandatory questions. You probability to pass becomes:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P+%3D+C%2817%2C+9%29+%5Ccdot+0.25%5E%7B9%7D+%5Ccdot+0.75%5E%7B8%7D+%5Capprox+0.009284+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P = C(17, 9) &#92;cdot 0.25^{9} &#92;cdot 0.75^{8} &#92;approx 0.009284 ' title='P = C(17, 9) &#92;cdot 0.25^{9} &#92;cdot 0.75^{8} &#92;approx 0.009284 ' class='latex' /></p>
<p>which is 120 times larger that if you don&#8217;t study at all, but still low.
</p>
<p>
In the end the best idea to pass any test is to study for it, but in case you don&#8217;t feel like it at least you can estimate how much you should study based on how lucky you feel.
</p>
<h4>Example 2</h4>
<p>
Let&#8217;s suppose we&#8217;re playing a game where you can win 1 dollar with probability <i>p = 0.5</i> and lose 1 dollar with <i>q = 1 &#8211; p</i>. The expected value of the game is:</p>
<p><img src='http://s0.wp.com/latex.php?latex=E+%3D+p+%5Ccdot+1+-+q+%5Ccdot+1+%3D+0+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='E = p &#92;cdot 1 - q &#92;cdot 1 = 0 ' title='E = p &#92;cdot 1 - q &#92;cdot 1 = 0 ' class='latex' /></p>
<p>so in the long run we would expect to neither gain, nor loose from repeatedly playing this game.
</p>
<p>
However let&#8217;s calculate the probability to win at least 4 dollars after 20 games. This is the probability to win 11 games (this means 11 vs. 9 so we gain 2 dollars) or the probability to win 12 games (this means 12 vs. 8 so 4 dollars).  We can add the probabilities because the 2 events are mutually exclusive. According to what we discussed this means:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P+%3D+C%2820%2C+11%29+%5Ccdot+0.5%5E%7B11%7D+%5Ccdot+0.5%5E%7B9%7D+%2B+C%2820%2C+12%29+%5Ccdot+0.5%5E%7B12%7D+%5Ccdot+0.5%5E%7B8%7D+%5Capprox+0.28+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P = C(20, 11) &#92;cdot 0.5^{11} &#92;cdot 0.5^{9} + C(20, 12) &#92;cdot 0.5^{12} &#92;cdot 0.5^{8} &#92;approx 0.28 ' title='P = C(20, 11) &#92;cdot 0.5^{11} &#92;cdot 0.5^{9} + C(20, 12) &#92;cdot 0.5^{12} &#92;cdot 0.5^{8} &#92;approx 0.28 ' class='latex' /></p>
<p>This looks like a good enough probability to win. For a run of 80 games we have:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P+%3D+C%2880%2C+41%29+%5Ccdot+0.5%5E%7B41%7D+%5Ccdot+0.5%5E%7B39%7D+%2B+C%2880%2C+42%29+%5Ccdot+0.5%5E%7B42%7D+%5Ccdot+0.5%5E%7B38%7D+%5Capprox+0.167+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P = C(80, 41) &#92;cdot 0.5^{41} &#92;cdot 0.5^{39} + C(80, 42) &#92;cdot 0.5^{42} &#92;cdot 0.5^{38} &#92;approx 0.167 ' title='P = C(80, 41) &#92;cdot 0.5^{41} &#92;cdot 0.5^{39} + C(80, 42) &#92;cdot 0.5^{42} &#92;cdot 0.5^{38} &#92;approx 0.167 ' class='latex' /></p>
<p>So although the probability decreases with the number of runs it is still looks significant.
</p>
<p>
So how does this work? On one side we have the expected value of the game 0, so you expect to win 0 dollars on the long run but if we actually calculate the probability to win a couple of dollars in a series of repeated games we get big numbers. The answer is simple actually, there is a probability to lose at least 4 dollars and in this case it is equal with the probability to win, so you will probably get nothing in the end of a long series of games.
</p>
<p>
Always think of all the probabilities or you will miss important ones.</p>
<br />Posted in probability  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/systematicchaos.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/systematicchaos.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/systematicchaos.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/systematicchaos.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/systematicchaos.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/systematicchaos.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/systematicchaos.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/systematicchaos.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/systematicchaos.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/systematicchaos.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/systematicchaos.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/systematicchaos.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/systematicchaos.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/systematicchaos.wordpress.com/185/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=185&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://systematicchaos.wordpress.com/2009/12/28/binomial-probability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0ee9c50780ed9f50107c6a8abd4ccdfe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jonsn0w</media:title>
		</media:content>
	</item>
		<item>
		<title>Conditional probability</title>
		<link>http://systematicchaos.wordpress.com/2009/12/17/conditional-probability/</link>
		<comments>http://systematicchaos.wordpress.com/2009/12/17/conditional-probability/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 03:08:39 +0000</pubDate>
		<dc:creator>jonsn0w</dc:creator>
				<category><![CDATA[probability]]></category>

		<guid isPermaLink="false">http://systematicchaos.wordpress.com/?p=128</guid>
		<description><![CDATA[Conditional probability is the probability of an event A, given that some other event B occurred. There is no implicit causal or temporal relationship between the two events. In most of the practical examples, there is such a relationship, but this is not necessary for the mathematical relations described here. Examplesource: A car is produced [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=128&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
Conditional probability is the probability of an event A, given that some other event B occurred. There is no implicit causal or temporal relationship between the two events. In most of the practical examples, there is such a relationship, but this is not necessary for the mathematical relations described here.
</p>
<p>
Example<sup><a target="_blank" href="http://search.barnesandnoble.com/Statistics/Moshe-Ben-Horim/e/9780394322971">source</a></sup>: A car is produced in 2 models: Model 1 and Model 2. Each model is produced in 2 designs: hatchback and wagon. Off all the cars produced, 30% are Model 1, and 20% are wagons. But 50% of Model 1 are wagons.
</p>
<p>
Let&#8217;s see this example in a <a target="_blank" href="http://en.wikipedia.org/wiki/Venn_diagram">Venn diagram</a>.</p>
<p><a href="http://systematicchaos.files.wordpress.com/2009/12/chaos004-011.png"><img src="http://systematicchaos.files.wordpress.com/2009/12/chaos004-011.png?w=225&#038;h=225" alt="" title="chaos004-01" class="alignnone size-medium wp-image-155" height="225" width="225" /></a></p>
<p>I know Venn diagrams are usually made with circles, but I drew it with rectangles since it&#8217;s easier to represent the areas exactly. This diagram illustrates the basic rules of conditional probability:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28A+%7C+B%29+%3D+%5Cfrac%7BP%28A+%5Ccap+B%29%7D%7BP%28B%29%7D%2C+%5Ctext%7B+where+%7D+P%28B%29+%5Cneq+0+%5Cquad+%281%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(A | B) = &#92;frac{P(A &#92;cap B)}{P(B)}, &#92;text{ where } P(B) &#92;neq 0 &#92;quad (1)' title='P(A | B) = &#92;frac{P(A &#92;cap B)}{P(B)}, &#92;text{ where } P(B) &#92;neq 0 &#92;quad (1)' class='latex' /></p>
<p>and</p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28B+%7C+A%29+%3D+%5Cfrac%7BP%28A+%5Ccap+B%29%7D%7BP%28A%29%7D%2C+%5Ctext%7B+where+%7D+P%28A%29+%5Cneq+0+%5Cquad+%282%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(B | A) = &#92;frac{P(A &#92;cap B)}{P(A)}, &#92;text{ where } P(A) &#92;neq 0 &#92;quad (2)' title='P(B | A) = &#92;frac{P(A &#92;cap B)}{P(A)}, &#92;text{ where } P(A) &#92;neq 0 &#92;quad (2)' class='latex' /></p>
<h3>Independent and mutually exclusive events</h3>
<p>
The event A is said to be independent of B iff:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28A+%7C+B%29+%3D+P%28A%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(A | B) = P(A)' title='P(A | B) = P(A)' class='latex' /></p>
<p>in other words, if the fact that B occurs (or not) has no effect of the probability of A. Now, are two mutually exclusive events (events that have no basic outcomes in common) also independent? Two mutually exclusive events are actually dependent of each other, since the occurrence of one of them means the second event cannot happen.
</p>
<p>
If events A and B are independent it follows that events A and B&#8217; (the complement of B); A&#8217; (the complement of A) and B; and A&#8217; and B&#8217; are independent also. A Venn diagram of 2 mutually exclusive events A and B has no intersection between them, while the diagram of 2 independent events A and B will have the following relation <img src='http://s0.wp.com/latex.php?latex=P%28A+%7C+B%29+%3D+P%28A%29+%3D+P%28A+%7C+B%27%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(A | B) = P(A) = P(A | B&#039;)' title='P(A | B) = P(A) = P(A | B&#039;)' class='latex' />. This means &#8211; according to equation (1) &#8211; that the ratio of <img src='http://s0.wp.com/latex.php?latex=A+%5Ccap+B+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='A &#92;cap B ' title='A &#92;cap B ' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=B+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='B ' title='B ' class='latex' /> is equal with the ratio of <img src='http://s0.wp.com/latex.php?latex=A+%5Ccap+B%27+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='A &#92;cap B&#039; ' title='A &#92;cap B&#039; ' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=B%27+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='B&#039; ' title='B&#039; ' class='latex' /> and equal with the proportion of A in the whole sample space.</p>
<p><a href="http://systematicchaos.files.wordpress.com/2009/12/chaos004-02.png"><img src="http://systematicchaos.files.wordpress.com/2009/12/chaos004-02.png?w=450&#038;h=225" alt="" title="chaos004-02" class="alignnone size-full wp-image-151" height="225" width="450" /></a>
</p>
<h3>Bayes&#8217; theorem</h3>
<p>
If we equal <img src='http://s0.wp.com/latex.php?latex=P%28A+%5Ccap+B%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(A &#92;cap B)' title='P(A &#92;cap B)' class='latex' /> in equations (1) and (2) above, we get Bayes&#8217; theorem:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28B+%7C+A%29+%3D+%5Cfrac%7BP%28A+%7C+B%29+%5Ccdot+P%28B%29%7D%7BP%28A%29%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(B | A) = &#92;frac{P(A | B) &#92;cdot P(B)}{P(A)}' title='P(B | A) = &#92;frac{P(A | B) &#92;cdot P(B)}{P(A)}' class='latex' /></p>
<p><a name="confusion_of_the_inverse"></a></p>
<h3>Confusion of the inverse</h3>
<p>
Confusion of the inverse is the assumption that P(A|B) is the same as P(B|A). The classical example for this is the assumption that if you&#8217;re tested positive for a particular disease that means you have that disease. Let&#8217;s try to put some numbers on this example. Usually we know the following:
</p>
<ul>
<li>P(ill) &#8211; the probability that a specific population has the disease. This is usually determined through statistics by recording the number of known cases of the disease. You can probably find this number from your favorite statistics agency.</li>
<li>P(positive|not ill) &#8211; the false positive rate for the test (type I error). This is the probability that the test will be positive for a person that does not have the disease. This value is usually denoted by <img src='http://s0.wp.com/latex.php?latex=%5Calpha+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;alpha ' title='&#92;alpha ' class='latex' />. Conversely P(negative|not ill) = <img src='http://s0.wp.com/latex.php?latex=1+-+%5Calpha&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='1 - &#92;alpha' title='1 - &#92;alpha' class='latex' /></li>
<li>P(negative | ill) &#8211; the false negative rate for the test (type II error). This is the probability that the test will be negative for a person that really has the disease. This value is usually denoted by <img src='http://s0.wp.com/latex.php?latex=%5Cbeta+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;beta ' title='&#92;beta ' class='latex' />. Conversely P(positive|ill) = <img src='http://s0.wp.com/latex.php?latex=1+-+%5Cbeta&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='1 - &#92;beta' title='1 - &#92;beta' class='latex' /></li>
</ul>
<p>
Let&#8217;s apply Bayes&#8217; theorem now:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28%5Ctext%7Bill%7D+%7C+%5Ctext%7Bpositive%7D%29+%3D+%5Cfrac%7BP%28%5Ctext%7Bpositive%7D+%7C+%5Ctext%7Bill%7D%29+%5Ccdot+P%28%5Ctext%7Bill%7D%29%7D%7BP%28%5Ctext%7Bpositive%7D%29%7D+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(&#92;text{ill} | &#92;text{positive}) = &#92;frac{P(&#92;text{positive} | &#92;text{ill}) &#92;cdot P(&#92;text{ill})}{P(&#92;text{positive})} ' title='P(&#92;text{ill} | &#92;text{positive}) = &#92;frac{P(&#92;text{positive} | &#92;text{ill}) &#92;cdot P(&#92;text{ill})}{P(&#92;text{positive})} ' class='latex' /></p>
<p>The people for which the test is positive can be split in ill or not ill. Since (being ill and testing positive) is mutually exclusive with (not being ill and testing positive) we can write:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28%5Ctext%7Bill%7D+%7C+%5Ctext%7Bpositive%7D%29+%3D+%5Cfrac%7BP%28%5Ctext%7Bpositive%7D+%7C+%5Ctext%7Bill%7D%29+%5Ccdot+P%28%5Ctext%7Bill%7D%29%7D%7BP%28%5Ctext%7Bill+%7D+%5Ccap+%5Ctext%7B+positive%7D%29+%2B+P%28%5Ctext%7Bnot+ill+%7D+%5Ccap+%5Ctext%7B+positive%7D%29%7D+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(&#92;text{ill} | &#92;text{positive}) = &#92;frac{P(&#92;text{positive} | &#92;text{ill}) &#92;cdot P(&#92;text{ill})}{P(&#92;text{ill } &#92;cap &#92;text{ positive}) + P(&#92;text{not ill } &#92;cap &#92;text{ positive})} ' title='P(&#92;text{ill} | &#92;text{positive}) = &#92;frac{P(&#92;text{positive} | &#92;text{ill}) &#92;cdot P(&#92;text{ill})}{P(&#92;text{ill } &#92;cap &#92;text{ positive}) + P(&#92;text{not ill } &#92;cap &#92;text{ positive})} ' class='latex' /></p>
<p>and then by using equation (2) we get:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28%5Ctext%7Bill%7D+%7C+%5Ctext%7Bpositive%7D%29+%3D+%5Cfrac%7BP%28%5Ctext%7Bpositive%7D+%7C+%5Ctext%7Bill%7D%29+%5Ccdot+P%28%5Ctext%7Bill%7D%29%7D%7BP%28%5Ctext%7Bpositive%7D+%7C+%5Ctext%7Bill%7D%29+%5Ccdot+P%28%5Ctext%7Bill%7D%29+%2B+P%28%5Ctext%7Bpositive%7D+%7C+%5Ctext%7Bnot+ill%7D%29+%5Ccdot+P%28%5Ctext%7Bnot+ill%7D%29%29%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(&#92;text{ill} | &#92;text{positive}) = &#92;frac{P(&#92;text{positive} | &#92;text{ill}) &#92;cdot P(&#92;text{ill})}{P(&#92;text{positive} | &#92;text{ill}) &#92;cdot P(&#92;text{ill}) + P(&#92;text{positive} | &#92;text{not ill}) &#92;cdot P(&#92;text{not ill}))}' title='P(&#92;text{ill} | &#92;text{positive}) = &#92;frac{P(&#92;text{positive} | &#92;text{ill}) &#92;cdot P(&#92;text{ill})}{P(&#92;text{positive} | &#92;text{ill}) &#92;cdot P(&#92;text{ill}) + P(&#92;text{positive} | &#92;text{not ill}) &#92;cdot P(&#92;text{not ill}))}' class='latex' /></p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28%5Ctext%7Bill%7D+%7C+%5Ctext%7Bpositive%7D%29+%3D+%5Cfrac%7B%281+-+%5Cbeta%29P%28%5Ctext%7Bill%7D%29%7D%7B%281+-+%5Cbeta%29P%28%5Ctext%7Bill%7D%29+%2B+%5Calpha%281+-+P%28%5Ctext%7Bill%7D%29%29%7D+%5Cquad+%283%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(&#92;text{ill} | &#92;text{positive}) = &#92;frac{(1 - &#92;beta)P(&#92;text{ill})}{(1 - &#92;beta)P(&#92;text{ill}) + &#92;alpha(1 - P(&#92;text{ill}))} &#92;quad (3)' title='P(&#92;text{ill} | &#92;text{positive}) = &#92;frac{(1 - &#92;beta)P(&#92;text{ill})}{(1 - &#92;beta)P(&#92;text{ill}) + &#92;alpha(1 - P(&#92;text{ill}))} &#92;quad (3)' class='latex' /></p>
<p>which is obviously different from P(positive|ill) = <img src='http://s0.wp.com/latex.php?latex=1+-+%5Cbeta+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='1 - &#92;beta ' title='1 - &#92;beta ' class='latex' />.
</p>
<p>
How different? Well for any reasonable good test we should expect <img src='http://s0.wp.com/latex.php?latex=%5Calpha+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;alpha ' title='&#92;alpha ' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cbeta+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;beta ' title='&#92;beta ' class='latex' /> to be really small. So below you can see 2 graphs (3D because we have 2 independent variables <img src='http://s0.wp.com/latex.php?latex=%5Calpha+%3C+0.1+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;alpha &lt; 0.1 ' title='&#92;alpha &lt; 0.1 ' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cbeta+%3C+0.1+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;beta &lt; 0.1 ' title='&#92;beta &lt; 0.1 ' class='latex' />) for 2 different values of P(ill).</p>
<p><a href="http://systematicchaos.files.wordpress.com/2009/12/chaos004-03.png"><img src="http://systematicchaos.files.wordpress.com/2009/12/chaos004-03.png?w=450&#038;h=337" alt="" title="chaos004-03" class="alignnone size-full wp-image-166" height="337" width="450" /></a></p>
<p><a href="http://systematicchaos.files.wordpress.com/2009/12/chaos004-04.png"><img src="http://systematicchaos.files.wordpress.com/2009/12/chaos004-04.png?w=450&#038;h=337" alt="" title="chaos004-04" class="alignnone size-full wp-image-167" height="337" width="450" /></a></p>
<p>While P(positive|ill) depends only on the parameters of the test, P(ill|positive) depends on the parameters of the test and also on P(ill). The difference between the two is larger when P(ill) is smaller, meaning if the disease is rare, it is less probable that one test will tell you that you are sick (unless it has amazingly low false positive and false negative rates).
</p>
<p>
Conditional probabilities are easy to guesstimate and difficult to calculate. And remember that usually in this case guesstimate is more of a wild guess based on your emotions at that particular moment then an estimate. When dealing with conditional probabilities it is better to think, calculate them, calculate them again and then  look for an independent confirmation just to be sure that you&#8217;ve done it right.</p>
<br />Posted in probability  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/systematicchaos.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/systematicchaos.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/systematicchaos.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/systematicchaos.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/systematicchaos.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/systematicchaos.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/systematicchaos.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/systematicchaos.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/systematicchaos.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/systematicchaos.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/systematicchaos.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/systematicchaos.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/systematicchaos.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/systematicchaos.wordpress.com/128/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=128&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://systematicchaos.wordpress.com/2009/12/17/conditional-probability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0ee9c50780ed9f50107c6a8abd4ccdfe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jonsn0w</media:title>
		</media:content>

		<media:content url="http://systematicchaos.files.wordpress.com/2009/12/chaos004-011.png?w=300" medium="image">
			<media:title type="html">chaos004-01</media:title>
		</media:content>

		<media:content url="http://systematicchaos.files.wordpress.com/2009/12/chaos004-02.png" medium="image">
			<media:title type="html">chaos004-02</media:title>
		</media:content>

		<media:content url="http://systematicchaos.files.wordpress.com/2009/12/chaos004-03.png" medium="image">
			<media:title type="html">chaos004-03</media:title>
		</media:content>

		<media:content url="http://systematicchaos.files.wordpress.com/2009/12/chaos004-04.png" medium="image">
			<media:title type="html">chaos004-04</media:title>
		</media:content>
	</item>
		<item>
		<title>Poker probabilities</title>
		<link>http://systematicchaos.wordpress.com/2009/12/09/poker-probabilities/</link>
		<comments>http://systematicchaos.wordpress.com/2009/12/09/poker-probabilities/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 04:11:22 +0000</pubDate>
		<dc:creator>jonsn0w</dc:creator>
				<category><![CDATA[gambling]]></category>
		<category><![CDATA[probability]]></category>

		<guid isPermaLink="false">http://systematicchaos.wordpress.com/?p=100</guid>
		<description><![CDATA[I got this problem from a friend, and although the answer can be found with a web search I will reproduce it here for future reference. What are the probabilities of the different poker hands? First let me be specific in that I&#8217;m talking about the probability of getting one of the poker hands at [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=100&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
I got this problem from a friend, and although the answer can be found with a web search I will reproduce it here for future reference.
</p>
<p>
What are the probabilities of the different poker hands? First let me be specific in that I&#8217;m talking about the probability of getting one of the poker hands at the first draw from a full deck of cards. So we have 52 cards (no wild cards) and we draw 5, or we a number of players and we give 5 cards to each.
</p>
<p>
Both of the above situations are equivalent. There is no difference in the way you calculate the probability if you draw the first 5 cards or you draw the 2nd, 6th, 10th, 14th and 18th card from the deck.
</p>
<h4>Royal Flush</h4>
<p>
Royal flush is ace, king, queen, jack, ten in the same suit. The probability is:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_%7Broyal%5C_flush%7D+%3D+%5Cfrac%7B4%7D%7BC%2852%2C+5%29%7D+%5Capprox+0.0001539%5C%25&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_{royal&#92;_flush} = &#92;frac{4}{C(52, 5)} &#92;approx 0.0001539&#92;%' title='P_{royal&#92;_flush} = &#92;frac{4}{C(52, 5)} &#92;approx 0.0001539&#92;%' class='latex' /></p>
<p>There is only 1 possible combination for each suit that can give you a royal flush, multiplied with the number of suits.
</p>
<h4>Straight Flush</h4>
<p>
Straight flush is 5 cards in rank sequence and of the same suit. The probability is (including royal flush):</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_%7Bstraight%5C_flush%7D+%3D+%5Cfrac%7B4+%5Ccdot+10%7D%7BC%2852%2C+5%29%7D+%5Capprox+0.001539%5C%25&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_{straight&#92;_flush} = &#92;frac{4 &#92;cdot 10}{C(52, 5)} &#92;approx 0.001539&#92;%' title='P_{straight&#92;_flush} = &#92;frac{4 &#92;cdot 10}{C(52, 5)} &#92;approx 0.001539&#92;%' class='latex' /></p>
<p>There are 10 ways of getting 5 cards from 14 in rank sequence (because we can have ace-high or an ace-low straight flush) for each suit, multiplied with the number of suits.
</p>
<h4>Four of a kind</h4>
<p>
Four of a kind means 4 cards of one rank, and an unmatched card of another rank. The probability is:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_%7B4%5C_of%5C_kind%7D+%3D+%5Cfrac%7B13+%5Ccdot+48%7D%7BC%2852%2C+5%29%7D+%5Capprox+0.024%5C%25&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_{4&#92;_of&#92;_kind} = &#92;frac{13 &#92;cdot 48}{C(52, 5)} &#92;approx 0.024&#92;%' title='P_{4&#92;_of&#92;_kind} = &#92;frac{13 &#92;cdot 48}{C(52, 5)} &#92;approx 0.024&#92;%' class='latex' /></p>
<p>There are 13 possible ways to get 4 cards of the same rank (that&#8217;s the number of ranks available) and there are (52 &#8211; 4) possible ways to get the remaining 5th card.
</p>
<h4>Full house</h4>
<p>
Full house means 3 matching cards of one rank, and 2 matching cards of another rank. The probability is:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_%7Bfull%5C_house%7D+%3D+%5Cfrac%7BP%2813%2C+2%29+%5Ccdot+C%284%2C+3%29+%5Ccdot+C%284%2C+2%29%7D%7BC%2852%2C+5%29%7D+%5Capprox+0.144%5C%25&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_{full&#92;_house} = &#92;frac{P(13, 2) &#92;cdot C(4, 3) &#92;cdot C(4, 2)}{C(52, 5)} &#92;approx 0.144&#92;%' title='P_{full&#92;_house} = &#92;frac{P(13, 2) &#92;cdot C(4, 3) &#92;cdot C(4, 2)}{C(52, 5)} &#92;approx 0.144&#92;%' class='latex' /></p>
<p>There are <img src='http://s0.wp.com/latex.php?latex=P%2852%2C+5%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(52, 5)' title='P(52, 5)' class='latex' /> possible ways to get 2 suits from the 13 available. This is because in this case it matters if for example we have 3 cards of clubs and 2 cards of spades or 3 cards of spades and 2 cards of clubs. There are <img src='http://s0.wp.com/latex.php?latex=C%284%2C+3%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='C(4, 3)' title='C(4, 3)' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=C%284%2C+2%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='C(4, 2)' title='C(4, 2)' class='latex' /> possible ways of getting 3 and respectively 2 cards from the 4 cards of the same rank.
</p>
<h4>Flush</h4>
<p>
Flush means 5 cards of the same suit, not in rank sequence, excluding the straight flush and royal flush. The probability is:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_%7Bflush%7D+%3D+%5Cfrac%7B4+%5Ccdot+C%2813%2C+5%29+-+40%7D%7BC%2852%2C+5%29%7D+%5Capprox+0.19654%5C%25&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_{flush} = &#92;frac{4 &#92;cdot C(13, 5) - 40}{C(52, 5)} &#92;approx 0.19654&#92;%' title='P_{flush} = &#92;frac{4 &#92;cdot C(13, 5) - 40}{C(52, 5)} &#92;approx 0.19654&#92;%' class='latex' /></p>
<p>There are <img src='http://s0.wp.com/latex.php?latex=C%2813%2C+5%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='C(13, 5)' title='C(13, 5)' class='latex' /> possible ways to get 5 cards from each suit and we have to subtract the 40 straight flushes (see above) from that number.
</p>
<h4>Straight</h4>
<p>
Straight means 5 cards in rank sequence but in more than one suit. The probability is:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_%7Bstraight%7D+%3D+%5Cfrac%7B10+%5Ccdot+4%5E5+-+40%7D%7BC%2852%2C+5%29%7D+%5Capprox+0.39246468%5C%25&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_{straight} = &#92;frac{10 &#92;cdot 4^5 - 40}{C(52, 5)} &#92;approx 0.39246468&#92;%' title='P_{straight} = &#92;frac{10 &#92;cdot 4^5 - 40}{C(52, 5)} &#92;approx 0.39246468&#92;%' class='latex' /></p>
<p>There are 10 ways of getting 5 cards in rank sequence and <img src='http://s0.wp.com/latex.php?latex=4%5E5&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='4^5' title='4^5' class='latex' /> combinations available for those 5 cards. As before we have to subtract the 40 straight flushes from that number.
</p>
<h4>Three of a kind</h4>
<p>
Three of a kind means 3 cards of the same rank, plus 2 unmatched cards. The probability is:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_%7B3%5C_of%5C_kind%7D+%3D+%5Cfrac%7B13+%5Ccdot+C%284%2C+3%29+%5Ccdot+C%2812%2C+2%29+%5Ccdot+4%5E2%7D%7BC%2852%2C+5%29%7D+%5Capprox+2.1129%5C%25&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_{3&#92;_of&#92;_kind} = &#92;frac{13 &#92;cdot C(4, 3) &#92;cdot C(12, 2) &#92;cdot 4^2}{C(52, 5)} &#92;approx 2.1129&#92;%' title='P_{3&#92;_of&#92;_kind} = &#92;frac{13 &#92;cdot C(4, 3) &#92;cdot C(12, 2) &#92;cdot 4^2}{C(52, 5)} &#92;approx 2.1129&#92;%' class='latex' /></p>
<p>OK, so there are <img src='http://s0.wp.com/latex.php?latex=C%284%2C+3%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='C(4, 3)' title='C(4, 3)' class='latex' /> possible ways of selecting 3 cards from 4 of the same rank, and we have to multiply this with the number of ranks. For the remaining 2 cards there are <img src='http://s0.wp.com/latex.php?latex=C%2812%2C+2%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='C(12, 2)' title='C(12, 2)' class='latex' /> possible ways of selecting the rank so it would not match the rank of the first 3 cards, and <img src='http://s0.wp.com/latex.php?latex=4%5E2&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='4^2' title='4^2' class='latex' /> combinations available for those 2 cards.
</p>
<h4>Two pair</h4>
<p>
Two pair means two cards of the same rank, plus two cards of another rank (that match each other but not the first pair), plus one unmatched card. The probability is:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_%7B2%5C_pair%7D+%3D+%5Cfrac%7BC%2813%2C+2%29+%5Ccdot+C%284%2C+2%29+%5Ccdot+C%284%2C+2%29+%5Ccdot+11+%5Ccdot+4%7D%7BC%2852%2C+5%29%7D+%5Capprox+4.7539%5C%25&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_{2&#92;_pair} = &#92;frac{C(13, 2) &#92;cdot C(4, 2) &#92;cdot C(4, 2) &#92;cdot 11 &#92;cdot 4}{C(52, 5)} &#92;approx 4.7539&#92;%' title='P_{2&#92;_pair} = &#92;frac{C(13, 2) &#92;cdot C(4, 2) &#92;cdot C(4, 2) &#92;cdot 11 &#92;cdot 4}{C(52, 5)} &#92;approx 4.7539&#92;%' class='latex' /></p>
<p>We have <img src='http://s0.wp.com/latex.php?latex=C%2813%2C+2%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='C(13, 2)' title='C(13, 2)' class='latex' /> possible ways of selecting 2 different ranks from the 13 available, multiplied twice with <img src='http://s0.wp.com/latex.php?latex=C%284%2C+2%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='C(4, 2)' title='C(4, 2)' class='latex' /> which is the number of possible ways of selecting 3 cards from 4 of the same rank. For the remaining card we have only 11 suits available and 4 possible cards per suit.
</p>
<h4>One pair</h4>
<p>
One pair means two cards of the same rank, plus three other unmatched cards. The probability is:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_%7B2%5C_pair%7D+%3D+%5Cfrac%7B13+%5Ccdot+C%284%2C+2%29+%5Ccdot+C%2812%2C+3%29+%5Ccdot+4%5E3%7D%7BC%2852%2C+5%29%7D+%5Capprox+42.2569%5C%25&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_{2&#92;_pair} = &#92;frac{13 &#92;cdot C(4, 2) &#92;cdot C(12, 3) &#92;cdot 4^3}{C(52, 5)} &#92;approx 42.2569&#92;%' title='P_{2&#92;_pair} = &#92;frac{13 &#92;cdot C(4, 2) &#92;cdot C(12, 3) &#92;cdot 4^3}{C(52, 5)} &#92;approx 42.2569&#92;%' class='latex' /></p>
<p>We have <img src='http://s0.wp.com/latex.php?latex=C%284%2C+2%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='C(4, 2)' title='C(4, 2)' class='latex' /> possible ways of selecting 2 cards from 4 of the same rank multiplied with the number of ranks. For the remaining 3 cards we have <img src='http://s0.wp.com/latex.php?latex=C%2812%2C+3%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='C(12, 3)' title='C(12, 3)' class='latex' /> possible ways of selecting a different rank and <img src='http://s0.wp.com/latex.php?latex=4%5E3&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='4^3' title='4^3' class='latex' /> combinations available for those 3 cards.
</p>
<p>
For a final overview, the below pie chart shows all the probabilities discussed previously (all of them are in the chart, just that some of them are really small).</p>
<p><a href="http://systematicchaos.files.wordpress.com/2009/12/chaos3-01.png"><img src="http://systematicchaos.files.wordpress.com/2009/12/chaos3-01.png?w=450&#038;h=450" alt="" title="chaos3-01" width="450" height="450" class="alignnone size-full wp-image-120" /></a></p>
<br />Posted in gambling, probability  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/systematicchaos.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/systematicchaos.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/systematicchaos.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/systematicchaos.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/systematicchaos.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/systematicchaos.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/systematicchaos.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/systematicchaos.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/systematicchaos.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/systematicchaos.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/systematicchaos.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/systematicchaos.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/systematicchaos.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/systematicchaos.wordpress.com/100/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=100&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://systematicchaos.wordpress.com/2009/12/09/poker-probabilities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0ee9c50780ed9f50107c6a8abd4ccdfe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jonsn0w</media:title>
		</media:content>

		<media:content url="http://systematicchaos.files.wordpress.com/2009/12/chaos3-01.png" medium="image">
			<media:title type="html">chaos3-01</media:title>
		</media:content>
	</item>
		<item>
		<title>Gambler&#8217;s ruin</title>
		<link>http://systematicchaos.wordpress.com/2009/12/05/gamblers-ruin/</link>
		<comments>http://systematicchaos.wordpress.com/2009/12/05/gamblers-ruin/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 04:07:04 +0000</pubDate>
		<dc:creator>jonsn0w</dc:creator>
				<category><![CDATA[gambling]]></category>
		<category><![CDATA[probability]]></category>

		<guid isPermaLink="false">http://systematicchaos.wordpress.com/?p=31</guid>
		<description><![CDATA[Let&#8217;s suppose you play with an opponent the following game: if you win you get 1 dollar, if you lose you lose 1 dollar. The probability to win the game is p (and conversely the probability to lose the game is q = 1 &#8211; p), you start with i dollars and your opponent with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=31&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
Let&#8217;s suppose you play with an opponent the following game: if you win you get 1 dollar, if you lose you lose 1 dollar. The probability to win the game is <i>p</i> (and conversely the probability to lose the game is <i>q = 1 &#8211; p</i>), you start with <i>i</i> dollars and your opponent with <i>N &#8211; i</i> dollars (N is the total sum in the game). What is the probability to win the whole sum of money, before you go broke? Or in scientific terms we&#8217;re looking for the probability to win everything <i>P(N|i)</i>, that is the probability to win N dollars conditioned by starting with <i>i</i> dollars. After a <a href="#proof">not so complicated proof</a> the result is:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28N%7Ci%29+%3D+%5Cbegin%7Bcases%7D+%5Cfrac%7B1+-+%5Crho%5Ei%7D%7B1+-+%5Crho%5EN%7D+%26+p+%5Cneq+q%2C+%28%5Crho+%3D+%5Cfrac%7Bq%7D%7Bp%7D%29%5C%5C+%5Cfrac%7Bi%7D%7BN%7D+%26+p+%3D+q+%3D+0.5+%5Cend%7Bcases%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(N|i) = &#92;begin{cases} &#92;frac{1 - &#92;rho^i}{1 - &#92;rho^N} &amp; p &#92;neq q, (&#92;rho = &#92;frac{q}{p})&#92;&#92; &#92;frac{i}{N} &amp; p = q = 0.5 &#92;end{cases}' title='P(N|i) = &#92;begin{cases} &#92;frac{1 - &#92;rho^i}{1 - &#92;rho^N} &amp; p &#92;neq q, (&#92;rho = &#92;frac{q}{p})&#92;&#92; &#92;frac{i}{N} &amp; p = q = 0.5 &#92;end{cases}' class='latex' />
</p>
<p>
This problem is known as <i>gambler&#8217;s ruin</i> and was first proposed by <a target="_blank" href="http://en.wikipedia.org/wiki/Christiaan_Huygens">Christiaan Huygens</a>. Let&#8217;s plot the above result and see if we can draw some conclusions from this problem.</p>
<p><a href="http://systematicchaos.files.wordpress.com/2009/12/chaos2-01.png"><img src="http://systematicchaos.files.wordpress.com/2009/12/chaos2-01.png?w=450&#038;h=337" alt="" title="chaos2-01" class="alignnone size-medium wp-image-93" height="337" width="450" /></a>
</p>
<p>
First, in the case of a perfectly fair game (<i>p = q = 0.5</i>, meaning no player has an advantage) the probability to win the total amount is dependent only on how much money you start with. In other words the one with the most money, has a bigger probability to win. Or if you prefer the corollary, if you want all the money in a game try to start the game with most of them in your pocket.
</p>
<p>
If the game is not perfectly fair it gets even worse. If <i>N = 50</i> dollars and you start with 20 dollars, the probability to win everything drops to below 0.1 if the probability of winning one game is just slightly against you (0.48). The probability to win everything decreases slowly after that (if the probability to win a game goes below 0.48) but that just shows that a small difference is all it takes, you don&#8217;t need to cheat to badly to get an effect.
</p>
<p>
So the lesson is simple. If you want to maximize the probability to win all the money in a series of games, try to start with (much) more money than your opponent(s) and try to have a bigger chance of winning the game than your opponent(s). This is the basic principle why professional gambling establishments cannot lose since they will make sure that both of the above conditions are met for them.
</p>
<p><a name="proof"></a></p>
<h3>Annex</h3>
<p>
To find <i>P(N|i)</i> let&#8217;s draw a Markov chain. This is basically a graphical representation of the gaming process as a series of states (characterized by the amount of money you have won <i>i</i>). The future state is determined only by the present state and the probabilities <i>p</i> and <i>q</i>. The states 0 and N are special end states, meaning if you reach them the game has ended. Also in the 0 and N states we have the boundary conditions <i>P(N|0) = 0</i> (you can&#8217;t win the game if you have 0 dollars) and <i>P(N|N) = 1</i> (you have won the game if you have N dollars).</p>
<p><a href="http://systematicchaos.files.wordpress.com/2009/12/chaos2-02.png"><img src="http://systematicchaos.files.wordpress.com/2009/12/chaos2-02.png?w=450&#038;h=88" alt="" title="chaos2-02" class="alignnone size-medium wp-image-94" height="88" width="450" /></a>
</p>
<p>
For any state <i>i</i> except 0 and N we have probability <i>p</i> to go to state <i>i + 1</i> (green transition) and probability <i>q</i> to go to state <i>i &#8211; 1</i> (red transition). So we can write the following:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28N%7Ci%29+%3D+qP%28N%7Ci-1%29+%2B+pP%28N%7Ci%2B1%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(N|i) = qP(N|i-1) + pP(N|i+1)' title='P(N|i) = qP(N|i-1) + pP(N|i+1)' class='latex' /><br />
<br />
<img src='http://s0.wp.com/latex.php?latex=P_i+%3D+qP_%7Bi-1%7D+%2B+pP_%7Bi%2B1%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_i = qP_{i-1} + pP_{i+1}' title='P_i = qP_{i-1} + pP_{i+1}' class='latex' /><br />
<br />
<img src='http://s0.wp.com/latex.php?latex=%28p%2Bq%29P_i+%3D+qP_%7Bi-1%7D+%2B+pP_%7Bi%2B1%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='(p+q)P_i = qP_{i-1} + pP_{i+1}' title='(p+q)P_i = qP_{i-1} + pP_{i+1}' class='latex' /><br />
<br />
<img src='http://s0.wp.com/latex.php?latex=p%28P_%7Bi%2B1%7D+-+P_i%29+%3D+q%28P_i+-+P_%7Bi-1%7D%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='p(P_{i+1} - P_i) = q(P_i - P_{i-1})' title='p(P_{i+1} - P_i) = q(P_i - P_{i-1})' class='latex' /><br />
<br />
<img src='http://s0.wp.com/latex.php?latex=P_%7Bi%2B1%7D+-+P_i+%3D+%5Cfrac%7Bq%7D%7Bp%7D%28P_i+-+P_%7Bi-1%7D%29+%3D+%5Crho%28P_i+-+P_%7Bi-1%7D%29+%5Cquad+%281%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_{i+1} - P_i = &#92;frac{q}{p}(P_i - P_{i-1}) = &#92;rho(P_i - P_{i-1}) &#92;quad (1)' title='P_{i+1} - P_i = &#92;frac{q}{p}(P_i - P_{i-1}) = &#92;rho(P_i - P_{i-1}) &#92;quad (1)' class='latex' />
</p>
<p>
We know that <i>P(N|0) = 0</i> and by writing equation (1) for each transition:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_2+-+P_1+%3D+%5Crho+P_1&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_2 - P_1 = &#92;rho P_1' title='P_2 - P_1 = &#92;rho P_1' class='latex' /><br />
<br />
<img src='http://s0.wp.com/latex.php?latex=P_3+-+P_2+%3D+%5Crho+%28P_2+-+P_1%29+%3D+%5Crho%5E2+P_1&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_3 - P_2 = &#92;rho (P_2 - P_1) = &#92;rho^2 P_1' title='P_3 - P_2 = &#92;rho (P_2 - P_1) = &#92;rho^2 P_1' class='latex' /><br />
<br />
<img src='http://s0.wp.com/latex.php?latex=%5Ccdots&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;cdots' title='&#92;cdots' class='latex' /><br />
<br />
<img src='http://s0.wp.com/latex.php?latex=P_i+-+P_%7Bi-1%7D+%3D+%5Crho%5E%7Bi-1%7D+P_1&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_i - P_{i-1} = &#92;rho^{i-1} P_1' title='P_i - P_{i-1} = &#92;rho^{i-1} P_1' class='latex' />
</p>
<p>
Adding all the above:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_i+-+P_1+%3D+%28%5Crho+%2B+%5Crho%5E2+%2B+%5Ccdots+%2B+%5Crho%5E%7Bi-1%7D%29+P_1&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_i - P_1 = (&#92;rho + &#92;rho^2 + &#92;cdots + &#92;rho^{i-1}) P_1' title='P_i - P_1 = (&#92;rho + &#92;rho^2 + &#92;cdots + &#92;rho^{i-1}) P_1' class='latex' /><br />
<br />
<img src='http://s0.wp.com/latex.php?latex=P_i+%3D+%281+%2B+%5Crho+%2B+%5Crho%5E2+%2B+%5Ccdots+%2B+%5Crho%5E%7Bi-1%7D%29+P_1&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_i = (1 + &#92;rho + &#92;rho^2 + &#92;cdots + &#92;rho^{i-1}) P_1' title='P_i = (1 + &#92;rho + &#92;rho^2 + &#92;cdots + &#92;rho^{i-1}) P_1' class='latex' /><br />
<br />
<img src='http://s0.wp.com/latex.php?latex=P_i+%3D+P_1+%5Cfrac%7B1+-+%5Crho%5Ei%7D%7B1+-+%5Crho%7D+%5Cquad+%282%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_i = P_1 &#92;frac{1 - &#92;rho^i}{1 - &#92;rho} &#92;quad (2)' title='P_i = P_1 &#92;frac{1 - &#92;rho^i}{1 - &#92;rho} &#92;quad (2)' class='latex' />
</p>
<p>
Writing the other boundary condition <i>P(N|N) = 1</i> for equation (2) we get:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_N+%3D+P_1+%5Cfrac%7B1+-+%5Crho%5EN%7D%7B1+-+%5Crho%7D+%3D+1&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_N = P_1 &#92;frac{1 - &#92;rho^N}{1 - &#92;rho} = 1' title='P_N = P_1 &#92;frac{1 - &#92;rho^N}{1 - &#92;rho} = 1' class='latex' /><br />
<br />
<img src='http://s0.wp.com/latex.php?latex=P_1+%3D+%5Cfrac%7B1+-+%5Crho%7D%7B1+-+%5Crho%5EN%7D+%5Cquad+%283%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_1 = &#92;frac{1 - &#92;rho}{1 - &#92;rho^N} &#92;quad (3)' title='P_1 = &#92;frac{1 - &#92;rho}{1 - &#92;rho^N} &#92;quad (3)' class='latex' />
</p>
<p>
Replacing (2) into (3) we get the relation we were looking for:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_i+%3D+%5Cfrac%7B1+-+%5Crho%5Ei%7D%7B1+-+%5Crho%5EN%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_i = &#92;frac{1 - &#92;rho^i}{1 - &#92;rho^N}' title='P_i = &#92;frac{1 - &#92;rho^i}{1 - &#92;rho^N}' class='latex' />
</p>
<p>
Of course this result is not valid for <i>ρ = 1</i>, but this case is easily demonstrated by replacing <i>ρ</i> into equation (2), where we get:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_i+%3D+iP_1&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_i = iP_1' title='P_i = iP_1' class='latex' />
</p>
<p>
In this case the boundary condition becomes:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_N+%3D+NP_1+%3D+1&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_N = NP_1 = 1' title='P_N = NP_1 = 1' class='latex' />
</p>
<p>
And the result for <i>ρ = 1 (p = q = 0.5)</i> is:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P_i+%3D+%5Cfrac%7Bi%7D%7BN%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P_i = &#92;frac{i}{N}' title='P_i = &#92;frac{i}{N}' class='latex' /></p>
<br />Posted in gambling, probability  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/systematicchaos.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/systematicchaos.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/systematicchaos.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/systematicchaos.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/systematicchaos.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/systematicchaos.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/systematicchaos.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/systematicchaos.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/systematicchaos.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/systematicchaos.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/systematicchaos.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/systematicchaos.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/systematicchaos.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/systematicchaos.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=31&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://systematicchaos.wordpress.com/2009/12/05/gamblers-ruin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0ee9c50780ed9f50107c6a8abd4ccdfe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jonsn0w</media:title>
		</media:content>

		<media:content url="http://systematicchaos.files.wordpress.com/2009/12/chaos2-01.png?w=300" medium="image">
			<media:title type="html">chaos2-01</media:title>
		</media:content>

		<media:content url="http://systematicchaos.files.wordpress.com/2009/12/chaos2-02.png?w=300" medium="image">
			<media:title type="html">chaos2-02</media:title>
		</media:content>
	</item>
		<item>
		<title>Two dice can be tricky</title>
		<link>http://systematicchaos.wordpress.com/2009/11/26/tricky-dice/</link>
		<comments>http://systematicchaos.wordpress.com/2009/11/26/tricky-dice/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 03:54:15 +0000</pubDate>
		<dc:creator>jonsn0w</dc:creator>
				<category><![CDATA[gambling]]></category>
		<category><![CDATA[probability]]></category>

		<guid isPermaLink="false">http://systematicchaos.wordpress.com/2009/11/26/hello-world/</guid>
		<description><![CDATA[In the 17th century French salons, one of the favourite pastimes was gambling. One of the essayists of those times, Chevalier de Méré was playing the following game: roll a single die 4 times and bet of getting a 6. His reasoning was the following: if the probability of getting 6 for one roll is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=1&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
In the 17th century French salons, one of the favourite pastimes was gambling. One of the essayists of those times, Chevalier de Méré was playing the following game: roll a single die 4 times and bet of getting a 6. His reasoning was the following: if the probability of getting 6 for one roll is 1/6, then for 4 rolls it would be 4/6, so in the long run he would win more than he would lose.
</p>
<p>
When nobody wanted to play with him anymore because he was winning, he changed his game a little: roll 2 dice 24 times and bet on getting a double 6. I this case his reasoning was: the chance of getting a double 6 for one roll (of 2 dice) is 1/36. So by throwing 24 time the probability would be 24/36 = 4/6 so he would still win (although it would take a longer time) but the game being different he could convince people to play again with him. To his total surprise he started to lose in this game. Since he could not explain this he asked one of his friends, <a target="_blank" href="http://en.wikipedia.org/wiki/Blaise_Pascal">Blaise Pascal</a> to help him with the mathematics.
</p>
<p>
So let&#8217;s see the correct way to estimate the probabilities in this (simple) case.
</p>
<h3>Game 1</h3>
<p>
First of all it is not correct to add probabilities in this case. If we have 2 events A and B then:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28A+%5Ctext%7B+or+%7D+B%29+%3D+P%28A%29+%2B+P%28B%29+-+P%28A+%5Ctext+%7B+and+%7D+B%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(A &#92;text{ or } B) = P(A) + P(B) - P(A &#92;text { and } B)' title='P(A &#92;text{ or } B) = P(A) + P(B) - P(A &#92;text { and } B)' class='latex' /></p>
<p><i>P(A and B)</i> is 0 only if the events are <i>mutually exclusive</i>, that is there is no basic outcome that is common for A and B. In our case if event A is: get 6 on the first roll and event B is: get 6 on the second roll, there is a basic outcome: get 6 on the first roll and get 6 on the second roll, which is common to both A and B, so that means we cannot ignore P(A and B) in the formula above. This reasoning obviously applies to the remaining die rolls.
</p>
<p>
The correct way to calculate the probability is the following:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28%5Ctext+%7Bgetting+at+least+one+6+in+4+die+rolls%7D%29+%3D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(&#92;text {getting at least one 6 in 4 die rolls}) =' title='P(&#92;text {getting at least one 6 in 4 die rolls}) =' class='latex' /><br />
<img src='http://s0.wp.com/latex.php?latex=%5Ctext%7B++%7D1+-+P%28%5Ctext%7Bnot+getting+6+on+any+roll%7D%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;text{  }1 - P(&#92;text{not getting 6 on any roll})' title='&#92;text{  }1 - P(&#92;text{not getting 6 on any roll})' class='latex' /></p>
<p>where </p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28%5Ctext%7Bnot+getting+6+on+any+die+roll%7D%29+%3D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(&#92;text{not getting 6 on any die roll}) =' title='P(&#92;text{not getting 6 on any die roll}) =' class='latex' /><br />
<img src='http://s0.wp.com/latex.php?latex=P%28%5Ctext%7B%28not+getting+6+on+the+first+roll%29+AND%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(&#92;text{(not getting 6 on the first roll) AND}' title='P(&#92;text{(not getting 6 on the first roll) AND}' class='latex' /><br />
<img src='http://s0.wp.com/latex.php?latex=%5Ctext%7B%28not+getting+6+on+the+second+roll%29+AND+...+so+on%7D%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;text{(not getting 6 on the second roll) AND ... so on})' title='&#92;text{(not getting 6 on the second roll) AND ... so on})' class='latex' /></p>
<p>For 2 events:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28A+%5Ctext%7B+and+%7D+B%29+%3D+P%28A%29P%28B%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(A &#92;text{ and } B) = P(A)P(B)' title='P(A &#92;text{ and } B) = P(A)P(B)' class='latex' /></p>
<p><b>only</b> if the 2 events are <i>independent</i> that is A happening has no influence over B happening. In our case that means that getting 6 on the first roll has no influence over getting 6 on the second roll which is true.
</p>
<p>
So the correct probability for this game is:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28win%29+%3D+1+-+%5Cleft%28%5Cfrac%7B5%7D%7B6%7D%5Cright%29+%5Cleft%28%5Cfrac%7B5%7D%7B6%7D%5Cright%29+%5Cleft%28%5Cfrac%7B5%7D%7B6%7D%5Cright%29+%5Cleft%28%5Cfrac%7B5%7D%7B6%7D%5Cright%29%3D+1+-+%5Cleft%28%5Cfrac%7B5%7D%7B6%7D%5Cright%29%5E4+%3D+0.51775&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(win) = 1 - &#92;left(&#92;frac{5}{6}&#92;right) &#92;left(&#92;frac{5}{6}&#92;right) &#92;left(&#92;frac{5}{6}&#92;right) &#92;left(&#92;frac{5}{6}&#92;right)= 1 - &#92;left(&#92;frac{5}{6}&#92;right)^4 = 0.51775' title='P(win) = 1 - &#92;left(&#92;frac{5}{6}&#92;right) &#92;left(&#92;frac{5}{6}&#92;right) &#92;left(&#92;frac{5}{6}&#92;right) &#92;left(&#92;frac{5}{6}&#92;right)= 1 - &#92;left(&#92;frac{5}{6}&#92;right)^4 = 0.51775' class='latex' /></p>
<p>Thus, Chevalier de Méré had almost 52% chance of winning (instead of his estimate of 66.6%) so we can say he was lucky in his probability estimation.
</p>
<p>
The <a target="_blank" href="http://en.wikipedia.org/wiki/Expected_value">expected value</a> is a useful measure of the winnings/losses in the long run. Assuming that each participant is paying 1 dollar per game the expected value is:</p>
<p><img src='http://s0.wp.com/latex.php?latex=E+%3D+2+%5Ccdot+P%28win%29+%2B+%28-2%29+%5Ccdot+P%28lose%29+%3D+0.071&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='E = 2 &#92;cdot P(win) + (-2) &#92;cdot P(lose) = 0.071' title='E = 2 &#92;cdot P(win) + (-2) &#92;cdot P(lose) = 0.071' class='latex' /></p>
<h3>Game 2</h3>
<p>
As seen from the previous game, in this case the correct probability is:</p>
<p><img src='http://s0.wp.com/latex.php?latex=P%28win%29+%3D+1+-+%5Cleft%28%5Cfrac%7B35%7D%7B36%7D%5Cright%29%5E%7B24%7D+%3D+0.4914&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='P(win) = 1 - &#92;left(&#92;frac{35}{36}&#92;right)^{24} = 0.4914' title='P(win) = 1 - &#92;left(&#92;frac{35}{36}&#92;right)^{24} = 0.4914' class='latex' /></p>
<p>and the expected value:</p>
<p><img src='http://s0.wp.com/latex.php?latex=E+%3D+2+%5Ccdot+P%28win%29+%2B+%28-2%29+%5Ccdot+P%28lose%29+%3D+-0.035&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='E = 2 &#92;cdot P(win) + (-2) &#92;cdot P(lose) = -0.035' title='E = 2 &#92;cdot P(win) + (-2) &#92;cdot P(lose) = -0.035' class='latex' /></p>
<p>
As indicated by practice (presumably) Chevalier de Méré would lose on this second game. If there&#8217;s a lesson we can learn from this is don&#8217;t estimate probability if you don&#8217;t know the rules, you will get it wrong even for simple 2 dice games.</p>
<br />Posted in gambling, probability  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/systematicchaos.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/systematicchaos.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/systematicchaos.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/systematicchaos.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/systematicchaos.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/systematicchaos.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/systematicchaos.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/systematicchaos.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/systematicchaos.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/systematicchaos.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/systematicchaos.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/systematicchaos.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/systematicchaos.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/systematicchaos.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=systematicchaos.wordpress.com&amp;blog=10681931&amp;post=1&amp;subd=systematicchaos&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://systematicchaos.wordpress.com/2009/11/26/tricky-dice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0ee9c50780ed9f50107c6a8abd4ccdfe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jonsn0w</media:title>
		</media:content>
	</item>
	</channel>
</rss>
