<?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/"
	>

<channel>
	<title>StaticMethod &#187; Learning</title>
	<atom:link href="http://www.staticmethod.net/category/stuff-you-can-learn/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.staticmethod.net</link>
	<description>Things programmers might find interesting</description>
	<lastBuildDate>Thu, 04 Mar 2010 20:05:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Project Euler</title>
		<link>http://www.staticmethod.net/2009/05/28/project-euler/</link>
		<comments>http://www.staticmethod.net/2009/05/28/project-euler/#comments</comments>
		<pubDate>Thu, 28 May 2009 20:54:29 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Data and Algorithms]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Programming Problems]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[project euler]]></category>

		<guid isPermaLink="false">http://www.staticmethod.net/?p=88</guid>
		<description><![CDATA[Found a cool site called Project Euler
From their description:
Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.
I&#8217;ve done [...]]]></description>
			<content:encoded><![CDATA[<p>Found a cool site called <a href="http://www.projecteuler.net">Project Euler</a></p>
<p>From their description:</p>
<blockquote><p>Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.</p></blockquote>
<p>I&#8217;ve done a few of the first problems, implemented them all in ruby so far (or just did the math required), and they&#8217;ve definitely been interesting and fun to work on.  4 down, 242 to go.  All of the problems are math related, and you are basically presented with the problem and a field to input your answer.  After you supply the correct answer you&#8217;re given a link to the forum (most of which are locked now) where people have discussed their approaches to solving the problem.</p>
<p>If you&#8217;re looking to brush up on some math skills, or just need some interesting problems to throw some code at, this site provides some great things to work on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.staticmethod.net/2009/05/28/project-euler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programmer Competency Matrix</title>
		<link>http://www.staticmethod.net/2009/05/27/programmer-competency-matrix/</link>
		<comments>http://www.staticmethod.net/2009/05/27/programmer-competency-matrix/#comments</comments>
		<pubDate>Wed, 27 May 2009 17:05:35 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.staticmethod.net/?p=85</guid>
		<description><![CDATA[Stumbled across this site: Programmer Competency Matrix
It&#8217;s a pretty good summary of the different levels of programmer competence in a lot of areas.  Mostly I&#8217;m finding it useful in seeing where I&#8217;m at and getting suggestions on what to look into next in an effort to become better at programming and software development.
]]></description>
			<content:encoded><![CDATA[<p>Stumbled across this site: <a href="http://www.indiangeek.net/wp-content/uploads/Programmer competency matrix.htm">Programmer Competency Matrix</a></p>
<p>It&#8217;s a pretty good summary of the different levels of programmer competence in a lot of areas.  Mostly I&#8217;m finding it useful in seeing where I&#8217;m at and getting suggestions on what to look into next in an effort to become better at programming and software development.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.staticmethod.net/2009/05/27/programmer-competency-matrix/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript Map &#8211; Version 0.2</title>
		<link>http://www.staticmethod.net/2009/05/20/javascript-map-02/</link>
		<comments>http://www.staticmethod.net/2009/05/20/javascript-map-02/#comments</comments>
		<pubDate>Wed, 20 May 2009 17:41:30 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Programming Problems]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[map]]></category>

		<guid isPermaLink="false">http://www.staticmethod.net/?p=79</guid>
		<description><![CDATA[After trying to use my previous map implementation in a Firefox extension I&#8217;ve been working on I realized that you can&#8217;t add random attributes to some objects you deal with in that world.  This made my previous approach unworkable. After doing some more searching, I found an approach that seems to work well so far.
The [...]]]></description>
			<content:encoded><![CDATA[<p>After trying to use my previous map implementation in a Firefox extension I&#8217;ve been working on I realized that you can&#8217;t add random attributes to some objects you deal with in that world.  This made my previous approach unworkable. After doing some more searching, I found an approach that seems to work well so far.</p>
<p>The basic idea is that we want to be able to generate an identifier for a random object consistently, then we can associate this identifier with a value.  The limitation is that the identifier needs to be a string (limitation of Javascript&#8217;s internal associative array/object construct), and that native javascript objects don&#8217;t have an internal mechanism for generating an ID (unlike Java&#8217;s Object class, which provides a hashCode() method).</p>
<p>The process to solve this problem has two steps in my current implementation:</p>
<ol>
<li>Store the &#8216;key&#8217; object in an array</li>
<li>Use the &#8216;key&#8217; object&#8217;s array index as the key value for the association</li>
</ol>
<p>This way, I can tell if a passed in &#8216;key&#8217; object has a value in my map by seeing if it&#8217;s in my internal array.  If it&#8217;s in there, I can look up it&#8217;s index&#8217;s value in my associative array (or anonymous object).  If I&#8217;m adding a new key/value pair, I insert the key object into my internal array and then use it&#8217;s index as the &#8216;key&#8217; for my associative array.  Removing a key/value pair from the map involves the following steps:</p>
<ol>
<li>Look up the index of the key object in my internal array</li>
<li>Remove the value that corresponds to the index from the associative array/anonymous object</li>
<li>Remove the key object from the internal array</li>
</ol>
<p>Here&#8217;s an example of the code that inserts a key/value pair into the map, this is a snip from the code, which is more object-oriented:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Internal holders</span>
<span style="color: #003366; font-weight: bold;">var</span> _internalMap <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> _internalArray <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/*
 * Private function for getting the key for an object
 */</span>
<span style="color: #003366; font-weight: bold;">function</span> getKey<span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> key <span style="color: #339933;">=</span> _internalArray.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>key <span style="color: #339933;">==</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        _internalArray.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        key <span style="color: #339933;">=</span> _internalArray.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #006600; font-style: italic;">// &quot;Keys&quot; will be of the form &quot;OR.x&quot; where 'x' is the index in the array</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;OR.&quot;</span> <span style="color: #339933;">+</span> key<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/*
 * Internal put method
 */</span>
put <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>key<span style="color: #339933;">,</span> value<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> objKey <span style="color: #339933;">=</span> getKey<span style="color: #009900;">&#40;</span>key<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    _internalMap<span style="color: #009900;">&#91;</span>objKey<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> value<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The full implementation has get, remove, and size methods as well, and is built as a class, but this kind of shows the mechanism behind it all.  One thing to note is that this implementation relies on Javascript 1.6 (or higher) as the &#8216;indexOf()&#8217; array method was introduced in Javascript 1.6</p>
<p>I&#8217;ve attached the new version (version 0.2), you can find it here: <a rel="attachment wp-att-78" href="http://www.staticmethod.net/2009/05/20/javascript-map-02/jsmap-02/">JsMap Version 0.2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.staticmethod.net/2009/05/20/javascript-map-02/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cuckoo Hash &#8211; Part 2</title>
		<link>http://www.staticmethod.net/2009/05/13/cuckoo-hash-part-2/</link>
		<comments>http://www.staticmethod.net/2009/05/13/cuckoo-hash-part-2/#comments</comments>
		<pubDate>Wed, 13 May 2009 19:26:13 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Data and Algorithms]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Programming Problems]]></category>
		<category><![CDATA[cuckoo hash]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.staticmethod.net/?p=70</guid>
		<description><![CDATA[Small update, the recursion was killing me, so I introduced some attempts to control how deeply the code recurses.  My approach was basically to introduce a depth count, and if the depth count reaches 0, I force a storage growth on the next rehash, thus reducing the number of collisions by increasing the storage size.
This [...]]]></description>
			<content:encoded><![CDATA[<p>Small update, the recursion was killing me, so I introduced some attempts to control how deeply the code recurses.  My approach was basically to introduce a depth count, and if the depth count reaches 0, I force a storage growth on the next rehash, thus reducing the number of collisions by increasing the storage size.</p>
<p>This approach is working pretty well, especially if the size of the storage is set to a larger size to start with.   The insertions and hashing and lookups are fast, it&#8217;s the rehashing and collisions that cause lots of problems.<a rel="attachment wp-att-71" href="http://www.staticmethod.net/2009/05/13/cuckoo-hash-part-2/cuckoo_hash1/"></a></p>
<p><a rel="attachment wp-att-71" href="http://www.staticmethod.net/2009/05/13/cuckoo-hash-part-2/cuckoo_hash1/">Cuckoo Hash Part 2</a> &#8211; Second &#8216;version&#8217; of my cuckoo hash implementation, including the changes above.  It now uses a list of 499 commonly used english words, and inserts 6 permutations of the list (pattern: &#8220;word-<em>i</em>&#8220;, where i is 1-6), for a total insertion count of 2994.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.staticmethod.net/2009/05/13/cuckoo-hash-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cuckoo Hash</title>
		<link>http://www.staticmethod.net/2009/05/12/cuckoo-hash/</link>
		<comments>http://www.staticmethod.net/2009/05/12/cuckoo-hash/#comments</comments>
		<pubDate>Tue, 12 May 2009 17:44:41 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Data and Algorithms]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Programming Problems]]></category>
		<category><![CDATA[cuckoo hash]]></category>
		<category><![CDATA[hashing]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.staticmethod.net/?p=65</guid>
		<description><![CDATA[From Wikipedia:
Cuckoo hashing is a scheme in computer programming for resolving hash collisions of values of hash functions in a table
Very basically, a Cuckoo hash is a table, where the position of an element can be one of two places.  On insertion, if there is another element (call it &#8216;y&#8217;) in the candidate spot, it [...]]]></description>
			<content:encoded><![CDATA[<p>From <a href="http://en.wikipedia.org/wiki/Cuckoo_hashing">Wikipedia</a>:</p>
<blockquote><p><strong>Cuckoo hashing</strong> is a scheme in computer programming for resolving <span class="mw-redirect">hash collisions</span> of values of hash functions in a table</p></blockquote>
<p>Very basically, a Cuckoo hash is a table, where the position of an element can be one of two places.  On insertion, if there is another element (call it &#8216;y&#8217;) in the candidate spot, it is replaced by the item you are inserting.  Then you re-add the &#8216;y&#8217; element to the hash, using the second hash method.  Doing this could cause another element (call it &#8216;z&#8217;) to be displaced, in which case the cycle repeats until all elements are in their new spots.</p>
<p>To look up if an element is in the table, you need to check both possible spots.</p>
<p>You can run into a problem with cycles when inserting values if, for example,  <em>h1(x) = h2(y)</em> and  <em>h2(x) = h1(y)</em>, but you can limit the number of re-insertions to avoid this.  If you reach this limit, you can change your hashing methods and re-insert everything again. This problem happens even more frequently if the load factor on your table is too high, so you can put checks in place to increase the size of the table if you detect that the load is getting high.  In my example, I set the top table load factor to 60%, at which point I double the size of the table and re-insert the elements.</p>
<p>The main problem I&#8217;m running into is that the <em>insert</em> method can call the <em>rehash</em> method if it loops too many times trying to place everything&#8230;but <em>rehash</em> calls <em>insert</em> to rebuild the table with new hashing methods.  This seems to lead to deeply recursive problems, even with a load set to 50%.  I&#8217;m not sure how to fix this right now, but I&#8217;ll keep working at it and take any suggestions.  One method might be to find better hashing algorithms, but I thought the one I was using was descent.</p>
<p>Anyway, since I&#8217;m still learning about it, here&#8217;s a few links to read:</p>
<ul>
<li><a class="external text" title="http://www.it-c.dk/people/pagh/papers/cuckoo-undergrad.pdf" rel="nofollow" href="http://www.it-c.dk/people/pagh/papers/cuckoo-undergrad.pdf">Cuckoo Hashing for Undergraduates, 2006</a>, R. Pagh, 2006. (PDF)</li>
<li><a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/142054">Some String hashing algorithms</a></li>
<li><a rel="attachment wp-att-67" href="http://www.staticmethod.net/2009/05/12/cuckoo-hash/cuckoo_hash/">Cuckoo Hash Attempt 1</a> &#8211; My first attempt at implementing a Cuckoo Hash in Ruby</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.staticmethod.net/2009/05/12/cuckoo-hash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bloom Filters</title>
		<link>http://www.staticmethod.net/2009/05/03/bloom-filters/</link>
		<comments>http://www.staticmethod.net/2009/05/03/bloom-filters/#comments</comments>
		<pubDate>Mon, 04 May 2009 01:48:20 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Programming Problems]]></category>
		<category><![CDATA[bloom filter]]></category>
		<category><![CDATA[data structures]]></category>

		<guid isPermaLink="false">http://www.staticmethod.net/?p=34</guid>
		<description><![CDATA[Bloom filters are a mechanism for &#8220;indexing&#8221; a set and quickly determining whether or not a given element is part of the set that the Bloom Filter represents.  You do not actually store items in a bloom filter, the bloom filter itself is simply an array of bits.  The (very) basic idea is that for [...]]]></description>
			<content:encoded><![CDATA[<p>Bloom filters are a mechanism for &#8220;indexing&#8221; a set and quickly determining whether or not a given element is part of the set that the Bloom Filter represents.  You do not actually store items in a bloom filter, the bloom filter itself is simply an array of bits.  The (very) basic idea is that for every element <em>i</em> in the set, you generate a series of array indexes (usually via some hashing method), and then set those positions in your bit array to 1.</p>
<p>For example, for the input <em>&#8220;foo&#8221;</em> you could generate the indices 1, 4 and 6.  Then in your (fixed size) array, you set positions 1, 4 and 6 to &#8220;1&#8243;.     For the input <em>&#8220;bar&#8221;</em> you generate the indices 1, 4, and 8, and set those positions to &#8220;1&#8243;.  When you want to find out if an input is in the set, you generate the index values (via your hashing method) and check if those positions are set to 1 in the array.  If all of them are, the input was likely in the set.  If one or more of the indices were not set to 1, then the input was definitely not in the set.  You can vary the number of index positions your hashing function provides and the size of your bit-array in order to reduce the number of false positives.</p>
<p>After your bit-array is built, representing your set, it becomes a constant time operation to check if something is in the set.  Insertion of new items into the Bloom Filter is also a constant time operation.  One major downside to Bloom Filters that I can see is that there isn&#8217;t a way to remove something from the bloom filter without causing false negatives.</p>
<p>The two articles I found useful in learning about Bloom Filters were:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Bloom_filter">Bloom Filter</a> &#8211; Wikipedia Bloom Filter Article</li>
<li><a href="http://www.coolsnap.net/kevin/?p=13">Article</a> at Cool/Snap? blog</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.staticmethod.net/2009/05/03/bloom-filters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Summations / Sigma Notation</title>
		<link>http://www.staticmethod.net/2009/05/01/summations-sigma-notation/</link>
		<comments>http://www.staticmethod.net/2009/05/01/summations-sigma-notation/#comments</comments>
		<pubDate>Fri, 01 May 2009 18:10:38 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[summation]]></category>

		<guid isPermaLink="false">http://www.staticmethod.net/?p=17</guid>
		<description><![CDATA[A few years ago I had a job interview with a company that ended up being pretty math focussed.  I had been out of college for a while at the time, and on a day to day basis in doing software development I hadn&#8217;t had the opportunity to exercise a lot of the math [...]]]></description>
			<content:encoded><![CDATA[<p>A few years ago I had a job interview with a company that ended up being pretty math focussed.  I had been out of college for a while at the time, and on a day to day basis in doing software development I hadn&#8217;t had the opportunity to exercise a lot of the math that I had learned while in college.  At some point in my life I had taken: Calc, Calc II, Linear Algebra, Discrete Math, and some others&#8230;but because I haven&#8217;t been using it, my math knowledge had kind of gone down the tubes.</p>
<p>So when I was asked a question about summations, I was kind of stumped.  Now that I&#8217;ve started reading a algorithms text book, I&#8217;m running into summations all over again.  In my search to re-learn them, I&#8217;ve found the following sites useful:</p>
<ul>
<li> <a href="http://tutorial.math.lamar.edu/Classes/CalcI/SummationNotation.aspx">Paul&#8217;s Online Math Notes</a> &#8211; Prof. Paul Dawkins, of Lamar University, has a great math site, and has a good, short, re-introduction to summations here.</li>
<li><a href="http://planetmath.org/?method=l2h&amp;from=objects&amp;id=6361&amp;op=getobj">PlanetMath&#8217;s Summation Page</a> &#8211; PlanetMath has a good page on summations that goes a little more into detail on some summation properties and useful formulas</li>
<li><a href="http://polysum.tripod.com/">Summation Formulas</a> &#8211; Good outline of summation formulas</li>
</ul>
<p>What I haven&#8217;t been able to find is a page explaining how the solutions for common summations is found, such as the one for a simple summation:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Csum_%7Bi%3D1%7D%5E%7Bn%7D%20x_%7Bi%7D%20%3D%20%5Cdfrac%7Bn%20%28n%20%2B%201%29%7D%20%7B2%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\sum_{i=1}^{n} x_{i} = \dfrac{n (n + 1)} {2}' title='\sum_{i=1}^{n} x_{i} = \dfrac{n (n + 1)} {2}' class='latex' /></p>
<p><span style="text-decoration: line-through;">I&#8217;m not sure how that formula is reached, but I&#8217;m sure I&#8217;ll be trying to figure it out soon.</span></p>
<p><strong>Update:</strong> Finally found a good description of the steps in solving the summation above, here&#8217;s my attempt at explaining it:</p>
<p><span id="more-17"></span></p>
<p>The simple summation above can be thought of as the series:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=1%2B2%2B3%2B%5Ccdots%2Bn&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='1+2+3+\cdots+n' title='1+2+3+\cdots+n' class='latex' /></p>
<p style="text-align: left;">It can also be thought of (in reverse) as:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=n%2B%28n-1%29%2B%28n-2%29%2B%5Ccdots%2B1&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='n+(n-1)+(n-2)+\cdots+1' title='n+(n-1)+(n-2)+\cdots+1' class='latex' /></p>
<p style="text-align: left;">Now, imagine writing each of the terms of those two series above eachother, then adding the ones that are above and below eachother.  You would end up with something like:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%281%2Bn%29%2B%282%2Bn-1%29%2B%283%2Bn-2%29%2B%5Ccdots%2B%28n%2B1%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='(1+n)+(2+n-1)+(3+n-2)+\cdots+(n+1)' title='(1+n)+(2+n-1)+(3+n-2)+\cdots+(n+1)' class='latex' /></p>
<p style="text-align: left;">This can be simplified by doing the math inside the parens to:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%28n%2B1%29%2B%28n%2B1%29%2B%28n%2B1%29%2B%5Ccdots%2B%28n%2B1%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='(n+1)+(n+1)+(n+1)+\cdots+(n+1)' title='(n+1)+(n+1)+(n+1)+\cdots+(n+1)' class='latex' /></p>
<p style="text-align: left;">Which is simplified even further to:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=n%28n%2B1%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='n(n+1)' title='n(n+1)' class='latex' /></p>
<p style="text-align: left;">At this point, you&#8217;ve basically described adding the summation twice, or</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=2%28%5Csum_%7Bi%3D1%7D%5E%7Bn%7D%20x_%7Bi%7D%29%20%3D%20n%28n%2B1%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='2(\sum_{i=1}^{n} x_{i}) = n(n+1)' title='2(\sum_{i=1}^{n} x_{i}) = n(n+1)' class='latex' /></p>
<p style="text-align: left;">Divide each side by two, and you&#8217;ve got the solution we were looking for:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Csum_%7Bi%3D1%7D%5E%7Bn%7D%20x_%7Bi%7D%20%3D%20%5Cdfrac%7Bn%20%28n%20%2B%201%29%7D%20%7B2%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\sum_{i=1}^{n} x_{i} = \dfrac{n (n + 1)} {2}' title='\sum_{i=1}^{n} x_{i} = \dfrac{n (n + 1)} {2}' class='latex' /></p>
<p style="text-align: left;">I finally found this explanation at the <a href="http://mathrefresher.blogspot.com/2006/09/summation-formula.html">Math Refresher</a> weblog.  The article I linked to goes into a lot more detail, so I would suggest reading it if you want to know more.  I tried, but my eyes are getting tired from math at ths point in time, and his equation representations are a little hard to read.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.staticmethod.net/2009/05/01/summations-sigma-notation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Byzantine Generals</title>
		<link>http://www.staticmethod.net/2009/04/30/byzantine-generals/</link>
		<comments>http://www.staticmethod.net/2009/04/30/byzantine-generals/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 17:03:23 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Theory]]></category>
		<category><![CDATA[byzantine generals]]></category>
		<category><![CDATA[fault tolerance]]></category>

		<guid isPermaLink="false">http://www.staticmethod.net/?p=15</guid>
		<description><![CDATA[Article on the &#8220;Papers in Computer Science&#8221; blog about the Byzantine Generals problem.  I like the summary on the blog of the problem, but I found the referenced paper a little hard to read at first, might just need to spend more time with it.
The Byzantine Generals problem is an exercise in fault tolerance [...]]]></description>
			<content:encoded><![CDATA[<p>Article on the &#8220;Papers in Computer Science&#8221; blog about the Byzantine Generals problem.  I like the summary on the blog of the problem, but I found the referenced paper a little hard to read at first, might just need to spend more time with it.</p>
<p>The Byzantine Generals problem is an exercise in fault tolerance and dealing with conflicting or even malicious behavior/messages in a distributed system. </p>
<p><a href="http://papersincomputerscience.org/2009/04/01/the-byzantine-generals-problem/">Here&#8217;s the article</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.staticmethod.net/2009/04/30/byzantine-generals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google&#8217;s BigTable</title>
		<link>http://www.staticmethod.net/2009/04/30/googles-bigtable/</link>
		<comments>http://www.staticmethod.net/2009/04/30/googles-bigtable/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 14:13:38 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[bigtable]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[whitepaper]]></category>

		<guid isPermaLink="false">http://www.staticmethod.net/?p=12</guid>
		<description><![CDATA[Google&#8217;s BigTable is (was?) their approach to storing and accessing petabytes of data in a decentralized and highly-available way.  At the most basic level it&#8217;s a properties system of keys and values, but goes way beyond that.  It also provides mechanisms for spreading the data across thousands of machines while giving programmers an [...]]]></description>
			<content:encoded><![CDATA[<p>Google&#8217;s BigTable is (was?) their approach to storing and accessing petabytes of data in a decentralized and highly-available way.  At the most basic level it&#8217;s a properties system of keys and values, but goes way beyond that.  It also provides mechanisms for spreading the data across thousands of machines while giving programmers an easy API for editing and reading data from the tables.  Here&#8217;s their description of it:</p>
<blockquote><p>
Bigtable is a distributed storage system for managing structured data that is designed to scale to a very large size: petabytes of data across thousands of commodity servers. Many projects at Google store data in Bigtable, including web indexing, Google Earth, and Google Finance. These applications place very different demands on Bigtable, both in terms of data size (from URLs to web pages to satellite imagery) and latency requirements (from backend bulk processing to real-time data serving). Despite these varied demands, Bigtable has successfully provided a flexible, high-performance solution for all of these Google products. In this paper we describe the simple data model provided by Bigtable, which gives clients dynamic control over data layout and format, and we describe the design and implementation of Bigtable.
</p></blockquote>
<p>The paper isn&#8217;t too long (14 pages or so) and isn&#8217;t too hard to digest.  You can read it <a href="http://labs.google.com/papers/bigtable.html">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.staticmethod.net/2009/04/30/googles-bigtable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
