<?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>What can scientific models tell us about the world?</title>
	<atom:link href="http://playingwithmodels.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://playingwithmodels.wordpress.com</link>
	<description>What can mathematical models tell us about the world?</description>
	<lastBuildDate>Thu, 19 Jan 2012 15:33:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='playingwithmodels.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/834cd2f1bc12a5c7a017f446d4b53975?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>What can scientific models tell us about the world?</title>
		<link>http://playingwithmodels.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://playingwithmodels.wordpress.com/osd.xml" title="What can scientific models tell us about the world?" />
	<atom:link rel='hub' href='http://playingwithmodels.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Immunization in the age of intercontinental travel</title>
		<link>http://playingwithmodels.wordpress.com/2011/01/18/immunizations/</link>
		<comments>http://playingwithmodels.wordpress.com/2011/01/18/immunizations/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 02:58:12 +0000</pubDate>
		<dc:creator>Alexander Lobkovsky Meitiv</dc:creator>
				<category><![CDATA[Game theory]]></category>
		<category><![CDATA[Statistics]]></category>
		<category><![CDATA[epidemics]]></category>
		<category><![CDATA[flu]]></category>
		<category><![CDATA[Immunization rate]]></category>
		<category><![CDATA[intercontinental travel]]></category>
		<category><![CDATA[transmission]]></category>

		<guid isPermaLink="false">http://playingwithmodels.wordpress.com/?p=379</guid>
		<description><![CDATA[A pandemic is more likely when the disease is spread large distances aboard airplanes.  A simple model of the spreading epidemic sheds light on the importance a high immunization rate in the age of frequent long distance travel. <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=379&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_389" class="wp-caption alignright" style="width: 441px"><a href="http://playingwithmodels.files.wordpress.com/2010/12/china_flu.jpg"><img src="http://playingwithmodels.files.wordpress.com/2010/12/china_flu.jpg?w=720" alt="People in face masks in China during the flu epidemic" title="People in face masks in China during the flu epidemic"   class="size-full wp-image-389" /></a><p class="wp-caption-text">Face masks curtail the spread of the virus during the flu pandemic.</p></div>If you have kids in school, you are familiar with how fervently the school administrators enforce the 100% immunization policy.  The schools are complying with the local laws which grant exceptions grudgingly.  Childhood immunization is a powerful tool against a variety of crippling viruses some of which are extinct (outside the controlled lab environment) as a result of widespread immunizations.  Controversy over the possibly harmful side effects (mercury, other preservatives) notwithstanding, is the zeal for reaching the 100% immunization rate justified?</p>
<p>The efficacy of a vaccination program is quantified by the fraction of the non-immunized population that gets sick in an epidemic.  This fraction can also be thought as the probability that a particular individual will get sick in an epidemic.</p>
<p>A number of factors determine the probability of infection in an epidemic:</p>
<p>How long is the sick person contagious?  What is the probability of infection given the contact with a sick person?  What is the average rate of inter-personal contacts?  How far does a person travel during the sickness?  The answers to these questions depend on the type of virus, and the properties of the population such as its density and the patterns of movement.</p>
<p>The situation seems too complex for predictive modeling.  Could a simplified model offer meaningful insight?  Yes, if we pick a narrow aspect of the problem to look at.  How about this?  You probably heard the doomsday scenarios of a deadly virus spread around the world aboard airplanes.  Is a this kind of talk just fear-mongering or a realistic prediction?  </p>
<p>Let us construct a model to study whether the doomsday scenario is plausible.  Let&#8217;s start with a 2D square lattice, or a board, whose sites (spaces) can be empty of occupied by &#8220;people&#8221; &#8212; let&#8217;s call them &#8220;entities.&#8221;  The entities could be in three states: <strong>immune</strong>, <strong>vulnerable</strong>, and <strong>sick</strong>.  The sick entities can infect the vulnerable but not the immune ones.   We need to decide what to do with the sick entities.  For example, some fraction of them can &#8220;die&#8221;&#8211;be removed from the board.  The simplest thing is to just let them become immune after the disease has run its course.  This is what is done in our model.</p>
<p>The entities can move around the board.  The movement models the short range everyday movement of the population: commute, shopping, going to and from school, etc.  I will use a turn based (like the Conway&#8217;s game of life) set of movement rules that are often used in simulating fluid-vapor interfaces.  The result is a collection of dense clusters of varying sizes that float in a sparsely inhabited sea.  There is little exchange of entities between the clusters.  Since the infection is acquired on contact, global epidemics are impeded by the limited inter-cluster movement.  One could think of these semi-isolated clusters as communities, cities, or even continents depending on your perspective.</p>
<p>Below is the movie of the model simulation in which the sick entities (red) infect the vulnerable entities (blue) and after a while become immune (green).  A fraction of the population is already immune at the onset of the epidemic.  Observe how the disease propagates quickly across the clusters and makes infrequent jumps between the clusters.  In this particular simulation, 37% of the vulnerable population got sick before the epidemic fizzled out.</p>
<p><object width="720" height="565"><param name="movie" value="http://www.youtube.com/e/HmQuyEx-K8s"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/e/HmQuyEx-K8s" type="application/x-shockwave-flash" width="720" height="565" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>You probably noticed that the immunization rate in the above example is rather low, 30% to be exact.  Since most entities are vulnerable, the epidemic has no trouble spreading.  When the immunization rate is more than doubled to 70%, most epidemics fizzle out early.  As you can see in the PDF (probability density function) plot below of the total epidemic size (defined as the fraction of the vulnerable population that go sick), all epidemics involve fewer than 4% of the populace.  There is simply not enough population movement for the disease to spread.  </p>
<div id="attachment_410" class="wp-caption aligncenter" style="width: 410px"><a href="http://playingwithmodels.files.wordpress.com/2011/01/fizzle.jpg"><img src="http://playingwithmodels.files.wordpress.com/2011/01/fizzle.jpg?w=400&#038;h=367" alt="PDF of the epidemic size in a model without large scale movement" title="PDF of the epidemic size in a model without large scale movement" width="400" height="367" class="size-medium wp-image-410" /></a><p class="wp-caption-text">When the movement is local and the immunization rate is high, most epidemics fizzle out without affecting many people.</p></div>
<p><strong>Time to include airplanes and examine the plausibility of the doomsday scenario!</strong></p>
<p>In addition to the short range movement, let&#8217;s allow at each turn a certain small fraction of the population to move anywhere on the board.  The second graph below is the PDF of the epidemic size for the same parameters as the one above, but with the additional 5% of the population executing large scale movement each turn.  Notice the radical change in the scale of the x axis.  When a small fraction of the population travels long distances each turn, most epidemics grow to encompass the majority of the population.  The bimodal nature of the epidemic size distribution suggests that there is a threshold size.  If the epidemic hits a cluster that happens to be larger than the threshold, the disease can escape and infect almost all other clusters.</p>
<div id="attachment_411" class="wp-caption aligncenter" style="width: 410px"><a href="http://playingwithmodels.files.wordpress.com/2011/01/mixed.jpg"><img src="http://playingwithmodels.files.wordpress.com/2011/01/mixed.jpg?w=400&#038;h=370" alt="PDF of the epidemic size when macerate large scale movement is allowed" title="PDF of the epidemic size when moderate large scale movement is allowed" width="400" height="370" class="size-medium wp-image-411" /></a><p class="wp-caption-text"> When only 5% of the population execute large scale movement every turn, most epidemics grow to affect a significant fraction of the population.</p></div>
<p>Let us now quantitatively examine the effect of the large scale movements on the probability of significant epidemics.  In the graph below I will plot the probability of occurrence of an epidemic that involves &gt; 10% of the vulnerable populace as a function of the immunization rate for two different magnitudes of the large scale movement.  Significant epidemics become rare as the immunization rate increases.  However, perhaps not surprisingly, greater immunization rate is required to avoid epidemics for a larger magnitude of large scale population movement.</p>
<div id="attachment_425" class="wp-caption aligncenter" style="width: 410px"><a href="http://playingwithmodels.files.wordpress.com/2011/01/size_rate3.jpg"><img src="http://playingwithmodels.files.wordpress.com/2011/01/size_rate3.jpg?w=369&#038;h=338" alt="Probability of a significant epidemic as a function of immunization rate" title="Significant epidemic probability" width="369" height="338" class="size-medium wp-image-425" /></a><p class="wp-caption-text">Greater large scale movement requires a higher immunization rate to avoid a significant epidemic</p></div>
<p>Predicting how epidemics spread in the real world is a tricky business. However, the general conclusion of the simple model, I think, will stand.  While 100% immunization rate is not strictly required to stem epidemics, as the extent of long distance travel increases, we will need a higher immunization rate.  It would be unwise to be lax about immunization requirements to discover one day that not enough of the population is immunized.</p>
<p>The real issue, I think, is that the small fraction of people who refuse to be immunized are shielded from infection by those who took the risk of immunization (albeit a small risk).  But that is a can of worms, I don&#8217;t really want to open&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/playingwithmodels.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/playingwithmodels.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/playingwithmodels.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/playingwithmodels.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/playingwithmodels.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/playingwithmodels.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/playingwithmodels.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/playingwithmodels.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/playingwithmodels.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/playingwithmodels.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/playingwithmodels.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/playingwithmodels.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/playingwithmodels.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/playingwithmodels.wordpress.com/379/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=379&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://playingwithmodels.wordpress.com/2011/01/18/immunizations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1e043fc93cb97bf7eab0412349c1d99c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alex M</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/12/china_flu.jpg" medium="image">
			<media:title type="html">People in face masks in China during the flu epidemic</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2011/01/fizzle.jpg?w=400" medium="image">
			<media:title type="html">PDF of the epidemic size in a model without large scale movement</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2011/01/mixed.jpg?w=400" medium="image">
			<media:title type="html">PDF of the epidemic size when moderate large scale movement is allowed</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2011/01/size_rate3.jpg" medium="image">
			<media:title type="html">Significant epidemic probability</media:title>
		</media:content>
	</item>
		<item>
		<title>The waiting game.</title>
		<link>http://playingwithmodels.wordpress.com/2010/12/20/the-waiting-game/</link>
		<comments>http://playingwithmodels.wordpress.com/2010/12/20/the-waiting-game/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 03:35:56 +0000</pubDate>
		<dc:creator>Alexander Lobkovsky Meitiv</dc:creator>
				<category><![CDATA[Game theory]]></category>
		<category><![CDATA[Transportation]]></category>
		<category><![CDATA[Bus waiting times]]></category>
		<category><![CDATA[decisions.]]></category>
		<category><![CDATA[stochastic model]]></category>
		<category><![CDATA[transportation]]></category>

		<guid isPermaLink="false">http://playingwithmodels.wordpress.com/?p=336</guid>
		<description><![CDATA[The Metro has changed the bus schedule this morning with no prior notice whatsoever. The 9 am J1 bus, I usually take, did not come. As I found out later, it was dropped from the schedule altogether. For about 20 minutes I was assuming (with diminishing conviction) that the J1 was merely late. While waiting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=336&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_375" class="wp-caption alignright" style="width: 310px"><a href="http://playingwithmodels.files.wordpress.com/2010/12/metro2.jpg"><img src="http://playingwithmodels.files.wordpress.com/2010/12/metro2.jpg?w=300&#038;h=243" alt="People waiting at a bus stop." title="Bus stop" width="300" height="243" class="size-medium wp-image-375" /></a><p class="wp-caption-text">When two buses can take you where you need to go should you let the slow bus pass and wait for the fast bus?</p></div>The Metro has changed the bus schedule this morning with no prior notice whatsoever.  The 9 am J1 bus, I usually take, did not come.  As I found out later, it was dropped from the schedule altogether.  For about 20 minutes I was assuming (with diminishing conviction) that the J1 was merely late.  While waiting for the J1, I let two J2&#8242;s go by.  The J2&#8242;s take about 15 minutes longer to reach my destination.  While I was waiting, I began to wonder what the best waiting strategy would be if there were two modes of transport with different travel times and different service frequencies.  There is a math problem in there with a clear cut answer.</p>
<p>It is simpler to consider the situation in which buses do not have a fixed schedule but arrive at a fixed rate per unit time <img src="http://latex.codecogs.com/gif.download?\mu">.  Intervals between consecutive buses in this situation obey <a href="http://en.wikipedia.org/wiki/Poisson_process">Poisson statistics,</a> which means that no matter when I arrive at the stop the average waiting time before the bus arrives is <img src="http://latex.codecogs.com/gif.download?1/\mu">.</p>
<p>In what follows I will present a few results without much derivation.  If you are interested in the nitty-gritty, contact me for details.</p>
<p>Suppose there are two buses A and B that arrive at a stop with rates <img src="http://latex.codecogs.com/gif.download?\mu_A"> and <img src="http://latex.codecogs.com/gif.download?\mu_B">.  The probability that A arrives before B is </p>
<p><img src="http://latex.codecogs.com/gif.download?P(A\mathrm{\ before \ } B) = \displaystyle{\frac{\mu_A}{\mu_A + \mu_B}}."></p>
<p>The mean waiting time for bus A provided that A has arrived first is</p>
<p><img src="http://latex.codecogs.com/gif.download?t_A =\displaystyle{\frac{\mu_A}{(\mu_A + \mu_B)^2}}."></p>
<p>Now if the travel times to destination on buses A and B are <img src="http://latex.codecogs.com/gif.download?\tau_A \geq \tau_B,"> we can compute the expected travel time if the traveler boards the first bus that comes to the stop.  We will call it <img src="http://latex.codecogs.com/gif.download?T_0"> because the strategy is to let zero buses pass (even if they take longer).</p>
<p><img src="http://latex.codecogs.com/gif.download?T_0 = \displaystyle{\frac{\mu_A \tau_A}{\mu_A + \mu_B} + \frac{\mu_A}{(\mu_A + \mu_B)^2} + \frac{\mu_B \tau_B}{\mu_A + \mu_B)} + \frac{\mu_B}{(\mu_A + \mu_B)^2} = \frac{1 + \mu_A \tau_A + \mu_B \tau_B}{\mu_A + \mu_B}}."></p>
<p>We can interpret this formula as follows.  The total bus arrival rate is <img src="http://latex.codecogs.com/gif.download?\mu_A + \mu_B"> and therefore the mean waiting time for a bus, any bus is <img src="http://latex.codecogs.com/gif.download?1/(\mu_A + \mu_B).">  Then with probability <img src="http://latex.codecogs.com/gif.download?\mu_A/(\mu_A + \mu_B)"> the A bus has arrived and the travel time is <img src="http://latex.codecogs.com/gif.download?\tau_A.">  Likewise, with probability <img src="http://latex.codecogs.com/gif.download?\mu_B/(\mu_A + \mu_B)"> the B bus arrives so that the travel time is <img src="http://latex.codecogs.com/gif.download?\tau_B."></p>
<p>It is a inly marginally trickier to derive the mean trip duration (will call it <img src="http://latex.codecogs.com/gif.download?T_1">) when we are willing to let one A bus pass by in the hopes that the next bus will be the faster B bus.  The answer is</p>
<p><img src="http://latex.codecogs.com/gif.download?T_1 = \displaystyle{\frac{1}{\mu_A + \mu_B} + \frac{\mu_A T_0}{\mu_A + \mu_B} + \frac{\mu_B \tau_B}{\mu_A + \mu_B}}."></p>
<p>The explanation of the second term in the above formula is that if A arrives first, we let it pass and we are back to the &#8220;let zero buses pass&#8221; strategy.  The rest of the terms in the equation for <img src="http://latex.codecogs.com/gif.download?T_1"> are the same as before.</p>
<p>In general, for any <img src="http://latex.codecogs.com/gif.download?n \geq 1"> we have a recursion relation:</p>
<p><img src="http://latex.codecogs.com/gif.download?T_{n+1} = \displaystyle{\frac{1}{\mu_A + \mu_B} + \frac{\mu_A T_n}{\mu_A + \mu_B} + \frac{\mu_B \tau_B}{\mu_A + \mu_B}}."></p>
<p>We can now start asking questions like: &#8220;Under what conditions does letting the slow bus pass make sense (result in a shorter expected trip)?&#8221;  What about letting <strong>two</strong> buses pass?  When does that strategy pay off?</p>
<p>When does <img src="http://latex.codecogs.com/gif.download?T_1 \leq T_0?"> Comparing the formulas above we arrive at a simple condition on the arrival rate of the fast bus which is independent of the arrival rate of the slow bus</p>
<p><img src="http://latex.codecogs.com/gif.download?\displaystyle{\mu_B \geq \frac{1}{\tau_A - \tau_B}} \quad \mathrm{(1)}."></p>
<p>For example, if the slow bus takes 30 minutes and the fast bus takes 20 minutes to arrive at the destination, it makes sense to let the slow bus pass if the fast bus arrives more frequently than once in 10 minutes.  No big surprise there, anybody with a modicum of common sense could tell you that.</p>
<p>What is surprising is that the condition (1) does not depend on the arrival rate of the slow bus.  Did I make a mistake?  It turns out that when <img src="http://latex.codecogs.com/gif.download?T_1 = T_0,"> the expected travel times for other strategies are exactly the same!  I will leave the proof to my esteemed reader as homework :)</p>
<p>Therefore, since it does not matter how frequently the slow bus comes, if the fast bus comes frequently enough (condition (1) is satisfied), it makes sense to wait for the fast bus no matter how many slow buses pass. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/playingwithmodels.wordpress.com/336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/playingwithmodels.wordpress.com/336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/playingwithmodels.wordpress.com/336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/playingwithmodels.wordpress.com/336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/playingwithmodels.wordpress.com/336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/playingwithmodels.wordpress.com/336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/playingwithmodels.wordpress.com/336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/playingwithmodels.wordpress.com/336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/playingwithmodels.wordpress.com/336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/playingwithmodels.wordpress.com/336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/playingwithmodels.wordpress.com/336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/playingwithmodels.wordpress.com/336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/playingwithmodels.wordpress.com/336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/playingwithmodels.wordpress.com/336/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=336&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://playingwithmodels.wordpress.com/2010/12/20/the-waiting-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1e043fc93cb97bf7eab0412349c1d99c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alex M</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/12/metro2.jpg?w=300" medium="image">
			<media:title type="html">Bus stop</media:title>
		</media:content>

		<media:content url="http://latex.codecogs.com/gif.download?mu" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?1/mu" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?mu_A" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?mu_B" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?P(AmathrmbeforeB)=displaystylefracmu_Amu_A+mu_B." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?t_A=displaystylefracmu_A(mu_A+mu_B)2." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?tau_Ageqtau_B," medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?T_0" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?T_0=displaystylefracmu_Atau_Amu_A+mu_B+fracmu_A(mu_A+mu_B)2+fracmu_Btau_Bmu_A+mu_B)+fracmu_B(mu_A+mu_B)2=frac1+mu_Atau_A+mu_Btau_Bmu_A+mu_B." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?mu_A+mu_B" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?1/(mu_A+mu_B)." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?mu_A/(mu_A+mu_B)" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?tau_A." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?mu_B/(mu_A+mu_B)" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?tau_B." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?T_1" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?T_1=displaystylefrac1mu_A+mu_B+fracmu_AT_0mu_A+mu_B+fracmu_Btau_Bmu_A+mu_B." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?T_1" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?ngeq1" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?T_n+1=displaystylefrac1mu_A+mu_B+fracmu_AT_nmu_A+mu_B+fracmu_Btau_Bmu_A+mu_B." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?T_1leqT_0?" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?displaystylemu_Bgeqfrac1tau_A-tau_Bquadmathrm(1)." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?T_1=T_0," medium="image" />
	</item>
		<item>
		<title>Speed bested by agility</title>
		<link>http://playingwithmodels.wordpress.com/2010/11/14/speed_vs_agility/</link>
		<comments>http://playingwithmodels.wordpress.com/2010/11/14/speed_vs_agility/#comments</comments>
		<pubDate>Sun, 14 Nov 2010 19:47:08 +0000</pubDate>
		<dc:creator>Alexander Lobkovsky Meitiv</dc:creator>
				<category><![CDATA[Dynamics]]></category>
		<category><![CDATA[Game theory]]></category>
		<category><![CDATA[escape trajectory]]></category>
		<category><![CDATA[maneuverability vs speed]]></category>
		<category><![CDATA[predator]]></category>
		<category><![CDATA[prey]]></category>
		<category><![CDATA[prey escape strategy]]></category>
		<category><![CDATA[pursuit]]></category>

		<guid isPermaLink="false">http://playingwithmodels.wordpress.com/?p=292</guid>
		<description><![CDATA[When a speedy predator pursues a less nimble prey, all is not hopeless for the prey if it can accelerate more rapidly.  The ability to accelerate rapidly makes the prey more maneuverable or agile than the predator and allows it to escape as long as the disparity in speed is not too great.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=292&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_297" class="wp-caption alignright" style="width: 460px"><a href="http://playingwithmodels.files.wordpress.com/2010/11/funny-animal-pics-cat-chasing-rabbit.jpg"><img src="http://playingwithmodels.files.wordpress.com/2010/11/funny-animal-pics-cat-chasing-rabbit.jpg?w=720" alt="" title="Cat chasing rabbit"   class="size-full wp-image-297" /></a><p class="wp-caption-text">The rabbit relies on superior maneuverability to escape predators.</p></div> Next time you see a squirrel fleeing from a cat, notice it&#8217;s escape strategy.  Instead of bolting straight for the safety of a tree, the squirrel follows a zig-zag trajectory with sharp, frequent turns punctuated by its thrashing tail.  The pursuing cat, unable to execute the sharp turns, overshoots and looses ground as it adjusts its trajectory.</p>
<p>The flight behavior of a prey is instinctual and highly sophisticated&#8211;after all, predation is a major selective pressure in a Darwinian universe.  The variation of escape strategies reflects the intrinsic abilities of the prey.  Some prey, like the antelope, rely on superior speed and safety in numbers.  Others, like the rabbit, or the squirrel, rely on superior maneuverability.  In this post I will illustrate how superior maneuverability can be used to escape from a faster predator.</p>
<p>What is maneuverability?  We will define it in a narrow sense as the ability to quickly change the course or direction of motion.  The rate of change of the direction of motion is also known as acceleration.  The word acceleration is used colloquially when the rate of change of velocity is in the same direction as velocity.  More generally, the vector of acceleration could point in any direction.  If the acceleration vector points in the direction opposite to velocity, we would say that the moving object decelerates.  Circular motion is sustained by a centripetal acceleration which points toward the center of the circle, perpendicular to the velocity vector.</p>
<p>To illustrate how a slower animal can successfully evade a faster one let us consider a simple model of the predator-prey pursuit.  Suppose, the only constraint on the motion is the velocity and acceleration caps.  The predator&#8217;s maximum velocity is greater than that of the prey.  Vice versa, the prey can accelerate faster (in any direction) which means, among other things, that it can make sharper turns.</p>
<p>Here are the model pursuit strategies:</p>
<p>Predator:</p>
<ul>
<li>If traveling slower than the maximum speed, accelerate in the instantaneous direction of the prey at maximum acceleration.
<li>When traveling at maximum velocity, project the acceleration vector on the direction perpendicular to the instantaneous velocity.  This will insure that speed does not exceed the maximum.
</ul>
<p>Prey:</p>
<ul>
<li>If traveling slower than the maximum speed, accelerate away from the predator at maximum acceleration.
<li>If traveling at maximum velocity and the predator is a certain distance <em>D</em> away, stay the course.
<li>If traveling at maximum speed and the predator is within striking distance, execute a turn away from the predator at the tightest turning radius possible.
</ul>
<p>Even without doing the simulations of this model we can foresee the qualitative features of the trajectories it yields.  When the prey is further than <em>D</em> away from the predator, it will run along a straight trajectory which means that the speedier predator will eventually catch up with it and draw within the distance of caution <em>D</em>.  At that point the prey will commence a sharp turn away from the predator.  The predator, being less agile, will not be able to turn as sharply and will overshoot the prey and the distance between them will grow and might exceed <em>D</em>.  When that happens, the prey will stop turning and run along a straight line again.  The cycle will repeat ad infinitum the predator not being able to get closer to the prey than some finite fraction of <em>D</em>.</p>
<p>The movie below shows the trajectories of the prey (green) and predator (red) produced by the simple model when the predator is 50% faster, but the prey is able to achieve twice the acceleration.</p>
<span style="text-align:center; display: block;"><a href="http://playingwithmodels.wordpress.com/2010/11/14/speed_vs_agility/"><img src="http://img.youtube.com/vi/gNiQFh_0gIU/2.jpg" alt="" /></a></span>
<p>Finally, let me point out that the strategies in the simple model are far from optimal.  For example, one can imagine that if the predator could anticipate the direction of the prey&#8217;s turn (which is possible in the above scenario in which the prey always turns away from the predator), it could potentially intercept the prey.  The optimality of a particular escape &#8212; pursuit strategies is usually hard to prove and the methods of such proofs are still subject of current research.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/playingwithmodels.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/playingwithmodels.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/playingwithmodels.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/playingwithmodels.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/playingwithmodels.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/playingwithmodels.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/playingwithmodels.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/playingwithmodels.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/playingwithmodels.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/playingwithmodels.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/playingwithmodels.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/playingwithmodels.wordpress.com/292/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/playingwithmodels.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/playingwithmodels.wordpress.com/292/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=292&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://playingwithmodels.wordpress.com/2010/11/14/speed_vs_agility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1e043fc93cb97bf7eab0412349c1d99c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alex M</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/11/funny-animal-pics-cat-chasing-rabbit.jpg" medium="image">
			<media:title type="html">Cat chasing rabbit</media:title>
		</media:content>
	</item>
		<item>
		<title>What is the mpg of a bicycle?</title>
		<link>http://playingwithmodels.wordpress.com/2010/11/10/what-is-the-mpg-of-a-bicycle/</link>
		<comments>http://playingwithmodels.wordpress.com/2010/11/10/what-is-the-mpg-of-a-bicycle/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 20:16:42 +0000</pubDate>
		<dc:creator>Alexander Lobkovsky Meitiv</dc:creator>
				<category><![CDATA[Transportation]]></category>
		<category><![CDATA[Bicycle]]></category>
		<category><![CDATA[ethanol]]></category>
		<category><![CDATA[green transportation]]></category>
		<category><![CDATA[mpg]]></category>
		<category><![CDATA[transport]]></category>

		<guid isPermaLink="false">http://playingwithmodels.wordpress.com/?p=310</guid>
		<description><![CDATA[It seems a silly question at first. Digging a little deeper, it is easy to convince yourself that when you travel somewhere by bike, your body burns more calories than if you sat in your office chair. The extra calories came from the extra food you had to eat. The land that was used to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=310&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_312" class="wp-caption alignright" style="width: 328px"><a href="http://playingwithmodels.files.wordpress.com/2010/11/5447_largearticlephoto.jpg"><img src="http://playingwithmodels.files.wordpress.com/2010/11/5447_largearticlephoto.jpg?w=720" alt="" title="Bicycle commuter"   class="size-full wp-image-312" /></a><p class="wp-caption-text">The next green thing?</p></div>It seems a silly question at first.  Digging a little deeper, it is easy to convince yourself that when you travel somewhere by bike, your body burns more calories than if you sat in your office chair.  The extra calories came from the extra food you had to eat.  The land that was used to produce the food you had to eat could have been used to grow corn and make ethanol.  The amount of ethanol produced from the corn required to travel a mile by bike is undoubtedly small, but how small?</p>
<p>To compute my bike mpg we will need three numbers:</p>
<ol>
<li>Extra calories burned per mile of bike travel at roughly 13 miles per hour (my average commuting speed).  For relatively flat terrain and my weight this number is roughly 42 food calories per mile (obtained from <a target="_blank" href="http://caloriecount.about.com/activities-bicycling-ac1">about.com</a>).
<li>We need a food equivalent for the ethanol production.  Let&#8217;s say I go my extra calories from eating sweet corn.  According to the same source, sweet corn has 857 food calories per kilogram.  So I will need to eat 49 grams of sweet corn per mile traveled at 13 miles per hour on my bike.
<li>Now we need to know how much ethanol can be made from 49 grams of sweet corn.  The Department of Energy&#8217;s <a target="_blank" href="http://www1.eere.energy.gov/biomass/ethanol_yield_calculator.html">Biomass Program</a> to the rescue.  According to their website, a metric ton of dry</strong> corn can <strong>theoretically</strong> yield 124.4 gallons of ethanol.  Since sweet corn is 77% water, this means that up to 0.0014 gallons of ethanol can be made from 49 grams of sweet corn.
</ol>
<p>Putting these numbers together we arrive at 0.0014 gallons of ethanol per mile or&#8230;drumbeat please:</p>
<h2>701 mpg</h2>
<p>This number is not small, but neither is it very large!  There exist <a target="_blank" href="http://www.edison2.com/">experimental vehicles</a> that seat four and achieve over 100 mpg.  When fully loaded, the effective, per passenger mpg is 400.  If my calculations are correct, Technology is about to bring motorized transport close to the efficiency of a person on a bike! </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/playingwithmodels.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/playingwithmodels.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/playingwithmodels.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/playingwithmodels.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/playingwithmodels.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/playingwithmodels.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/playingwithmodels.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/playingwithmodels.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/playingwithmodels.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/playingwithmodels.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/playingwithmodels.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/playingwithmodels.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/playingwithmodels.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/playingwithmodels.wordpress.com/310/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=310&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://playingwithmodels.wordpress.com/2010/11/10/what-is-the-mpg-of-a-bicycle/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1e043fc93cb97bf7eab0412349c1d99c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alex M</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/11/5447_largearticlephoto.jpg" medium="image">
			<media:title type="html">Bicycle commuter</media:title>
		</media:content>
	</item>
		<item>
		<title>Should you switch lanes in traffic?</title>
		<link>http://playingwithmodels.wordpress.com/2010/06/24/should-you-switch-lanes-in-traffic/</link>
		<comments>http://playingwithmodels.wordpress.com/2010/06/24/should-you-switch-lanes-in-traffic/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 14:19:23 +0000</pubDate>
		<dc:creator>Alexander Lobkovsky Meitiv</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Transportation]]></category>
		<category><![CDATA[Beat the traffic]]></category>
		<category><![CDATA[Lane switching strategy]]></category>
		<category><![CDATA[Traffic flow model]]></category>

		<guid isPermaLink="false">http://playingwithmodels.wordpress.com/?p=275</guid>
		<description><![CDATA[With the right lane switching strategy, a single car can beat the rest of traffic in a jam.  However, if everyone switches lanes, everyone loses!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=275&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_276" class="wp-caption alignright" style="width: 310px"><a href="http://playingwithmodels.files.wordpress.com/2010/05/3625633864_d3dbd1c93a_o.jpg"><img src="http://playingwithmodels.files.wordpress.com/2010/05/3625633864_d3dbd1c93a_o.jpg?w=300&#038;h=271" alt="Car switching lanes in traffic" title="Lane change in heavy traffic" width="300" height="271" class="size-medium wp-image-276" /></a><p class="wp-caption-text">Switching lanes in heavy traffic can indeed increase your average speed if done right.</p></div><br />
If you drive like me, you have no patience for bumper to bumper traffic.  There is gotta be a way to beat it somehow, right?  Do you sneak into an opening in a neighboring lane if it is moving faster?  Do you set goals like: &#8220;when I get in front of that van, I&#8217;ll switch back?&#8221;  It doesn&#8217;t always seem to work.  A lane that was zooming by you comes to a dead stop when you switch into it.   If the motion of each lane is random, is there a way to switch lanes and move faster than a car that stays in lane? </p>
<p>It turns out there is a way to beat the traffic.  To show this we will use a simple model of traffic flow introduced by Nagel and Schrekenberg (see the previous post).  The model consists of a circular track with consecutive slots which can be empty of occupied by cars.  Cars have an integer velocity between 0 and vmax.  As we saw in the previous post, simple rules for updating the positions and velocities of the cars can reproduce the traffic jam phenomenon thereby a dense region forms in which the cars are at a standstill for a few turns and then, as the jam clears in front of them, the cars accelerate and zoom around the track only to be stuck in the jam again.  The jam itself moves in the direction opposite to that of the cars.</p>
<p>Now imagine that we put two of the circular tracks (or lanes) side by side.  For starters, let&#8217;s require all cars except one to stay in their respective lanes.  One rogue car can switch lanes.  Can the rogue with the right lane switching strategy move faster than the rest of the cars on average?  The answer is most certainly yes although finding <strong>the best</strong> lane switching strategy is a difficult computational problem.  What we are going to do here is compare two lane switching strategies that at first sight seem equally good.  What we will discover is that it the lane changing strategy matters.  As you might have suspected, if you don&#8217;t do it right, you might actually move slower than the rest of the traffic!</p>
<p>Here are the two simple strategies we will compare (I suggest you read the previous post for the description of the model):</p>
<p>1) &#8220;Stop-switch:&#8221;  if the slot directly ahead is occupied, switch if the space in the other lane directly across is not occupied.<br />
2) &#8220;Faster-switch:&#8221; if the car directly ahead in the neighboring lane is moving faster, switch if there is space available.</p>
<a href="http://playingwithmodels.files.wordpress.com/2010/06/switch_improvement.jpg"><img src="http://playingwithmodels.files.wordpress.com/2010/06/switch_improvement.jpg?w=720" alt="Graph of the percent improvemnt of the average speed of the lane changing car as a function of the car density" title="Improvement in the speed of the rogue car compared to the rest of the traffic"   class="size-full wp-image-284" /></a>
<p>The graph above compares the two strategies.  It shows the percent improvement of the rogue&#8217;s average speed compared to the average speed of the rest of the cars as a function of the car density.  When density is low and traffic jams are rare, switching lanes has almost no effect on your average speed for both strategies.  When the density is high and traffic jams are abound, switching can make you go slower than the rest of the traffic.  The reason is that when a space in the neighboring lane opens up, it is likely to be at the tail end of a jam whereas the jam in the lane you just switched out of might be already partially cleared.  The final remark is that the &#8220;Stop-switch&#8221; strategy is significantly better improving the speed by as much as 35% whereas the best &#8220;Faster-switch&#8221; can do is a 15% improvement.</p>
<p>Finally let me mention that if all cars switch lanes and use the same strategy, nobody wins.  All cars move with the same speed on average.  That average speed could be smaller or larger (depending on the car density and the switching strategy) than in the case when everybody says in lane.  The graph below explains why everyone is so keen on the advice &#8220;Stay in lane!&#8221;  It turns out that if everyone uses the &#8220;Faster-switch&#8221; strategy, the average speed is drastically lower for everyone than if everyone stays in lane!  The reason for this dramatic result is that when you change lanes, the car behind is likely to slam on the brakes which slows everyone down.</p>
<a href="http://playingwithmodels.files.wordpress.com/2010/06/everyone_compare.jpg"><img src="http://playingwithmodels.files.wordpress.com/2010/06/everyone_compare.jpg?w=720" alt="Graphs of the average speed vs car density for two cases: everyone switches lanes using the &quot;Faster-switch&quot; strategy and everyone stays in lane." title="Average speed comparison."   class="size-full wp-image-287" /></a>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/playingwithmodels.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/playingwithmodels.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/playingwithmodels.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/playingwithmodels.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/playingwithmodels.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/playingwithmodels.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/playingwithmodels.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/playingwithmodels.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/playingwithmodels.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/playingwithmodels.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/playingwithmodels.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/playingwithmodels.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/playingwithmodels.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/playingwithmodels.wordpress.com/275/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=275&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://playingwithmodels.wordpress.com/2010/06/24/should-you-switch-lanes-in-traffic/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1e043fc93cb97bf7eab0412349c1d99c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alex M</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/05/3625633864_d3dbd1c93a_o.jpg?w=300" medium="image">
			<media:title type="html">Lane change in heavy traffic</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/06/switch_improvement.jpg" medium="image">
			<media:title type="html">Improvement in the speed of the rogue car compared to the rest of the traffic</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/06/everyone_compare.jpg" medium="image">
			<media:title type="html">Average speed comparison.</media:title>
		</media:content>
	</item>
		<item>
		<title>People are the real cause of the traffic jam</title>
		<link>http://playingwithmodels.wordpress.com/2010/05/12/traffic-jam/</link>
		<comments>http://playingwithmodels.wordpress.com/2010/05/12/traffic-jam/#comments</comments>
		<pubDate>Thu, 13 May 2010 01:55:01 +0000</pubDate>
		<dc:creator>Alexander Lobkovsky Meitiv</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Transportation]]></category>
		<category><![CDATA[cellular automata]]></category>
		<category><![CDATA[discrete traffic model]]></category>
		<category><![CDATA[fluctuations]]></category>
		<category><![CDATA[Traffic flow model]]></category>
		<category><![CDATA[traffic jam]]></category>

		<guid isPermaLink="false">http://playingwithmodels.wordpress.com/?p=181</guid>
		<description><![CDATA[Random slowing down on the highway can cause traffic jams.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=181&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_262" class="wp-caption alignright" style="width: 410px"><a href="http://playingwithmodels.files.wordpress.com/2010/05/congestion.jpg"><img src="http://playingwithmodels.files.wordpress.com/2010/05/congestion.jpg?w=720" alt="5 lanes of highway bumper to bumper" title="Traffic jam"   class="size-full wp-image-262" /></a><p class="wp-caption-text">Sometimes traffic slows to a crawl for no apparent reason</p></div>When the traffic on the beltway is moving at a snail&#8217;s pace without an obvious reason (like construction or accident), I frequently wonder: &#8220;why can&#8217;t everyone just go faster?&#8221;  If all car&#8217;s were driven by computers that could talk to each other, a clever synchronization algorithm, could allow all cars travel in unison and thus prevent congestion that is not a result of lane closure.  Alas, this technotopia is still decades away and cars will be driven by humans for the foreseeable future.  In the meantime we can but wonder: &#8220;<strong>what is it about the way people drive that causes the traffic to jam when the density of cars becomes too great?</strong>&#8220;</p>
<p>Traffic flow is frequently studied because it is an example of a system far from equilibrium.  The practical applications are important as well.  Many models from crude to sophisticated have been advanced.  Massive amounts of data exist and are frequently used to estimate model parameters and make predictions.  I am not going to attempt to review the vast field here.  My goal is simply to elucidate the physiological limitation of the human mind that causes the driving patters leading to congestion.</p>
<p>Although great progress has been made in modeling traffic as a compressible fluid, a class of models that fall into the category of Cellular Automata are more intuitive and instructive.</p>
<p>Cellular Automata, promoted by Stephen Wolfram of Mathematica fame as the solution to all problems, are indeed quite nifty.  It turns out that autonomous agents, walking on a lattice and interacting according a simple set of rules can reproduce a surprising variety of observed macroscopic phenomena.  If you want to learn more the <a href="http://en.wikipedia.org/wiki/Cellular_automata">Wikipedia</a> article is a good start.</p>
<p>A pioneering work of Nagel and Schreckenberg published in <a href="http://dx.doi.org/10.1051/jp1:1992277"> Journal de Physique in 1992</a> introduced a simple lattice model of traffic which reproduced the traffic jam phenomenon and came to a surprising conclusion that the essential ingredient was infrequent random slowdowns.</p>
<p>You have probably done so yourself, you change the radio station or adjust the rear view mirror, or speak the child in the seat behind you.  As you do so, your foot eases off the accelerator ever so slightly irritating the person behind you who has to disengage the cruise control.  You and people like you are responsible for the traffic jams when the volume is heavy but there are no obvious obstructions to traffic.</p>
<p>Allow me to reproduce the authors&#8217; description of the model since it is concise and elegant:</p>
<p>&#8220;Our computational model is defined on a one-dimensional array of L sites and with open or periodic boundary conditions. Each site may either be occupied by one vehicle, or it may be empty. Each vehicle has an integer velocity with values between zero and vmax. For an arbitrary configuration, one update of the system consists of the following four consecutive steps, which are performed in parallel for all vehicles:</p>
<ol>
<li>Acceleration: if the velocity v of a vehicle is lower than vmax and if the distance to the next car ahead is larger than v + 1, the speed is increased by one.
<li>Slowing down (due to other cars): if a vehicle at site i sees the next vehicle at site i + j (with j &lt; v), it reduces its speed to j.
<li>Randomization: with probability p, the velocity of each vehicle (if greater than zero) is decreased by one.
<li>Car motion: each vehicle is advanced v sites.&#8221;
</ol>
<p>Without the randomizing step 3) the motion is deterministic: &#8220;every initial configuration of vehicles and corresponding velocities reaches very quickly a stationary pattern which is shifted backwards (i.e. opposite the vehicle motion) one site per time step.&#8221;</p>
<p>The model exhibits the congestion phenomenon when the mean spacing between the cars is smaller then vmax.</p>
<p>Below are the links to the simulations of the model for a circular track with 100 lattice sites, the cars are colored circles which move along the track.  It helps to follow a particular color car with your eyes to see what&#8217;s happening.<br />
The two simulations are done with 15 cars (density lower than critical) and with 23 cars (above the critical density&#8211;exhibits congestion).  As you probably guessed vmax=5 in these simulation hence 20 cars correspond to the critical density.  The probability of random slowing down is 10% per turn.</p>
<p><a href="http://vimeo.com/16858638">Free flowing traffic in a simulation of the Nagel-Schreckenberg model below the critical density threshold.</a></p>
<p>The second simulation (above the critical density)  shows the development of a jam of 5 cars.  Cars zoom around the track and then spend 5 turns not moving at all, before the traffic clears ahead of them and they can accelerate to full velocity again.</p>
<span style="text-align:center; display: block;"><a href="http://playingwithmodels.wordpress.com/2010/05/12/traffic-jam/"><img src="http://img.youtube.com/vi/UF9Uh64CXRc/2.jpg" alt="" /></a></span>
<p>The moral of the story?  People like you and me can be the cause of traffic congestion!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/playingwithmodels.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/playingwithmodels.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/playingwithmodels.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/playingwithmodels.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/playingwithmodels.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/playingwithmodels.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/playingwithmodels.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/playingwithmodels.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/playingwithmodels.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/playingwithmodels.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/playingwithmodels.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/playingwithmodels.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/playingwithmodels.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/playingwithmodels.wordpress.com/181/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=181&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://playingwithmodels.wordpress.com/2010/05/12/traffic-jam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1e043fc93cb97bf7eab0412349c1d99c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alex M</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/05/congestion.jpg" medium="image">
			<media:title type="html">Traffic jam</media:title>
		</media:content>
	</item>
		<item>
		<title>Are Android unlock patterns as secure as numeric PINs?</title>
		<link>http://playingwithmodels.wordpress.com/2010/04/14/andorid_unlock_patterns/</link>
		<comments>http://playingwithmodels.wordpress.com/2010/04/14/andorid_unlock_patterns/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 14:30:53 +0000</pubDate>
		<dc:creator>Alexander Lobkovsky Meitiv</dc:creator>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[number of patterns]]></category>
		<category><![CDATA[unlock pattern]]></category>

		<guid isPermaLink="false">http://playingwithmodels.wordpress.com/?p=189</guid>
		<description><![CDATA[What to know how many Android unlock patterns there are?  Read on!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=189&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_395" class="wp-caption alignright" style="width: 190px"><a href="http://playingwithmodels.files.wordpress.com/2010/04/unlock_pattern.png"><img src="http://playingwithmodels.files.wordpress.com/2010/04/unlock_pattern.png?w=180&#038;h=300" alt="An example of the Android unlock pattern " title="An example of the Android unlock pattern " width="180" height="300" class="size-medium wp-image-395" /></a><p class="wp-caption-text">Unlock pattern may be easier to remember than a string of numbers.</p></div><br />
This post is a digression.  It&#8217;s not about constructing mathematical models of real world phenomena.  It&#8217;s about sequences of numbers like the famous Fibonacci sequence and the Android pattern unlock screen shown here.</p>
<p>The rationale for a graphical pattern instead of a numeric PIN is clear.  Humans are much better at remembering patterns than strings of digits.  But is the pattern as secure?  Other issues aside, such as traceability of fingerprint smudges that allows an attacker to recover the pattern, are there as many patterns as there are numeric PINs of the same length?</p>
<p>Well that&#8217;s where understanding recursion relations is useful.  A recursion relation defines a sequence of numbers <img src="http://latex.codecogs.com/gif.download?a_n" /> by a relationship between <img src="http://latex.codecogs.com/gif.download?a_n" /> and all preceding sequence members.  For example the Fibonacci sequence is defined via</p>
<p><img src="http://latex.codecogs.com/gif.download?a_n=a_{n-1}+a_{n-2}," /> <img src="http://latex.codecogs.com/gif.download?a_1=1," /> <img src="http://latex.codecogs.com/gif.download?a_2=1." /></p>
<p>Depending on the type of recursion relation (whether it is linear, for example), there are a variety of methods for solving them.  Let&#8217;s use the power of recursion to find the number of possible Android unlock patterns that connect <img src="http://latex.codecogs.com/gif.download?N" /> dots.</p>
<p>To make the problem seemingly more complicated (but really simpler) let&#8217;s separately compute the number of patterns that start at the center, side and corner of the 3&#215;3 grid of dots.  Let&#8217;s call those numbers <img src="http://latex.codecogs.com/gif.download?O_N," /> <img src="http://latex.codecogs.com/gif.download?S_N," /> and <img src="http://latex.codecogs.com/gif.download?C_N.">  The total number of unlock patterns is</p>
<p><img src="http://latex.codecogs.com/gif.download?T_N=O_N+4S_N+4C_N." /></p>
<p>Because there are 4 corner and 4 side dots in the 3&#215;3 grid.</p>
<p>Let&#8217;s now derive a recursion relation for <img src="http://latex.codecogs.com/gif.download?O_N," /> <img src="http://latex.codecogs.com/gif.download?S_N," /> and <img src="http://latex.codecogs.com/gif.download?C_N.">  The first step in the program is to note that when the pattern consists of only one dot (that would not be a very secure pattern) we trivially get <img src="http://latex.codecogs.com/gif.download?O_1=1," /> <img src="http://latex.codecogs.com/gif.download?S_1=1," /> and <img src="http://latex.codecogs.com/gif.download?C_1=1.">  </p>
<p>Now let&#8217;s imagine that we managed to compute <img src="http://latex.codecogs.com/gif.download?O_{N-1}," /> <img src="http://latex.codecogs.com/gif.download?S_{N-1}," /> and <img src="http://latex.codecogs.com/gif.download?C_{N-1}"> for some <img src="http://latex.codecogs.com/gif.download?N.">  We can then quickly compute <img src="http://latex.codecogs.com/gif.download?C_N"> noticing that the very first link that is made from the center dot can only go to a side dot (4 possible ways) or to a corner dot (also in 4 possible directions).  Therefore</p>
<p><img src="http://latex.codecogs.com/gif.download?O_N=4S_{N-1}+4C_{N-1}." /></p>
<p>When starting from the side dot, there are 4 ways to get to a corner dot, one way to get to the center dot and 2 ways to get to other side dots, therefore </p>
<p><img src="http://latex.codecogs.com/gif.download?S_N=4C_{N-1}+O_{N-1}+2S_{N-1}." /></p>
<p>And finally when starting from a corner dot, there are 4 ways to get to a side dot and one way to get to the center dot, thus</p>
<p><img src="http://latex.codecogs.com/gif.download?C_N=4S_{N-1}+O_{N-1}." /></p>
<p>The above three relationships can be summarized as</p>
<p><img src="http://latex.codecogs.com/gif.download?V_N=A\,V_{N-1}\quad\quad(1)" /></p>
<p>using matrix notation by defining a vector <img src="http://latex.codecogs.com/gif.download?V_N=(O_N,S_N,C_N)^{T}," /> and a matrix</p>
<p><img src="http://latex.codecogs.com/gif.download?A=\left(\begin{array}{ccc}0&amp;4&amp;4\\1&amp;2&amp;4\\1&amp;4&amp;0\end{array}\right)." /></p>
<p>Hang on tight, we are almost there.  The simple recursion relation (1) means that we can obtain the numbers of patterns connecting <em>N</em> dots from those for <em>N-1</em> dots by just applying the matrix <em>A.</em>  Applying this reasoning recursively we arrive at</p>
<p><img src="http://latex.codecogs.com/gif.download?V_N=A^{N-1}\,V_1." /></p>
<p>I won&#8217;t bore you with the rest of the calculation which is quite routine.  As my eccentric math tutor used to say: &#8220;After this point it&#8217;s just algebra!&#8221;</p>
<p>Here is the result of the calculation:</p>
<div align="center">
<table border="1" cellspacing="4" cellpadding="4">
<tr align="center">
<td><strong><em>N</em></strong></td>
<td><strong>Number of patterns connecting <em>N</em> dots</strong></td>
<td><strong>Number of numeric PINs of <em>N</em> digits</strong></td>
</tr>
<tr align="center">
<td>2</td>
<td>56</td>
<td>100</td>
</tr>
<tr align="center">
<td>3</td>
<td>360</td>
<td>1,000</td>
</tr>
<tr align="center">
<td>4</td>
<td>2,280</td>
<td>10,000</td>
</tr>
<tr align="center">
<td>5</td>
<td>14,544</td>
<td>100,000</td>
</tr>
<tr align="center">
<td>6</td>
<td>92,448</td>
<td>1,000,000</td>
</tr>
<tr align="center">
<td>7</td>
<td>588,672</td>
<td>10,000,000</td>
</tr>
<tr align="center">
<td>8</td>
<td>3,745,152</td>
<td>100,000,000</td>
</tr>
</table>
</div>
<p>Clearly, the number of patterns grows slower than the number of numeric PINs.  This may not matter, however, if patterns are easier to remember and therefore one can comfortably have a longer pattern.</p>
<p>The only sure way to determine whether it is indeed easier to remember patterns, is through careful experiments with human subjects.  Until such data are available, all statements memorability and security of patterns vs PIN&#8217;s are pure speculation&#8230;</p>
<p><strong>PS:<br />
The restriction that a dot cannot be used more than once in a pattern *dramatically* reduces the number of allowed patterns.  Please see comments for the true number of unlock patterns.</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/playingwithmodels.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/playingwithmodels.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/playingwithmodels.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/playingwithmodels.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/playingwithmodels.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/playingwithmodels.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/playingwithmodels.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/playingwithmodels.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/playingwithmodels.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/playingwithmodels.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/playingwithmodels.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/playingwithmodels.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/playingwithmodels.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/playingwithmodels.wordpress.com/189/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=189&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://playingwithmodels.wordpress.com/2010/04/14/andorid_unlock_patterns/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1e043fc93cb97bf7eab0412349c1d99c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alex M</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/04/unlock_pattern.png?w=180" medium="image">
			<media:title type="html">An example of the Android unlock pattern </media:title>
		</media:content>

		<media:content url="http://latex.codecogs.com/gif.download?a_n" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?a_n" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?a_n=a_n-1+a_n-2," medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?a_1=1," medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?a_2=1." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?N" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?O_N," medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?S_N," medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?C_N." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?T_N=O_N+4S_N+4C_N." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?O_N," medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?S_N," medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?C_N." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?O_1=1," medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?S_1=1," medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?C_1=1." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?O_N-1," medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?S_N-1," medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?C_N-1" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?N." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?C_N" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?O_N=4S_N-1+4C_N-1." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?S_N=4C_N-1+O_N-1+2S_N-1." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?C_N=4S_N-1+O_N-1." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?V_N=A,V_N-1quadquad(1)" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?V_N=(O_N,S_N,C_N)T," medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?A=left(beginarrayccc0&#38;4&#38;41&#38;2&#38;41&#38;4&#38;0endarrayright)." medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?V_N=AN-1,V_1." medium="image" />
	</item>
		<item>
		<title>It&#8217;s true: Cubs choke while Yankees surge.</title>
		<link>http://playingwithmodels.wordpress.com/2010/03/24/its-tree-cubs-choke-while-yankees-surge/</link>
		<comments>http://playingwithmodels.wordpress.com/2010/03/24/its-tree-cubs-choke-while-yankees-surge/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 18:05:45 +0000</pubDate>
		<dc:creator>Alexander Lobkovsky Meitiv</dc:creator>
				<category><![CDATA[Sports]]></category>
		<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Baseball]]></category>
		<category><![CDATA[Cubs]]></category>
		<category><![CDATA[Cubs choke]]></category>
		<category><![CDATA[ELO Ratings]]></category>
		<category><![CDATA[The boys of autumn]]></category>
		<category><![CDATA[Yankees]]></category>
		<category><![CDATA[Yankees surge]]></category>

		<guid isPermaLink="false">http://playingwithmodels.wordpress.com/?p=166</guid>
		<description><![CDATA[Rigorous statistical test of the ELO rating of baseball teams supports the claim:
"Cubs choke, Yankees surge"<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=166&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_176" class="wp-caption alignleft" style="width: 510px"><a href="http://playingwithmodels.files.wordpress.com/2010/03/1969cubs.jpg"><img src="http://playingwithmodels.files.wordpress.com/2010/03/1969cubs.jpg?w=720" alt="1969 Chicago Cubs Photo with autographs" title="1969 Chicago Cubs"   class="size-full wp-image-176" /></a><p class="wp-caption-text">The infamous chokers: 1969 Chicago Cubs</p></div>The fans of Chicago Cubs know this scenario all too well.  The Cubs, a great team, have a decent season only to slump and choke at the end.  You only have to google the words &#8220;Cubs choke&#8221; to come up with dozens of websites lamenting the numerous heartbreaks.  Cubs fans have developed a kind of fatalistic gloom as a coping strategy.</p>
<p>Then there are the Yankees everyone loves to hate.  They seem to elevate their game at the end of the season and transform from a good team to hall of fame greatness.  It&#8217;s as if all season long they weren&#8217;t giving it all they got during the regular season.  It seems that they play <em>just</em> well enough to get into the postseason only to turn on the afterburners and blow everyone away.</p>
<h3>Are these notions fiction perpetrated by fans or fact based on evidence?</h3>
<p>We are in a position to test these hypothesis using a scientifically sound <a href="http://en.wikipedia.org/wiki/Elo_rating_system">ELO ranking system.</a>  Using publicly available match data I compiled ELO ratings for all baseball teams going back to 1874.  To refresh your memory, an ELO rating is a number which measures the true strength of a team based on all previous games.  It is supposed to track the current strength accurately and in an unbiased manner.</p>
<p><div id="attachment_169" class="wp-caption aligncenter" style="width: 730px"><a href="http://playingwithmodels.files.wordpress.com/2010/03/cubs_yankees.png"><img src="http://playingwithmodels.files.wordpress.com/2010/03/cubs_yankees.png?w=720&#038;h=504" alt="The ratings of the 1977 Yankees and the 1969 Cubs" title="1977 Yankees vs 1969 Cubs" width="720" height="504" class="size-full wp-image-169" /></a><p class="wp-caption-text">Variation of the ELO rating of the Cubs and Yankees during the 1969 and 1977 seasons.</p></div><br />
The graph of the infamous 1969 Cubs choke and the Yankees 1977 season in which they won the World Series after being 51-44 in July and ranked #3 seems to support the &#8220;Cubs choke Yankees surge&#8221; hypothesis.</p>
<h2>Is this true in general or is it just a lucky or unlucky break?</h2>
<p>Well, here is where the data analysis can fully demonstrate its magic.  The numbers don&#8217;t lie.  If whoever does the numbers doesn&#8217;t that is.</p>
<p>What I did is to compute the difference between the rating of each team at the end of the season and its rating on September 1st of the same season.  I then averaged this late season rating change over the last 47 years (since the 1961 expansion of the leagues from 16 to 20 teams).  I then tested the result against the hypothesis that the rating change is purely random.  This test weeded out the teams whose late season rating change could have resulted from purely random rating fluctuations.  The remaining teams&#8217; late season change is statistically significant and therefore not a fluke.</p>
<p><strong>The result clearly supports the &#8220;Cubs choke, Yankees surge hypothesis.&#8221;</strong></p>
<div id="attachment_170" class="wp-caption aligncenter" style="width: 730px"><a href="http://playingwithmodels.files.wordpress.com/2010/03/delta_elo.png"><img src="http://playingwithmodels.files.wordpress.com/2010/03/delta_elo.png?w=720&#038;h=510" alt="Bargraph of the average late season rating change." title="Late season change in the rating since 1961." width="720" height="510" class="size-full wp-image-170" /></a><p class="wp-caption-text">The average late season rating change for 9 teams whose rating change is statistically significant.</p></div>
<p>Legend:<br />
ANA: Angels<br />
CHW: White Sox<br />
OAK: Athletics<br />
STL: Cardinals<br />
ATL: Braves<br />
TEX: Rangers<br />
CHC: Cubs<br />
NYY: Yankees<br />
DET: Tigers</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/playingwithmodels.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/playingwithmodels.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/playingwithmodels.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/playingwithmodels.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/playingwithmodels.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/playingwithmodels.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/playingwithmodels.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/playingwithmodels.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/playingwithmodels.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/playingwithmodels.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/playingwithmodels.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/playingwithmodels.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/playingwithmodels.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/playingwithmodels.wordpress.com/166/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=166&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://playingwithmodels.wordpress.com/2010/03/24/its-tree-cubs-choke-while-yankees-surge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1e043fc93cb97bf7eab0412349c1d99c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alex M</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/03/1969cubs.jpg" medium="image">
			<media:title type="html">1969 Chicago Cubs</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/03/cubs_yankees.png" medium="image">
			<media:title type="html">1977 Yankees vs 1969 Cubs</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/03/delta_elo.png" medium="image">
			<media:title type="html">Late season change in the rating since 1961.</media:title>
		</media:content>
	</item>
		<item>
		<title>Basketball Time Machine</title>
		<link>http://playingwithmodels.wordpress.com/2010/03/10/an-objective-way-to-rate-true-strength-of-sports-teams/</link>
		<comments>http://playingwithmodels.wordpress.com/2010/03/10/an-objective-way-to-rate-true-strength-of-sports-teams/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 03:33:27 +0000</pubDate>
		<dc:creator>Alexander Lobkovsky Meitiv</dc:creator>
				<category><![CDATA[Sports]]></category>
		<category><![CDATA[Statistics]]></category>
		<category><![CDATA[1986 Celtics]]></category>
		<category><![CDATA[1997 Bulls]]></category>
		<category><![CDATA[Basketball]]></category>
		<category><![CDATA[ELO ranking system]]></category>
		<category><![CDATA[NBA]]></category>
		<category><![CDATA[Sports ranking]]></category>
		<category><![CDATA[Time travel]]></category>

		<guid isPermaLink="false">http://playingwithmodels.wordpress.com/?p=132</guid>
		<description><![CDATA[What would you do with a time machine? I bet some people would be chomping at the bit to pit two dominant teams from different eras against each other and have a grand old spectacle! But alas, it is safe to say that a time machine will remain for the foreseeable future in the realm [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=132&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_133" class="wp-caption alignright" style="width: 410px"><img src="http://playingwithmodels.files.wordpress.com/2010/03/espndb_1986nbachamp_576.jpg?w=400&#038;h=208" alt="1986 Celtics" title="1986 Boston Celtics" width="400" height="208" class="size-medium wp-image-133" /><p class="wp-caption-text">1986 Celtics</p></div>
<div id="attachment_134" class="wp-caption alignright" style="width: 290px"><img src="http://playingwithmodels.files.wordpress.com/2010/03/espndb_1997nbachamp_576.jpg?w=280&#038;h=203" alt="1997 Bulls" title="1997 Chicago Bulls" width="280" height="203" class="size-medium wp-image-134" /><p class="wp-caption-text">1997 Bulls</p></div>
<p>What would you do with a time machine?  I bet some people would be chomping at the bit to pit two dominant teams from different eras against each other and have a grand old spectacle!<br />
But alas, it is safe to say that a time machine will remain for the foreseeable future in the realm of magic.</p>
<p>Can we get a glimpse at what the outcome of such a magical game might be?  Is there a scientifically sound way to rate sports teams in a way that judges their true strength.  Most importantly, we need a method that yields ratings whose scale does not change with time so that a team that gets a rating of 2000 thirty years ago is as strong (in some sense) as a team that gets a rating of 2000 today.</p>
<p>We are indeed in luck!  Such a system exists.  It was proposed in the 1950&#8242;s by a Hungarian mathematician <a href="http://en.wikipedia.org/wiki/Arpad_Elo">Arpad Elo</a> (read about him on Wikipedia) and bears his name.  His system is based on sound mathematical theory and ever since then dozens upon dozens of mathematical papers have been proving how reliable and reasonable the system is.  Although Elo originally proposed his system to rate chess players, it has been adopted by a number of other sports bodies including FIDE, FIFA, MLB, EGF and others.</p>
<p>At the core of the <a href="http://en.wikipedia.org/wiki/Elo_rating_system">ELO system</a> is the ranking updating scheme which adjusts the ranking of the two teams (or players) after each match depending on the result.  Given the rankings before the game, one can compute the probability of each outcome given that the actual performance has a certain probability distribution.  If the stronger team wins its rating increases by a smaller amount than if the weaker team wins.  There are many different specific incarnations of the system. While some are more accurate than others, even in its simplest form, the system is quite useful.  In fact using publicly available match data we can resolve the question:</p>
<h3>If 1997 Chicago Bulls played a best of 7 series against the 1986 Boston Celtics, what are the chances of each team winning?</h3>
<p>After downloading the match data (56,467 games over 64 years that involved a total of 53 franchises some of which changed names and cities a number of time) and computing the rating history I came up with the top ten highest rated franchises:</p>
<div align="center">
<table border="1" cellspacing="4" cellpadding="4">
<tr align="center">
<td><strong>Rank</strong></td>
<td><strong>Team</strong></td>
<td><strong>Year achieved</strong></td>
<td><strong>Rating</strong></td>
</tr>
<tr>
<td align="center">1</td>
<td>Chicago Bulls</td>
<td align="center">1997</td>
<td>2233.7</td>
</tr>
<tr>
<td align="center">2</td>
<td>Boston Celtics
<td align="center">1986</td>
<td>2184.9</td>
</tr>
<tr>
<td align="center">3</td>
<td>Los Angeles Lakers</td>
<td align="center">1988</td>
<td>2163.3</td>
</tr>
<tr>
<td align="center">4</td>
<td>Philadelphia 76ers</td>
<td align="center">1983</td>
<td>2149.2</td>
</tr>
<tr>
<td align="center">5</td>
<td>Detroit Pistons</td>
<td align="center">1990</td>
<td>2137.4</td>
</tr>
<tr>
<td align="center">6</td>
<td>Utah Jazz</td>
<td align="center">1999</td>
<td>2129.9</td>
</tr>
<tr>
<td align="center">7</td>
<td>Dallas Mavericks</td>
<td align="center">2007</td>
<td>2126.5</td>
</tr>
<tr>
<td align="center">8</td>
<td>San Antonio Spurs</td>
<td align="center">2007</td>
<td>2089.4</td>
</tr>
<tr>
<td align="center">9</td>
<td>Milwaukee Bucks</td>
<td align="center">1971</td>
<td>2081.6</td>
</tr>
<tr>
<td align="center">10</td>
<td>Seattle Supersonics</td>
<td align="center">1996</td>
<td>2076.5</td>
</tr>
</table>
</div>
<p>It is a telling sign that the NBA is a competitively healthy organization that the top 10 all time high ranking teams of all time pretty close to each other in rating.  Also, it seems at least superficially, that there is no historical bias meaning the objective meaning of a rating does not change with time. </p>
<p>So, what would happen if the 1997 Bulls played a best of 7 series against the 1986 Celtics?<br />
Home field advantage aside (the ranking I am using does not take that into account), the probability of the Bulls winning any particular game is <img src="http://latex.codecogs.com/gif.download?p=0.53" />.  The probability of winning a best of 7 series (below <img src="http://latex.codecogs.com/gif.download?q=1-p=0.47" />)</p>
<p><img src="http://latex.codecogs.com/gif.download?\frac{p^4(1 + 4q + 15q^2 + 4q^3)}{p^4(1 + 4q + 15q^2 + 4q^3) + q^4(1 + 4p + 15p^2 + 4p^3)}=0.575" /></p>
<p>The Bulls would have a 57.5% chance of winning the series: an exiting spectacle indeed! </p>
<p>Finally I leave you with a graph of the historical ratings of six teams from large metropolitan areas from 1980 to present day.  It seems that it is extremely difficult to maintain a dominant team for more than a few seasons (although the Lakers managed to do so in the 1980&#8242;s).</p>
<div id="attachment_154" class="wp-caption aligncenter" style="width: 460px"><a href="http://playingwithmodels.files.wordpress.com/2010/03/nba_historical_ratings.jpg"><img src="http://playingwithmodels.files.wordpress.com/2010/03/nba_historical_ratings.jpg?w=720" alt="NBA ELO ratings graph" title="Historical ELO ratings for six NBA teams from large metropolitan areas"   class="size-full wp-image-154" /></a><p class="wp-caption-text">Historical season ending ELO ratings for six NBA teams from large metropolitan areas</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/playingwithmodels.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/playingwithmodels.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/playingwithmodels.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/playingwithmodels.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/playingwithmodels.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/playingwithmodels.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/playingwithmodels.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/playingwithmodels.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/playingwithmodels.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/playingwithmodels.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/playingwithmodels.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/playingwithmodels.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/playingwithmodels.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/playingwithmodels.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=132&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://playingwithmodels.wordpress.com/2010/03/10/an-objective-way-to-rate-true-strength-of-sports-teams/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1e043fc93cb97bf7eab0412349c1d99c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alex M</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/03/espndb_1986nbachamp_576.jpg?w=400" medium="image">
			<media:title type="html">1986 Boston Celtics</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/03/espndb_1997nbachamp_576.jpg?w=280" medium="image">
			<media:title type="html">1997 Chicago Bulls</media:title>
		</media:content>

		<media:content url="http://latex.codecogs.com/gif.download?p=0.53" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?q=1-p=0.47" medium="image" />

		<media:content url="http://latex.codecogs.com/gif.download?fracp4(1+4q+15q2+4q3)p4(1+4q+15q2+4q3)+q4(1+4p+15p2+4p3)=0.575" medium="image" />

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/03/nba_historical_ratings.jpg" medium="image">
			<media:title type="html">Historical ELO ratings for six NBA teams from large metropolitan areas</media:title>
		</media:content>
	</item>
		<item>
		<title>Unavoidable Attraction</title>
		<link>http://playingwithmodels.wordpress.com/2010/03/02/unavoidable-attraction/</link>
		<comments>http://playingwithmodels.wordpress.com/2010/03/02/unavoidable-attraction/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 20:51:43 +0000</pubDate>
		<dc:creator>Alexander Lobkovsky Meitiv</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Transportation]]></category>
		<category><![CDATA[Bus bunching]]></category>
		<category><![CDATA[correlations]]></category>
		<category><![CDATA[instability.]]></category>

		<guid isPermaLink="false">http://playingwithmodels.wordpress.com/?p=86</guid>
		<description><![CDATA[Everyone who rides buses in a city is familiar with the dreaded &#8220;bus bunching&#8221; phenomenon. Especially during rush hour, buses tend to arrive in bunches of two, three or even more. Why is that? To begin understanding this phenomenon we must first assimilate the notion of fluctuations. The bus&#8217;s progress along the route, though ideally [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=86&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_93" class="wp-caption alignleft" style="width: 440px"><a href="http://playingwithmodels.wordpress.com/2010/03/02/unavoidable-attraction/gridlock/" rel="attachment wp-att-93"><img src="http://playingwithmodels.files.wordpress.com/2010/02/gridlock.jpg?w=720" alt="Gridlock" title="Bus bunches in heavy traffic"   class="size-full wp-image-93" /></a><p class="wp-caption-text">When trafic is heavy, buses tend to form hard to breakup bunches.</p></div>Everyone who rides buses in a city is familiar with the dreaded &#8220;bus bunching&#8221; phenomenon.  Especially during rush hour, buses tend to arrive in bunches of two, three or even more.  Why is that?</p>
<p>To begin understanding this phenomenon we must first assimilate the notion of fluctuations.  The bus&#8217;s progress along the route, though ideally on schedule, in practice is not.  At each stop there is a difference between the actual and the scheduled arrival time.  The nature of the fluctuations is such that this difference tends to grow along the route of the bus.  In technical terms, the bus&#8217;s trajectory is called a directed random walk.  There are several sources of the fluctuations: stop lights, variation in the number of passengers to be picked up and discharged and, of course, traffic.</p>
<p>When fluctuations are strong, and/or, the buses are frequent, it is unavoidable that consecutive buses find themselves at the same bus stop.  What happens afterwards is less clear cut.  It seems that it is virtually impossible for the buses to separate again.  From that point on the two (or more) buses travel in a bunch.  The average speed of a bus bunch is frequently greater than that of an isolated bus and therefore bunches tend to overtake and absorb buses that are ahead.</p>
<p>Let&#8217;s try to come up with a plausible explanation for the two observed phenomena:  Why do bus bunches not break up naturally?  Why is the average speed of the bunch different from the average speed of an isolated bus?</p>
<p>Let&#8217;s tackle the questions one at a time.  When don&#8217;t bunches break up?  There could be several reasons.  Without real field data, I am afraid, we won&#8217;t be able to say for certain which factor is the most important.</p>
<p>Possible reason #1:  Excluded volume interactions.  Analogy with colloids.</p>
<p>Colloids are suspensions of small solid particles in a fluid.  It is a well know phenomenon, readily reproducible in a lab, that when you combine colloidal particles of two substantially different sizes, they tend to separate even if the particles themselves are not attracted to each other.  It may be counterintuitive, but the system can increase its entropy by separating particles by size.  Once a small particle escapes from the aggregate of large particles, it is extremely unlikely to make it back there.</p>
<p>The same size separation might happen in traffic, although likely for different reasons.  How much do you like being sandwiched between a bus and a dump truck?  You try to get the hell out of there at the first opportunity.</p>
<p>So spaces between traveling buses may be unlikely to be filled up with cars.  In a sense, there is an effective attraction between buses cased by the car&#8217;s avoidance of the space between them.</p>
<p>One would certainly need data to support or reject the excluded volume hypothesis of bus attraction.</p>
<p>Possible reason #2:  Correlation between the number of waiting passengers and the distance to the nearest bus ahead.</p>
<p>Now this idea is something we could sink our teeth into.  Suppose that the gap between two buses shrinks due to a random fluctuation of unspecified nature.  Then, the mean number of passengers waiting for the second bus, which is proportional to the wait time (if the passengers arrive at the bus stop at a fixed rate), also decreases.  Therefore the second bus will spend less time picking up passengers, it&#8217;s mean velocity will therefore increase and it will catch up with the bus ahead.  We can therefore say that the state with evenly spaced buses along the route is unstable to collapse.</p>
<p>This idea can be formalized in the following simple toy model.</p>
<p>Suppose there is a circular route with equidistant stops (a linear route is really circular if the buses turn around at the end of the route and go back immediately).  Initially a number of buses are uniformly distributed along the route.  Passengers arrive at all bus stops at a fixed rate.  The time a bus spends at a stop is proportional to the number of passengers waiting there.</p>
<p>Passenger discharge can be included in the model.  However it does not qualitatively affect the results.</p>
<p>There are two important parameters in this model: 1) the product of the travel time between stops and the rate of passenger arrival.  This parameter determines whether the bus spends most of its time traveling or picking up passengers.  2) The ratio of the number of stops to the number of buses.</p>
<p>It turns out that if the first parameter is large (most time is spent traveling) or the second parameter is small (there are lots of buses), bunching does not occur.</p>
<p>However, as illustrated in the figure below, there is a realistic parameter range in which bunching does occur and bunches have no chance to break up.  In the figure below (which presents the output of the simple model above), the three buses were initially well spaced.  Eventually, buses 1 and 2 form a bunch which catches up to bus 3.</p>
<p>Once the bunch of two buses is formed, the buses leapfrog each other and pick up passengers at alternating stops.  Here is therefore the answer to our second question why bunches travel faster: each bus only has to accelerate/decelerate less frequently since they only stop at every other stop.  Hence the average speed is greater.</p>
<p>It would be fun to go out there and time some bus arrivals to see if they can be well described by the model.  Any takers?</p>
<div id="attachment_111" class="wp-caption alignleft" style="width: 460px"><a href="http://playingwithmodels.files.wordpress.com/2010/03/bus_bunches.jpg"><img src="http://playingwithmodels.files.wordpress.com/2010/03/bus_bunches.jpg?w=720" alt="Graph illustrating the bunch formation" title="Stochastic model reproduces the bus bunching behavior"   class="size-full wp-image-111" /></a><p class="wp-caption-text">Correlation between the space between buses and the number of waiting passengers results in the bunching behavior.</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/playingwithmodels.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/playingwithmodels.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/playingwithmodels.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/playingwithmodels.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/playingwithmodels.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/playingwithmodels.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/playingwithmodels.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/playingwithmodels.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/playingwithmodels.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/playingwithmodels.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/playingwithmodels.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/playingwithmodels.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/playingwithmodels.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/playingwithmodels.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=playingwithmodels.wordpress.com&amp;blog=12169277&amp;post=86&amp;subd=playingwithmodels&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://playingwithmodels.wordpress.com/2010/03/02/unavoidable-attraction/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1e043fc93cb97bf7eab0412349c1d99c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alex M</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/02/gridlock.jpg" medium="image">
			<media:title type="html">Bus bunches in heavy traffic</media:title>
		</media:content>

		<media:content url="http://playingwithmodels.files.wordpress.com/2010/03/bus_bunches.jpg" medium="image">
			<media:title type="html">Stochastic model reproduces the bus bunching behavior</media:title>
		</media:content>
	</item>
	</channel>
</rss>
