<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Red Writes Here</title>
	
	<link>http://redwriteshere.com</link>
	<description>Hey, I'm Red and this is where I write</description>
	<pubDate>Thu, 16 Jul 2009 21:46:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/RedWritesHere" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Basic Perceptron Neural Network - Section 1</title>
		<link>http://redwriteshere.com/2009/07/basic-perceptron-neural-network-section-1/</link>
		<comments>http://redwriteshere.com/2009/07/basic-perceptron-neural-network-section-1/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 21:46:56 +0000</pubDate>
		<dc:creator>reddavis</dc:creator>
		
		<category><![CDATA[Machine Learning]]></category>

		<category><![CDATA[neural network]]></category>

		<category><![CDATA[perceptron]]></category>

		<guid isPermaLink="false">http://redwriteshere.com/?p=364</guid>
		<description><![CDATA[The last month or so I&#8217;ve become really interested in machine learning and I&#8217;m currently reading Machine Learning: An Algorithmic Perspective by Stephen Marsland.
The main engine behind a project I&#8217;m currently working on is a neural network. Neural networks are based on the way your brain works. Have you ever smelt something and a picture [...]]]></description>
			<content:encoded><![CDATA[<p>The last month or so I&#8217;ve become really interested in machine learning and I&#8217;m currently reading <a href="http://www.amazon.com/Machine-Learning-Algorithmic-Perspective-Recognition/dp/1420067184">Machine Learning: An Algorithmic Perspective by Stephen Marsland</a>.</p>
<p>The main engine behind a project I&#8217;m currently working on is a neural network. Neural networks are based on the way your brain works. Have you ever smelt something and a picture of someone you know appears in your head? This is to do (in VERY basic form) with the neurons firing in your head. What has happened is that over time, you have smelt this smell whenever around that certain person. Everytime this happened  the strength of the synapse (the thing between the neurons) between the picture of the person and the smell of the smell became stronger.</p>
<p>I&#8217;m going to take you through making a very basic neural network called a Perceptron. We are going to teach it the OR logic. It&#8217;s not exactly the most exciting thing, but seems to be the machine learning version of &#8220;Hello World&#8221;.</p>
<p>Firstly lets get some neural network basics down:</p>
<p>Our inputs will be in this form:</p>
<p><script src="http://gist.github.com/148704.js"></script> If we take 0&#8217;s as nil and 1 as anything other than nil, then our OR logic would look like this in Ruby: (not the best example, but you get the idea)  <script src="http://gist.github.com/148707.js"></script></p>
<p>As we know, neural networks consist of neurons. A neuron consists of:</p>
<p>Threshold: This is a static amount that determines whether our neuron fires or not.</p>
<p>Weight: The weight is a dynamic number that is used within the activation function.</p>
<p>Activation Function: This is a function that decides whether the neuron fires or not. In this case, our activation function is going to be as shown:</li>
<p><center>y<sub>j</sub> = g( for_each_input sum(weight * input) )</center></p>
<p>y is used to represent the activation function and g is the function. If the answer is greater than our threshold (in this case 0) then the neuron fires.</p>
<p>This NN (neural network) is split up into two parts. The training part and the recall part. In the next section we will build the outline of the network</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fredwriteshere.com%2F2009%2F07%2Fbasic-perceptron-neural-network-section-1%2F&amp;linkname=Basic%20Perceptron%20Neural%20Network%20-%20Section%201">Share</a>]]></content:encoded>
			<wfw:commentRss>http://redwriteshere.com/2009/07/basic-perceptron-neural-network-section-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introduction To Probability - 1.5</title>
		<link>http://redwriteshere.com/2009/06/introduction-to-probability-15/</link>
		<comments>http://redwriteshere.com/2009/06/introduction-to-probability-15/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 17:09:19 +0000</pubDate>
		<dc:creator>reddavis</dc:creator>
		
		<category><![CDATA[Probability]]></category>

		<category><![CDATA[factorial]]></category>

		<category><![CDATA[lottery]]></category>

		<guid isPermaLink="false">http://redwriteshere.com/?p=357</guid>
		<description><![CDATA[
How would be go about calculating the probability of winning the lottery?

In total there are 7 balls that are drawn for the UK National Lottery: 6 normal balls a bonus ball. The seven balls are all drawn from the same batch of 49 balls.
To receive first place you need all 6 normal balls. To understand [...]]]></description>
			<content:encoded><![CDATA[<p><strong>
<p>How would be go about calculating the probability of winning the lottery?</p>
<p></strong></p>
<p>In total there are 7 balls that are drawn for the UK National Lottery: 6 normal balls a bonus ball. The seven balls are all drawn from the same batch of 49 balls.</p>
<p>To receive first place you need all 6 normal balls. To understand whats going on here we need to understand factorials.</p>
<p><strong>
<p>Factorials</p>
<p></strong></p>
<p>There are 3 people in a room: A, B, C. If we were to ask them to leave the room, what are all possible combinations in which they leave the room:</p>
<p><center>
<p>ABC</p>
<p></center><br />
<center>
<p>ACB</p>
<p></center><br />
<center>
<p>BAC</p>
<p></center><br />
<center>
<p>BCA</p>
<p></center><br />
<center>
<p>CAB</p>
<p></center><br />
<center>
<p>CBA</p>
<p></center></p>
<p>A way to calculate this is: N = 3&#215;2x1</p>
<p>Now if there were 24 people, the number of combinations would be: N = 24&#215;23x22&#8230; Now this equals a rather large number, which would make writing calculation a pain in the ass, so we shorthand them like so:</p>
<p><center>
<p>24!</p>
<p></center></p>
<p>This is a factorial.</p>
<p>Let&#8217;s say we now have 4 people in a room and ask them to leave just like we did before, but this time we only care about the first two people who leave. How many different combination can we have? We can work this out like so:</p>
<p><center>
<p>4&#215;3 = 12</p>
<p></center></p>
<p>If we had 24 people and only cared about the first 5 we would calculate it by:</p>
<p><center>
<p>24&#215;23x22&#215;21x20</p>
<p></center></p>
<p>As you can see, it can get a bit boring having to type all of that into a calculator, so we can use this instead:</p>
<p><center>
<p>n! / (n-r)! where n = number of objects, r = amount we care about</p>
<p></center></p>
<p>From this we can work out that:</p>
<p><center>
<p>C = 4! / (4-2)!</p>
<p></center><br />
<center>
<p>C = 24 / 2</p>
<p></center><br />
<center>
<p>12 Different combinations</p>
<p></center></p>
<p><strong>
<p>Back to the lottery&#8230;</p>
<p></strong></p>
<p>You may noticed that the method I was just talking about care about <b>order</b> but in the lottery it doesn&#8217;t matter if the number 2 comes first or third (disregarding the bonus ball as we have no care in it to win). To disregard order we can calculate the number of ways 6 numbers can arranged:</p>
<p><center>
<p>6! = 720</p>
<p></center></p>
<p>We take the total number of combinations for <b>6</b> balls and divide it by this number:</p>
<p><center>
<p>49&#215;48x47&#215;46x45&#215;44 / 720 = 13,983,816 combinations</p>
<p></center></p>
<p>This means that the probability of us winning first price is 1/13,983,816</p>
<p>This looks messy again, so lets combine this with what we already know:</p>
<p><strong>Number of Combinations - Order Matters</strong></p>
<p><center>
<p>S = n! / (n-r)!</center></p>
<p><strong>Number of Combinations - No Order</strong></p>
<p><center>
<p>T = S / r!</p>
<p></center></p>
<p>And this is turned into:</p>
<p><center>
<p><sup>n</sup>C<sub>r</sub> = n! / (n-r)! x r!</p>
<p></center></p>
<p>Next time we&#8217;ll calculate probability of winning other place prizes</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fredwriteshere.com%2F2009%2F06%2Fintroduction-to-probability-15%2F&amp;linkname=Introduction%20To%20Probability%20-%201.5">Share</a>]]></content:encoded>
			<wfw:commentRss>http://redwriteshere.com/2009/06/introduction-to-probability-15/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Universities: A Type Of Corporation?</title>
		<link>http://redwriteshere.com/2009/06/universities-a-type-of-corporation/</link>
		<comments>http://redwriteshere.com/2009/06/universities-a-type-of-corporation/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 15:13:33 +0000</pubDate>
		<dc:creator>reddavis</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://redwriteshere.com/?p=345</guid>
		<description><![CDATA[As my girlfriend is in the middle of an exam  I offered to do the application for her uni accommodation (as it opens at 10:30).
Annoyingly I wasn&#8217;t very surprised by the craptastic user experience I had.
So, after going through problems with registering next I had to apply for accommodation; so I click applications (I [...]]]></description>
			<content:encoded><![CDATA[<p>As my girlfriend is in the middle of an exam  I offered to do the application for her uni accommodation (as it opens at 10:30).</p>
<p>Annoyingly I wasn&#8217;t very surprised by the craptastic user experience I had.</p>
<p>So, after going through problems with registering next I had to apply for accommodation; so I click applications (I think thats what it said, I can&#8217;t find out as the service has now been shutdown due to &#8220;problems&#8221;). A page comes up showing me that I have 0 applications, nothing new there. Now how the hell do I submit a new application? Theres no sub-menu below the menu that I just clicked, theres no sub-menu in the main window&#8230;Oh, there it is! Right in the bottom left, now why would you put it there? It&#8217;s like putting <a href="http://digg.com">Diggs</a> &#8220;Submit new&#8221; button in the footer!!</p>
<p>Here&#8217;s a picture (I&#8217;ve cut the side bar off)</p>
<p><a href="http://redwriteshere.com/wp-content/uploads/2009/06/picture-4.png"><img src="http://redwriteshere.com/wp-content/uploads/2009/06/picture-4-300x157.png" alt="picture-4" title="picture-4" width="300" height="157" class="aligncenter size-medium wp-image-347" /></a></p>
<p>They couldn&#8217;t even bother to make the background on the help buttons the same colour as the background their sitting on:</p>
<p><a href="http://redwriteshere.com/wp-content/uploads/2009/06/picture-1.png"><img src="http://redwriteshere.com/wp-content/uploads/2009/06/picture-1-300x7.png" alt="picture-1" title="picture-1" width="300" height="7" class="aligncenter size-medium wp-image-349" /></a></p>
<p>After finding my way around I managed to get the the page where I had to accept the terms and conditions. I&#8217;m noticing a trend here&#8230;They like to put important button in the bottom left! If you look at the picture below, how far do I need to move my mouse to just submit this one fielded form!? Not only that but I&#8217;m seeing some terrible logic going on here&#8230;(I think this deserves its own paragraph)</p>
<p>It asks you to confirm you have read and understood the T&#8217;s and C&#8217;s. Next to the writing is a tick box, nothing new here as its normal practice, but then in the bottom left their are two buttons, and &#8220;Yes&#8221; and a &#8220;No&#8221;. What!? Am I ticking the box to confirm I have read it and then using the buttons below to confirm I understand it?? What if I don&#8217;t tick the box but click yes?</p>
<p><a href="http://redwriteshere.com/wp-content/uploads/2009/06/picture-3.png"><img src="http://redwriteshere.com/wp-content/uploads/2009/06/picture-3-300x218.png" alt="picture-3" title="picture-3" width="300" height="218" class="aligncenter size-medium wp-image-351" /></a></p>
<p>Not only that, but through the whole process I received lots of 503 errors. Now, I can forgive if all of a sudden they received a ton of traffic and weren&#8217;t expecting it, but they must have set this date months in advance; not only that, but they go through this same process every bloody year! Buy or hire another 1/2/3 servers just for a day, take <a href="http://aws.amazon.com/ec2/">EC2</a> or <a href="http://aws.amazon.com/ec2/">Mosso</a> for a spin. Your not exactly selling the last 1000 tickets for Leeds and Reading festivals.</p>
<p>I had also sent an email around 10:30 this morning asking whether there were problems their end, I also sent another one telling that the app had told me to contact them. I have yet to hear back for either email. To put them to shame, I emailed <a href="http://pragprog.com/">Pragmatic Programmers</a> this morning to see whether they could transfer a book I got for my bday to my account. Within an hour it was done!</p>
<p>I got that awesome service  for buying a book (well I didn&#8217;t actually buy it, which makes the whole service even better), yet we&#8217;re paying the university thousands of pounds and we still had to go through this poo bath!  Universities can sometimes remind me of those big corporations who know that people need (or think they need) their product so feel that they don&#8217;t have to care about their users.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fredwriteshere.com%2F2009%2F06%2Funiversities-a-type-of-corporation%2F&amp;linkname=Universities%3A%20A%20Type%20Of%20Corporation%3F">Share</a>]]></content:encoded>
			<wfw:commentRss>http://redwriteshere.com/2009/06/universities-a-type-of-corporation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Line Type By Good Service</title>
		<link>http://redwriteshere.com/2009/06/line-type-by-good-service/</link>
		<comments>http://redwriteshere.com/2009/06/line-type-by-good-service/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 13:00:42 +0000</pubDate>
		<dc:creator>reddavis</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://redwriteshere.com/?p=339</guid>
		<description><![CDATA[I&#8217;ve put some data together to see if theres a correlation between line type and delays.
I used the info on Wikipedia to get what type each line is

Share]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve put some data together to see if theres a correlation between line type and delays.</p>
<p>I used the info on <a href="http://en.wikipedia.org/wiki/Bakerloo_line">Wikipedia</a> to get what type each line is</p>
<p style="text-align: center;"><a href="http://redwriteshere.com/wp-content/uploads/2009/06/line-type-by-good-service2.png"><img class="aligncenter size-medium wp-image-343" title="line-type-by-good-service2" src="http://redwriteshere.com/wp-content/uploads/2009/06/line-type-by-good-service2-300x151.png" alt="line-type-by-good-service2" width="300" height="151" /></a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fredwriteshere.com%2F2009%2F06%2Fline-type-by-good-service%2F&amp;linkname=Line%20Type%20By%20Good%20Service">Share</a>]]></content:encoded>
			<wfw:commentRss>http://redwriteshere.com/2009/06/line-type-by-good-service/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Line Status By Amount</title>
		<link>http://redwriteshere.com/2009/06/and-some-more/</link>
		<comments>http://redwriteshere.com/2009/06/and-some-more/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 14:33:47 +0000</pubDate>
		<dc:creator>reddavis</dc:creator>
		
		<category><![CDATA[statistics]]></category>

		<category><![CDATA[london tube]]></category>

		<category><![CDATA[london underground]]></category>

		<category><![CDATA[tube]]></category>

		<guid isPermaLink="false">http://redwriteshere.com/?p=323</guid>
		<description><![CDATA[Jubilee isn&#8217;t so great at only being in &#8220;Good service&#8221; 52% of the time and Hammer Smith &#38; City is only &#8220;Good service&#8221; 60% of the time.
Share]]></description>
			<content:encoded><![CDATA[<p>Jubilee isn&#8217;t so great at only being in &#8220;Good service&#8221; 52% of the time and Hammer Smith &amp; City is only &#8220;Good service&#8221; 60% of the time.</p>

<a href='http://redwriteshere.com/2009/06/and-some-more/bakerloo2/' title='bakerloo2'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/bakerloo2-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/and-some-more/central2/' title='central2'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/central2-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/and-some-more/circle2/' title='circle2'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/circle2-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/and-some-more/district2/' title='district2'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/district2-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/and-some-more/hammer-smith-and-city1/' title='hammer-smith-and-city1'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/hammer-smith-and-city1-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/and-some-more/jubilee2/' title='jubilee2'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/jubilee2-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/and-some-more/metropolitan2/' title='metropolitan2'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/metropolitan2-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/and-some-more/northern2/' title='northern2'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/northern2-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/and-some-more/piccadilly1/' title='piccadilly1'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/piccadilly1-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/and-some-more/victoria2/' title='victoria2'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/victoria2-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>

<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fredwriteshere.com%2F2009%2F06%2Fand-some-more%2F&amp;linkname=Line%20Status%20By%20Amount">Share</a>]]></content:encoded>
			<wfw:commentRss>http://redwriteshere.com/2009/06/and-some-more/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Some More London Tube Graphs…</title>
		<link>http://redwriteshere.com/2009/06/some-more-london-tube-graphs/</link>
		<comments>http://redwriteshere.com/2009/06/some-more-london-tube-graphs/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 11:36:26 +0000</pubDate>
		<dc:creator>reddavis</dc:creator>
		
		<category><![CDATA[statistics]]></category>

		<category><![CDATA[london under ground]]></category>

		<category><![CDATA[tfl]]></category>

		<category><![CDATA[tube]]></category>

		<guid isPermaLink="false">http://redwriteshere.com/?p=307</guid>
		<description><![CDATA[I&#8217;ve created a bunch of graphs to see if theres any relation between time and tube status. Most of the graphs show theres a decline in &#8220;Good service&#8221; around rush hour times.
Some interesting points:

A large amount of Bakerloo delays happen in the morning rush hour.
Circle line suffers from a lot of severe delays around both [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve created a bunch of graphs to see if theres any relation between time and tube status. Most of the graphs show theres a decline in &#8220;Good service&#8221; around rush hour times.</p>
<p>Some interesting points:</p>
<ul>
<li>A large amount of Bakerloo delays happen in the morning rush hour.</li>
<li>Circle line suffers from a lot of severe delays around both rush hours.</li>
<li>Metropolitan line has a lot of problems during morning rush hour, but it alright evening rush hour.</li>
<li>Picadilly line is very reliable compared to other.</li>
<li>Victoria line has had a spread of planned closures, I believe their doing work on it, but haven&#8217;t been on that line for a long time.</li>
</ul>

<a href='http://redwriteshere.com/2009/06/some-more-london-tube-graphs/bakerloo1/' title='bakerloo1'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/bakerloo1-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/some-more-london-tube-graphs/central1/' title='central1'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/central1-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/some-more-london-tube-graphs/circle1/' title='circle1'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/circle1-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/some-more-london-tube-graphs/district1/' title='district1'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/district1-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/some-more-london-tube-graphs/hammer-smith-and-city/' title='hammer-smith-and-city'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/hammer-smith-and-city-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/some-more-london-tube-graphs/jubilee1/' title='jubilee1'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/jubilee1-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/some-more-london-tube-graphs/metropolitan1/' title='metropolitan1'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/metropolitan1-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/some-more-london-tube-graphs/northern1/' title='northern1'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/northern1-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/some-more-london-tube-graphs/picacadilly/' title='picacadilly'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/picacadilly-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/some-more-london-tube-graphs/victoria1/' title='victoria1'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/victoria1-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>

<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fredwriteshere.com%2F2009%2F06%2Fsome-more-london-tube-graphs%2F&amp;linkname=Some%20More%20London%20Tube%20Graphs%26%238230%3B">Share</a>]]></content:encoded>
			<wfw:commentRss>http://redwriteshere.com/2009/06/some-more-london-tube-graphs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tube Status Stats</title>
		<link>http://redwriteshere.com/2009/06/tube-status-stats/</link>
		<comments>http://redwriteshere.com/2009/06/tube-status-stats/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 22:28:12 +0000</pubDate>
		<dc:creator>reddavis</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://redwriteshere.com/?p=290</guid>
		<description><![CDATA[The last couple of weeks I&#8217;ve been collecting data on:

Tube - Status - Time - Weather - Temperature

I am playing with different ways to see if I can write a program to predict the status of a tube.
I thought I&#8217;d post a couple of graphs to show the different statuses of the tubes.
Share]]></description>
			<content:encoded><![CDATA[<p>The last couple of weeks I&#8217;ve been collecting data on:</p>
<p><center>
<p>Tube - Status - Time - Weather - Temperature</p>
<p></center></p>
<p>I am playing with different ways to see if I can write a program to predict the status of a tube.</p>
<p>I thought I&#8217;d post a couple of graphs to show the different statuses of the tubes.</p>

<a href='http://redwriteshere.com/2009/06/tube-status-stats/bakerloo/' title='bakerloo'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/bakerloo-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/tube-status-stats/central/' title='central'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/central-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/tube-status-stats/circle/' title='circle'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/circle-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/tube-status-stats/district/' title='district'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/district-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/tube-status-stats/hsmith-city/' title='hsmith-city'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/hsmith-city-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/tube-status-stats/jubilee/' title='jubilee'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/jubilee-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/tube-status-stats/metropolitan/' title='metropolitan'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/metropolitan-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/tube-status-stats/northern/' title='northern'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/northern-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/tube-status-stats/piccadilly/' title='piccadilly'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/piccadilly-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://redwriteshere.com/2009/06/tube-status-stats/victoria/' title='victoria'><img src="http://redwriteshere.com/wp-content/uploads/2009/06/victoria-150x150.png" width="150" height="150" class="attachment-thumbnail" alt="" /></a>

<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fredwriteshere.com%2F2009%2F06%2Ftube-status-stats%2F&amp;linkname=Tube%20Status%20Stats">Share</a>]]></content:encoded>
			<wfw:commentRss>http://redwriteshere.com/2009/06/tube-status-stats/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introduction To Probability - 1.4</title>
		<link>http://redwriteshere.com/2009/06/introduction-to-probability-14/</link>
		<comments>http://redwriteshere.com/2009/06/introduction-to-probability-14/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 16:48:35 +0000</pubDate>
		<dc:creator>reddavis</dc:creator>
		
		<category><![CDATA[Probability]]></category>

		<category><![CDATA[infinite probability]]></category>

		<guid isPermaLink="false">http://redwriteshere.com/?p=284</guid>
		<description><![CDATA[So far we have been talking about a distribution function in a finite sample space, but what if the sample space is infinite? As long as the sample space is countably infinite then&#8230;
As an example let&#8217;s say we are going to keep tossing a coin until we get a head. There for our sample space [...]]]></description>
			<content:encoded><![CDATA[<p>So far we have been talking about a distribution function in a finite sample space, but what if the sample space is infinite? As long as the sample space is countably infinite then&#8230;</p>
<p>As an example let&#8217;s say we are going to keep tossing a coin until we get a head. There for our sample space is&#8230;</p>
<p><center>
<p>OHM = {1,2,3,4&#8230;}</p>
<p></center></p>
<p>The possibility of getting a head first time is 1/2, second time is 1/4 and third time 1/8 and so forth.  We can represent this as&#8230;</p>
<p><center>
<p>m(n) = 1/2<sup>n</sup> where n = 1,2,3,4&#8230;</p>
<p></center></p>
<p>We know (from a previous rule) that the sum probability of all items in a sample space must = 1. <a href="http://en.wikipedia.org/wiki/Geometric_series">A geometric series</a> proves this</p>
<p><center>
<p>r + r<sup>2</sup> + r<sup>3</sup> = r/1-r</p>
<p></center></p>
<p>So to put this to use. Let&#8217;s say we want to know the probability of a head turning up after a even throw. Our event E would look like:</p>
<p><center>
<p>E = {2,4,6,8&#8230;}</p>
<p></center></p>
<p><center>
<p>E = 1/4 + 1/16 + 1/64 + &#8230;</p>
<p></center></p>
<p><center>
<p>E = (1/4) / 1 - (1/4) = 1/3</p>
<p></center></p>
<p>Therefore, the probability of getting a head after a even throw is 1/3 and after a odd throw 2/3</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fredwriteshere.com%2F2009%2F06%2Fintroduction-to-probability-14%2F&amp;linkname=Introduction%20To%20Probability%20-%201.4">Share</a>]]></content:encoded>
			<wfw:commentRss>http://redwriteshere.com/2009/06/introduction-to-probability-14/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introduction To Probability - 1.3</title>
		<link>http://redwriteshere.com/2009/05/introduction-to-probability-13/</link>
		<comments>http://redwriteshere.com/2009/05/introduction-to-probability-13/#comments</comments>
		<pubDate>Tue, 26 May 2009 15:57:04 +0000</pubDate>
		<dc:creator>reddavis</dc:creator>
		
		<category><![CDATA[Probability]]></category>

		<category><![CDATA[contructors]]></category>

		<guid isPermaLink="false">http://redwriteshere.com/?p=275</guid>
		<description><![CDATA[We can use symbols to help describe events. This is especially useful when we are trying to describe a complicated event in English. By using these symbols we can break them down into simpler event using these constructors.


A &#x22C3 B = A or B


A &#x22C2 B = A and B


A - B = A and [...]]]></description>
			<content:encoded><![CDATA[<p>We can use symbols to help describe events. This is especially useful when we are trying to describe a complicated event in English. By using these symbols we can break them down into simpler event using these constructors.</p>
<p><br/><br />
<center>
<p>A &#x22C3 B = A or B</p>
<p></center></p>
<p><center>
<p>A &#x22C2 B = A and B</p>
<p></center></p>
<p><center>
<p>A - B = A and NOT B</p>
<p></center></p>
<p><center>
<p>A &#x2282 B = Every element of A is a subset of B</p>
<p></center></p>
<p><center>
<p>Ã = Not A</p>
<p></center><br />
<br/></p>
<p><strong>Example</strong></p>
<p>A = It will snow tomorrow and it will rain the day after</p>
<p>B = It will snow tomorrow</p>
<p>C = It will rain two days from now</p>
<p>D = It will snow tomorrow or it will rain the next two days</p>
<p><br/><br />
<center>
<p>D = B &#x22C3 C</p>
<p></center><br />
<center>
<p>~B = It will not snow tomorrow</p>
<p></center><br />
<br/></p>
<p>Or lets say that our event (E) = &#8220;it will snow tomorrow but will not rain the next day&#8221;</p>
<p><center>
<p>E = B - C</p>
<p></center></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fredwriteshere.com%2F2009%2F05%2Fintroduction-to-probability-13%2F&amp;linkname=Introduction%20To%20Probability%20-%201.3">Share</a>]]></content:encoded>
			<wfw:commentRss>http://redwriteshere.com/2009/05/introduction-to-probability-13/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introduction To Probability - 1.2</title>
		<link>http://redwriteshere.com/2009/05/introduction-to-probability-12/</link>
		<comments>http://redwriteshere.com/2009/05/introduction-to-probability-12/#comments</comments>
		<pubDate>Wed, 20 May 2009 00:18:21 +0000</pubDate>
		<dc:creator>reddavis</dc:creator>
		
		<category><![CDATA[Probability]]></category>

		<category><![CDATA[discrete distribution function]]></category>

		<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://redwriteshere.com/?p=261</guid>
		<description><![CDATA[Hey. This post is going to be about probability distribution on problem with a finite sample space. In other words: Discrete probability distribution.
By saying the sample space is finite means that, for example, we have a die, we know that the different outcomes go from 1 to 6. The math lingo for this is Finite

Lingo

Sample [...]]]></description>
			<content:encoded><![CDATA[<p>Hey. This post is going to be about probability distribution on problem with a finite sample space. In other words: Discrete probability distribution.</p>
<p>By saying the sample space is finite means that, for example, we have a die, we know that the different outcomes go from 1 to 6. The math lingo for this is <em>Finite</em></p>
<p><br/></p>
<p><b>Lingo</b></p>
<p><em></p>
<p><b>Sample Space:</b> A sample space is a set of all the possible outcomes. It us usually assigned to the Ohm symbol</p>
<p><b>Outcome:</b> Elements of a sample space - usually assigned to a lower case letter</p>
<p><b>Event:</b> A subset of a sample space i.e. sample_space = {1,2,3} event = {2,3} - usually assigned to a capital letter</p>
<p></em></p>
<p><br/></p>
<p>OK, so lets go back the good old dice example and assign these new names&#8230;</p>
<p><br/></p>
<p><center></p>
<p>OHM = {1,2,3,4,5,6}</p>
<p></center><br />
<center></p>
<p>i = 1..6</p>
<p></center><br />
<center></p>
<p>E = {2,4,6}</p>
<p></center></p>
<p><br/></p>
<p>So, OHM is the sample space, i is the outcome (elements of our sample space) and E is our event</p>
<p>Event can be described, so this event can be described as the outcome being even.</p>
<p><em>Therefore</em> we can give each outcome a probability of 1/6 and the probability of our event as&#8230;</p>
<p><br/><br />
<center></p>
<p>P(E) = m(2) + m(4) + m(6) = 1/6 + 1/6 + 1/6 = 1/2</p>
<p></center><br />
<br/></p>
<p><em>Distribution functions</em> are the assignment of probability. They have to follow 2 rules:</p>
<ol>
<li>Each probability must be greater than 0 &#8212; m(w) > 0 for all w E OHM &#8211;</li>
<li>Sum of all the probabilities must equal 1</li>
</ol>
<p>If we go back to our dice example. The die has 6 sides, each side has a probability of 1/6, therefore 6 * 1/6 = 1</p>
<p><em>A coin example</em></p>
<p>We are going to toss the coin twice. Now, we have several ways we can display the sample space&#8230;</p>
<ol>
<li>Record the toss in the order it occured - OHM = {HH, TH, HT, TT}</li>
<li>Record number of header occured - OHM = {0,1,2}</li>
<li>Have no regard for the order - OHM = {HH, HT, TT}</li>
</ol>
<p>For this example we&#8217;ll use the first one.</p>
<p><em>Therefore&#8230;</em></p>
<p><br/><br />
<center></p>
<p>m(HH) = m(HT) = m(TH) = m(TT) = 1/4</p>
<p></center><br />
<br/></p>
<p>Following the rules? Check! The probability of all outcomes is equal to 1</p>
<p>So lets start working out the probability of different events</p>
<p><em>An event of at least ONE head comes up</em></p>
<p><br/><br />
<center></p>
<p>E = {HH,HT,TH}</p>
<p></center><br />
<br/></p>
<p>The probability of this event is&#8230;</p>
<p><br/><br />
<center></p>
<p>P(E) = m(HH) + m(HT) + m(TH) = 1/4 + 1/4 + 1/4 = 3/4</p>
<p></center><br />
<br/></p>
<p>Another event could be&#8230;</p>
<p><br/><br />
<center></p>
<p>E = {TH, TT}</p>
<p></center><br />
<br/></p>
<p>An event where a tails comes up first</p>
<p><br/><br />
<center></p>
<p>P(E) = m(HH) + m(HT) = 1/4 + 1/4 = 1/2</p>
<p></center><br />
<br/></p>
<p><em>But what if our outcomes aren&#8217;t equal?</em></p>
<p>Imagine this scenario:</p>
<ul>
<li>3 people (A,B,C) are running a race</li>
<li>Only one person can win</li>
<li>A and B have the same change of winning</li>
<li>C has only half the chance of A or B</li>
</ul>
<p><br/><br />
<center></p>
<p>OHM = {A,B,C}</p>
<p></center><br />
<br/></p>
<p>So, A = (2*C) and so does B = (2*C)</p>
<p><br/><br />
<center></p>
<p>m(A) = m(B) = 2m(C)</p>
<p></center><br />
<br/></p>
<p>If we remember our second rule, then&#8230;</p>
<p><br/><br />
<center></p>
<p>m(A) + m(B) + m(C) = 1</p>
<p></center><br />
<br/></p>
<p>So&#8230;</p>
<p><br/><br />
<center></p>
<p>2m(C) + 2m(C) + m(C) = 1</p>
<p></center></p>
<p><center></p>
<p>5m(C) = 1</p>
<p></center><br />
<br/></p>
<p>Sooooo&#8230;.</p>
<p><br/><br />
<center></p>
<p>m(A) = 2/5 m(B) = 2/5 m(C) = 1/5</p>
<p></center><br />
<br/></p>
<p>Let try another event to smooth any rough edges</p>
<p><br/><br />
<center></p>
<p>E = {A,C}</p>
<p></center></p>
<p><center></p>
<p>P(E) = m(A) + m(C) = 2/5 + 1/5 = 3/5</p>
<p></center></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fredwriteshere.com%2F2009%2F05%2Fintroduction-to-probability-12%2F&amp;linkname=Introduction%20To%20Probability%20-%201.2">Share</a>]]></content:encoded>
			<wfw:commentRss>http://redwriteshere.com/2009/05/introduction-to-probability-12/feed/</wfw:commentRss>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 2.268 seconds. --><!-- Cached page generated by WP-Super-Cache on 2009-08-07 03:03:32 -->
