<?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>No Layman Left Behind</title>
	<atom:link href="http://nolaymanleftbehind.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nolaymanleftbehind.wordpress.com</link>
	<description></description>
	<lastBuildDate>Wed, 05 Jun 2013 03:34:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nolaymanleftbehind.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>No Layman Left Behind</title>
		<link>http://nolaymanleftbehind.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nolaymanleftbehind.wordpress.com/osd.xml" title="No Layman Left Behind" />
	<atom:link rel='hub' href='http://nolaymanleftbehind.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Mathematical Induction</title>
		<link>http://nolaymanleftbehind.wordpress.com/2011/07/18/mathematical-induction/</link>
		<comments>http://nolaymanleftbehind.wordpress.com/2011/07/18/mathematical-induction/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 05:34:16 +0000</pubDate>
		<dc:creator>Alan Guo</dc:creator>
				<category><![CDATA[Mathematics]]></category>

		<guid isPermaLink="false">http://nolaymanleftbehind.wordpress.com/?p=197</guid>
		<description><![CDATA[The principle of mathematical induction is a simple but powerful technique for proving mathematical results. In its most basic form, it says the following: If something&#8217;s true for an integer , and if it being true for the number implies it is true for the number , then it is true for all integers . This [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=197&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The principle of <strong>mathematical induction</strong> is a simple but powerful technique for proving mathematical results. In its most basic form, it says the following:</p>
<blockquote><p>If something&#8217;s true for an integer <img src='http://s0.wp.com/latex.php?latex=n_0&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n_0' title='n_0' class='latex' />, and if it being true for the number <img src='http://s0.wp.com/latex.php?latex=k&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='k' title='k' class='latex' /> implies it is true for the number <img src='http://s0.wp.com/latex.php?latex=k%2B1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='k+1' title='k+1' class='latex' />, then it is true for all integers <img src='http://s0.wp.com/latex.php?latex=n+%5Cge+n_0&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n &#92;ge n_0' title='n &#92;ge n_0' class='latex' />.</p></blockquote>
<p>This is a more-or-less &#8220;obvious&#8221; statement. It has two components: the <strong>base case</strong> and the <strong>inductive step</strong>. The base case establishes truth for one number. The inductive step does not actually establish truth of the statement for any particular value. Instead, it establishes the truth of a logical implication. In formal terms, the above box reads:</p>
<blockquote><p>If <img src='http://s0.wp.com/latex.php?latex=P%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='P(n)' title='P(n)' class='latex' /> is a proposition for the integer <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n' title='n' class='latex' />, then if <img src='http://s0.wp.com/latex.php?latex=P%28n_0%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='P(n_0)' title='P(n_0)' class='latex' /> is true and <img src='http://s0.wp.com/latex.php?latex=P%28k%29+%5CRightarrow+P%28k%2B1%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='P(k) &#92;Rightarrow P(k+1)' title='P(k) &#92;Rightarrow P(k+1)' class='latex' />, then <img src='http://s0.wp.com/latex.php?latex=P%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='P(n)' title='P(n)' class='latex' /> is true for all integers <img src='http://s0.wp.com/latex.php?latex=n+%5Cge+n_0&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n &#92;ge n_0' title='n &#92;ge n_0' class='latex' />.</p></blockquote>
<p>Think of induction as a string of dominos. Establishing the base case is like knocking down the first domino. Establishing the inductive step is like setting up the dominos so that if the <img src='http://s0.wp.com/latex.php?latex=k&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='k' title='k' class='latex' />-th domino falls, it knocks over the <img src='http://s0.wp.com/latex.php?latex=%28k%2B1%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='(k+1)' title='(k+1)' class='latex' />-th domino. Thinking of it this way, it should be obvious that once these two things are established, then all the dominos will fall. This is one of the concepts that is best learned through examples.</p>
<p><span id="more-197"></span></p>
<p>Let&#8217;s prove a basic result using induction. We will prove that <img src='http://s0.wp.com/latex.php?latex=1+%2B+2+%2B+3+%2B+%5Ccdots+%2B+n+%3D+n%28n%2B1%29%2F2&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='1 + 2 + 3 + &#92;cdots + n = n(n+1)/2' title='1 + 2 + 3 + &#92;cdots + n = n(n+1)/2' class='latex' />. We begin with the base case. Is it true for <img src='http://s0.wp.com/latex.php?latex=n%3D+1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n= 1' title='n= 1' class='latex' />? Yes, because the left-hand side is <img src='http://s0.wp.com/latex.php?latex=1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='1' title='1' class='latex' /> and the right-hand side is <img src='http://s0.wp.com/latex.php?latex=1%281%2B1%29%2F2+%3D+2%2F2+%3D+1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='1(1+1)/2 = 2/2 = 1' title='1(1+1)/2 = 2/2 = 1' class='latex' />. Now we establish the induction step. If it&#8217;s true for <img src='http://s0.wp.com/latex.php?latex=n%3Dk&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n=k' title='n=k' class='latex' />, is it then true for <img src='http://s0.wp.com/latex.php?latex=n%3Dk%2B1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n=k+1' title='n=k+1' class='latex' />? Let&#8217;s see. We begin with <img src='http://s0.wp.com/latex.php?latex=1+%2B+2+%2B+3+%2B+%5Ccdots+%2B+k+%2B+%28k%2B1%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='1 + 2 + 3 + &#92;cdots + k + (k+1)' title='1 + 2 + 3 + &#92;cdots + k + (k+1)' class='latex' />. Since we are assuming that it&#8217;s true for <img src='http://s0.wp.com/latex.php?latex=n+%3D+k&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n = k' title='n = k' class='latex' />, we can rewrite the first <img src='http://s0.wp.com/latex.php?latex=k&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='k' title='k' class='latex' /> terms as <img src='http://s0.wp.com/latex.php?latex=1+%2B+2+%2B+3+%2B+%5Ccdots+%2B+k+%3D+k%28k%2B1%29%2F2&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='1 + 2 + 3 + &#92;cdots + k = k(k+1)/2' title='1 + 2 + 3 + &#92;cdots + k = k(k+1)/2' class='latex' />. Then our sum becomes</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Cdisplaystyle+1+%2B+2+%2B+3+%2B+%5Ccdots+%2B+k+%2B+%28k%2B1%29+%3D+%5Cfrac%7Bk%28k%2B1%29%7D%7B2%7D+%2B+%28k%2B1%29+%5C%5C+%3D+%28k%2B1%29%5Cleft%28+%5Cfrac%7Bk%7D%7B2%7D+%2B+1+%5Cright%29+%5C%5C+%3D+%5Cfrac%7B%28k%2B1%29%28k%2B2%29%7D%7B2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;displaystyle 1 + 2 + 3 + &#92;cdots + k + (k+1) = &#92;frac{k(k+1)}{2} + (k+1) &#92;&#92; = (k+1)&#92;left( &#92;frac{k}{2} + 1 &#92;right) &#92;&#92; = &#92;frac{(k+1)(k+2)}{2}' title='&#92;displaystyle 1 + 2 + 3 + &#92;cdots + k + (k+1) = &#92;frac{k(k+1)}{2} + (k+1) &#92;&#92; = (k+1)&#92;left( &#92;frac{k}{2} + 1 &#92;right) &#92;&#92; = &#92;frac{(k+1)(k+2)}{2}' class='latex' /></p>
<p>which is the formula we wanted for <img src='http://s0.wp.com/latex.php?latex=k%2B1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='k+1' title='k+1' class='latex' />, so the formula is true for all positive integers <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n' title='n' class='latex' />. Let&#8217;s go over why this works again. We showed the formula is correct when <img src='http://s0.wp.com/latex.php?latex=n+%3D+1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n = 1' title='n = 1' class='latex' />. We then showed that if the formula is correct when <img src='http://s0.wp.com/latex.php?latex=n+%3D+k&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n = k' title='n = k' class='latex' />, then it is also correct when <img src='http://s0.wp.com/latex.php?latex=n+%3D+k%2B1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n = k+1' title='n = k+1' class='latex' />. Why does this mean the formula is correct for any <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n' title='n' class='latex' />? Well, it&#8217;s correct for <img src='http://s0.wp.com/latex.php?latex=n+%3D+1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n = 1' title='n = 1' class='latex' />. By the inductive step, since it&#8217;s correct for <img src='http://s0.wp.com/latex.php?latex=n+%3D+1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n = 1' title='n = 1' class='latex' />, it&#8217;s also correct for <img src='http://s0.wp.com/latex.php?latex=n+%3D+1+%2B+1+%3D+2&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n = 1 + 1 = 2' title='n = 1 + 1 = 2' class='latex' />. By the inductive step again, since it&#8217;s correct for <img src='http://s0.wp.com/latex.php?latex=n+%3D+2&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n = 2' title='n = 2' class='latex' />, it&#8217;s also correct for <img src='http://s0.wp.com/latex.php?latex=n+%3D+2+%2B+1+%3D+3&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n = 2 + 1 = 3' title='n = 2 + 1 = 3' class='latex' />, and so on.</p>
<p>Now we&#8217;ll prove a more interesting result using induction. Consider the question: how many subsets (including the empty set) of <img src='http://s0.wp.com/latex.php?latex=%5C%7B1%2C+2%2C+3%2C+%5Cldots%2C+n%5C%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;{1, 2, 3, &#92;ldots, n&#92;}' title='&#92;{1, 2, 3, &#92;ldots, n&#92;}' class='latex' /> are there that contain no consecutive integers? For problems like these, it&#8217;s always nice to look for a pattern first, in case the formula for the answer is nice. For <img src='http://s0.wp.com/latex.php?latex=%5C%7B1%5C%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;{1&#92;}' title='&#92;{1&#92;}' class='latex' />, both the empty subset and the entire set work, so the answer is 2. For <img src='http://s0.wp.com/latex.php?latex=%5C%7B1%2C2%5C%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;{1,2&#92;}' title='&#92;{1,2&#92;}' class='latex' />, the subsets <img src='http://s0.wp.com/latex.php?latex=%5Cvarnothing%2C+%5C%7B1%5C%7D%2C+%5C%7B2%5C%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;varnothing, &#92;{1&#92;}, &#92;{2&#92;}' title='&#92;varnothing, &#92;{1&#92;}, &#92;{2&#92;}' class='latex' /> all work, so the answer is 3. For <img src='http://s0.wp.com/latex.php?latex=%5C%7B1%2C2%2C3%5C%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;{1,2,3&#92;}' title='&#92;{1,2,3&#92;}' class='latex' />, the subsets <img src='http://s0.wp.com/latex.php?latex=%5Cvarnothing%2C+%5C%7B1%5C%7D%2C+%5C%7B2%5C%7D%2C+%5C%7B3%5C%7D%2C+%5C%7B1%2C3%5C%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;varnothing, &#92;{1&#92;}, &#92;{2&#92;}, &#92;{3&#92;}, &#92;{1,3&#92;}' title='&#92;varnothing, &#92;{1&#92;}, &#92;{2&#92;}, &#92;{3&#92;}, &#92;{1,3&#92;}' class='latex' /> work, so the answer is 5. Continuing in this way, we&#8217;ll see that the answer for the first few values of <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n' title='n' class='latex' /> are <img src='http://s0.wp.com/latex.php?latex=2%2C3%2C5%2C8%2C13%2C%5Cldots&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='2,3,5,8,13,&#92;ldots' title='2,3,5,8,13,&#92;ldots' class='latex' />. These look like the <a href="http://nolaymanleftbehind.wordpress.com/2011/07/10/combinatorics-power-of-generating-functions/">Fibonacci numbers</a>! We know that the Fibonacci numbers <img src='http://s0.wp.com/latex.php?latex=F_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_n' title='F_n' class='latex' /> are defined by a recurrence relation <img src='http://s0.wp.com/latex.php?latex=F_n+%3D+F_%7Bn-1%7D+%2B+F_%7Bn-2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_n = F_{n-1} + F_{n-2}' title='F_n = F_{n-1} + F_{n-2}' class='latex' />, so maybe the answer we&#8217;re looking for also satisfies this recurrence. That is, we <strong>conjecture</strong> (or guess) that <img src='http://s0.wp.com/latex.php?latex=T_n+%3D+F_%7Bn%2B2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='T_n = F_{n+2}' title='T_n = F_{n+2}' class='latex' />, where <img src='http://s0.wp.com/latex.php?latex=T_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='T_n' title='T_n' class='latex' /> is the answer we&#8217;re looking for and <img src='http://s0.wp.com/latex.php?latex=F_1+%3D+F_2+%3D+1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_1 = F_2 = 1' title='F_1 = F_2 = 1' class='latex' />.</p>
<p>To prove our conjecture, we can use induction, so we just need to show that <img src='http://s0.wp.com/latex.php?latex=T_1+%3D+F_3&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='T_1 = F_3' title='T_1 = F_3' class='latex' />, <img src='http://s0.wp.com/latex.php?latex=T_2+%3D+F_4+&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='T_2 = F_4 ' title='T_2 = F_4 ' class='latex' />, and <img src='http://s0.wp.com/latex.php?latex=T_n+%3D+T_%7Bn-1%7D+%2B+T_%7Bn-2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='T_n = T_{n-1} + T_{n-2}' title='T_n = T_{n-1} + T_{n-2}' class='latex' />. As an exercise, convince yourself why this is enough to answer our original question. The base cases we just did: <img src='http://s0.wp.com/latex.php?latex=T_1+%3D+2+%3D+F_3&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='T_1 = 2 = F_3' title='T_1 = 2 = F_3' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=T_2+%3D+3+%3D+F_4&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='T_2 = 3 = F_4' title='T_2 = 3 = F_4' class='latex' />. Now, let&#8217;s establish the relation <img src='http://s0.wp.com/latex.php?latex=T_n+%3D+T_%7Bn-1%7D+%2B+T_%7Bn-2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='T_n = T_{n-1} + T_{n-2}' title='T_n = T_{n-1} + T_{n-2}' class='latex' />. Let&#8217;s call a set &#8220;happy&#8221; if it contains no consecutive integers (so our original question is to find the number of happy subsets of <img src='http://s0.wp.com/latex.php?latex=%5C%7B1%2C2%2C3%2C%5Cldots%2Cn%5C%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;{1,2,3,&#92;ldots,n&#92;}' title='&#92;{1,2,3,&#92;ldots,n&#92;}' class='latex' />). Suppose we have a happy subset <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='S' title='S' class='latex' /> of <img src='http://s0.wp.com/latex.php?latex=%5C%7B1%2C2%2C3%2C%5Cldots%2Cn%5C%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;{1,2,3,&#92;ldots,n&#92;}' title='&#92;{1,2,3,&#92;ldots,n&#92;}' class='latex' />. What do we know about <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='S' title='S' class='latex' />? Well, it either contains the number <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n' title='n' class='latex' /> or it doesn&#8217;t. If it doesn&#8217;t, then it&#8217;s just a happy subset of <img src='http://s0.wp.com/latex.php?latex=%5C%7B1%2C2%2C3%2C%5Cldots%2Cn-1%5C%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;{1,2,3,&#92;ldots,n-1&#92;}' title='&#92;{1,2,3,&#92;ldots,n-1&#92;}' class='latex' />, and we know there are <img src='http://s0.wp.com/latex.php?latex=T_%7Bn-1%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='T_{n-1}' title='T_{n-1}' class='latex' /> of those. If <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='S' title='S' class='latex' /> does contain <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n' title='n' class='latex' />, then it can&#8217;t contain <img src='http://s0.wp.com/latex.php?latex=n-1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n-1' title='n-1' class='latex' /> or else it wouldn&#8217;t be happy. Then, if we ignore <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n' title='n' class='latex' />, then the rest of <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='S' title='S' class='latex' /> is a happy subset of <img src='http://s0.wp.com/latex.php?latex=%5C%7B1%2C2%2C3%2C%5Cldots%2Cn-2%5C%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;{1,2,3,&#92;ldots,n-2&#92;}' title='&#92;{1,2,3,&#92;ldots,n-2&#92;}' class='latex' />, of which we know there are <img src='http://s0.wp.com/latex.php?latex=T_%7Bn-2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='T_{n-2}' title='T_{n-2}' class='latex' />. Therefore, <img src='http://s0.wp.com/latex.php?latex=T_n+%3D+T_%7Bn-1%7D+%2B+T_%7Bn-2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='T_n = T_{n-1} + T_{n-2}' title='T_n = T_{n-1} + T_{n-2}' class='latex' /> and we are done!</p>
<p>To recap, you should have learned the following from this post:</p>
<ul>
<li>What the principle of mathematical induction is and how it works</li>
<li>How to use induction to prove mathematical statements</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nolaymanleftbehind.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nolaymanleftbehind.wordpress.com/197/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=197&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nolaymanleftbehind.wordpress.com/2011/07/18/mathematical-induction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0342b25cba1b6d106701db092ab3ec56?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aguo777</media:title>
		</media:content>
	</item>
		<item>
		<title>Intro Post: Chris</title>
		<link>http://nolaymanleftbehind.wordpress.com/2011/07/18/intro-post-chris/</link>
		<comments>http://nolaymanleftbehind.wordpress.com/2011/07/18/intro-post-chris/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 20:47:49 +0000</pubDate>
		<dc:creator>musicman3320</dc:creator>
				<category><![CDATA[Authors]]></category>

		<guid isPermaLink="false">http://nolaymanleftbehind.wordpress.com/?p=190</guid>
		<description><![CDATA[Hi everyone, my name is Chris.  I graduated from San Francisco State University with a double major in Math and Computer Science, and I am currently a Ph.D student in the Duke Mathematics department.  I am most interested in studying Algebra and Combinatorics, but I have always enjoyed programming as a hobby, and I spend [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=190&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi everyone, my name is Chris.  I graduated from San Francisco State University with a double major in Math and Computer Science, and I am currently a Ph.D student in the Duke Mathematics department.  I am most interested in studying Algebra and Combinatorics, but I have always enjoyed programming as a hobby, and I spend much of my free time doing various programming projects.</p>
<p>I look forward to contributing programming articles to this blog, as well as occasional math related topics.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nolaymanleftbehind.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nolaymanleftbehind.wordpress.com/190/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=190&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nolaymanleftbehind.wordpress.com/2011/07/18/intro-post-chris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/4064b9c387e581700aa36f1c669170e3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">musicman3320</media:title>
		</media:content>
	</item>
		<item>
		<title>The difference between &#8220;impossible&#8221; and &#8220;zero probability&#8221;</title>
		<link>http://nolaymanleftbehind.wordpress.com/2011/07/13/the-difference-between-impossible-and-zero-probability/</link>
		<comments>http://nolaymanleftbehind.wordpress.com/2011/07/13/the-difference-between-impossible-and-zero-probability/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 23:08:40 +0000</pubDate>
		<dc:creator>Alan Guo</dc:creator>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Probability]]></category>

		<guid isPermaLink="false">http://nolaymanleftbehind.wordpress.com/?p=186</guid>
		<description><![CDATA[Consider the following game: I write down a random real number between 0 and 1, and ask you to guess it. What&#8217;s the probability that you guess it correctly? The answer is zero. You might wonder: &#8220;But it&#8217;s possible for me to guess the correct answer! That means that the probability has to be more than [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=186&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Consider the following game: I write down a random real number between 0 and 1, and ask you to guess it. What&#8217;s the probability that you guess it correctly? The answer is zero. You might wonder: &#8220;But it&#8217;s <em>possible</em> for me to guess the correct answer! That means that the probability has to be more than zero!&#8221; and you would be justified in wondering, but you&#8217;d be wrong. It&#8217;s true that events that are impossible have zero probability, but the converse is not true in general. In the rest of this post, we show why the answer above was in fact zero, and why this doesn&#8217;t need to do irreparable damage to your current worldview.</p>
<p><span id="more-186"></span></p>
<p>Let&#8217;s begin by showing that the probability that you guess my number right is zero. Let <img src='http://s0.wp.com/latex.php?latex=p&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='p' title='p' class='latex' /> be the probability in question. The idea is to show that <img src='http://s0.wp.com/latex.php?latex=p+%5Cle+r&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='p &#92;le r' title='p &#92;le r' class='latex' /> for any positive real number <img src='http://s0.wp.com/latex.php?latex=r&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='r' title='r' class='latex' />. We know that <img src='http://s0.wp.com/latex.php?latex=p+%5Cge+0&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='p &#92;ge 0' title='p &#92;ge 0' class='latex' />, and if it&#8217;s smaller than ANY positive number, then it has to be zero! The argument is as follows. Let&#8217;s call the number I randomly picked <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='x' title='x' class='latex' />. Imagine that the interval <img src='http://s0.wp.com/latex.php?latex=%5B0%2C1%5D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='[0,1]' title='[0,1]' class='latex' /> is painted white. Pick any positive real number <img src='http://s0.wp.com/latex.php?latex=r+%5Cle+1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='r &#92;le 1' title='r &#92;le 1' class='latex' />. Then there is an sub-interval of length <img src='http://s0.wp.com/latex.php?latex=r&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='r' title='r' class='latex' /> within the interval <img src='http://s0.wp.com/latex.php?latex=%5B0%2C1%5D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='[0,1]' title='[0,1]' class='latex' /> containing <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='x' title='x' class='latex' />. Imagine that this sub-interval is painted black, so now we have a black strip of length <img src='http://s0.wp.com/latex.php?latex=r&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='r' title='r' class='latex' /> on the original white strip, and the number I chose was in the black strip. What&#8217;s the probability that your guess lands on the black strip? It has to be <img src='http://s0.wp.com/latex.php?latex=r&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='r' title='r' class='latex' />, since that&#8217;s the proportion of the white strip that is covered. But in order for your guess to equal my number <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='x' title='x' class='latex' />, it has to land in the black strip, so your probability <img src='http://s0.wp.com/latex.php?latex=p&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='p' title='p' class='latex' /> of guessing <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='x' title='x' class='latex' /> can&#8217;t be larger than the probability of guessing a number on the black strip! Therefore <img src='http://s0.wp.com/latex.php?latex=p+%5Cle+r&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='p &#92;le r' title='p &#92;le r' class='latex' />.</p>
<p>You should now be convinced that this event indeed has zero probability of happening, but it&#8217;s still true. This phenomenon is because of the following geometric fact: <strong>it&#8217;s possible to have a non-empty set with zero &#8220;volume&#8221;.</strong> The term &#8220;volume&#8221; depends on the context; in the case of the point on the interval, &#8220;volume&#8221; is length. The probability of an event measured on the interval <img src='http://s0.wp.com/latex.php?latex=%5B0%2C1%5D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='[0,1]' title='[0,1]' class='latex' /> is equal to its length, and a single point on the interval has zero length, yet it&#8217;s still a non-empty subset of the interval! Probability is basically a measure of &#8220;volume&#8221; where the entire space has &#8220;volume&#8221; equal to 1. By defining probability in this way, we can prove all kinds of neat facts using something called <strong>measure theory</strong>.</p>
<p>To recap, you should have learned the following from this post:</p>
<ul>
<li>The probability of randomly choosing a specific number in the interval <img src='http://s0.wp.com/latex.php?latex=%5B0%2C1%5D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='[0,1]' title='[0,1]' class='latex' /> is equal to zero</li>
<li>Events that have zero probability are still possible</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nolaymanleftbehind.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nolaymanleftbehind.wordpress.com/186/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=186&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nolaymanleftbehind.wordpress.com/2011/07/13/the-difference-between-impossible-and-zero-probability/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0342b25cba1b6d106701db092ab3ec56?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aguo777</media:title>
		</media:content>
	</item>
		<item>
		<title>Concrete Nonsense</title>
		<link>http://nolaymanleftbehind.wordpress.com/2011/07/12/concrete-nonsense/</link>
		<comments>http://nolaymanleftbehind.wordpress.com/2011/07/12/concrete-nonsense/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 08:01:57 +0000</pubDate>
		<dc:creator>Alan Guo</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://nolaymanleftbehind.wordpress.com/?p=184</guid>
		<description><![CDATA[Hi all! If you&#8217;re really interested in math and science and feel like digging a little deeper, there are various blogs out there maintained by college students, grad students and professors on technical subjects. Most recently, I joined a group blog called Concrete Nonsense, which is maintained by grad students and focuses primarily on math. [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=184&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi all! If you&#8217;re really interested in math and science and feel like digging a little deeper, there are various blogs out there maintained by college students, grad students and professors on technical subjects. Most recently, I joined a group blog called <a href="http://concretenonsense.wordpress.com">Concrete Nonsense</a>, which is maintained by grad students and focuses primarily on math. My contribution (hopefully) to the blog will be posts connecting mathematics and computer science by discussing topics in algorithms, complexity theory, artificial intelligence, and quantum computing. The posts on there are considerably more technical and precise. A lot of topics that I find really interesting but feel are too advanced for this blog I will end up posting about on there, until I figure out how to explain them without using too much technical jargon.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nolaymanleftbehind.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nolaymanleftbehind.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=184&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nolaymanleftbehind.wordpress.com/2011/07/12/concrete-nonsense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0342b25cba1b6d106701db092ab3ec56?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aguo777</media:title>
		</media:content>
	</item>
		<item>
		<title>Error correcting codes: Why your texts don&#8217;t end up as gibberish</title>
		<link>http://nolaymanleftbehind.wordpress.com/2011/07/11/error-correcting-codes-why-your-texts-dont-end-up-as-gibberish/</link>
		<comments>http://nolaymanleftbehind.wordpress.com/2011/07/11/error-correcting-codes-why-your-texts-dont-end-up-as-gibberish/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 07:40:58 +0000</pubDate>
		<dc:creator>Alan Guo</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Theory]]></category>

		<guid isPermaLink="false">http://nolaymanleftbehind.wordpress.com/?p=178</guid>
		<description><![CDATA[Digital information is transfered in the form of electric currents through wires that may contain impurities that alter the currents, or electromagnetic waves through space with ambient radiation that alter the waves, yet digital information is so dependent on precision. Unlike analog information, digital information gets ruined when there is any noise involved. For example, [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=178&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Digital information is transfered in the form of electric currents through wires that may contain impurities that alter the currents, or electromagnetic waves through space with ambient radiation that alter the waves, yet digital information is so dependent on precision. Unlike analog information, digital information gets ruined when there is any noise involved. For example, say I shouted &#8220;Hello!&#8221; to you from far away during a windy day. The sound waves in the air constitute analog information, but the wind along the way can alter the waves and therefore perturb the information. You might hear something distorted but it would probably still resemble the original &#8220;Hello!&#8221; message. Now suppose I sent the text message &#8220;Hello!&#8221; to you via instant messaging. In decimal, the ASCII string &#8220;Hello!&#8221; (excluding the quotation marks) is 072 101 108 108 111 033, which is actually sent in bytes (blocks of 8 bits) in binary as 01001000 01100101 01101100 01101100 01101111 00100001. Now, imagine if there was some noise (perhaps radiation) in the air which altered even one of the bits. Suppose in the byte containing the letter &#8220;o&#8221;, the bits changed from 01101111 to 00101111 (the first 1 was changed to a 0). Then the message received would be &#8220;Hell/!&#8221;, a completely different message! And that&#8217;s just from one altered bit! If billions of messages are transfered every day, shouldn&#8217;t there be an overwhelming number of confusing messages all the time? And that&#8217;s just the tip of the iceberg. The messages transmitted could be in machine language telling some server to do a specific thing, and an altered bit could change its actions entirely. How come our computer-controlled devices all work properly most of the time? Maybe the radiation in the air and the imperfections in the wires that we use to transmit digital information actually don&#8217;t molest the messages we send. This is not at all true. Instead, we use <strong>error correcting codes</strong> to ensure that our messages are received as intended.</p>
<p><span id="more-178"></span></p>
<p>There is no way to avoid having our digital messages altered on the way to their recipients. Instead, we use an idea which we use all the time when we want to make sure our vocal messages are heard properly. The idea is to add redundancy to the message so that the receiver can check if the received message was altered or not. This is called <strong>error detecting</strong>. If, in addition, the receiver can deduce what the intended message was supposed to be, then this is called <strong>error correcting</strong>.</p>
<p>For example, let&#8217;s say I was shouting to you from far away during a windy day. What if I fell into a river and was shouting &#8220;Help&#8221; but you heard this as &#8220;Hello&#8221;? That would be quite an unfortunate end for me. In order to ensure that you recognize when my message was altered, we could agree beforehand that all messages should be shouted twice in a row. Therefore, if you hear two consecutive messages that are different, you can conclude that my message was altered. Therefore, if I got in trouble, I would shout &#8220;Help! Help!&#8221; If there was wind interference, you might hear something like &#8220;Hello! Help!&#8221; You would know right away that my original message was altered, so you have <strong>detected</strong> an error. However, you still cannot correct it, because you don&#8217;t know which one was my intended message. In fact, both of them could have been altered! Maybe my original message was &#8220;Hell! Hell!&#8221; What if I wanted to shout &#8220;Help! Help!&#8221; but you heard it as &#8220;Hello! Hello!&#8221;? Well, in that case I would be doomed once again, so this protocol doesn&#8217;t work perfectly. However, note that the probability that both messages are altered in the exact same way is quite small. I can make that probability however small I want by making the number of repetitions large enough.</p>
<p>Now, let&#8217;s talk about the idea behind error correction. The idea behind error correction is actually used all the time by our brains subconsciously whenever we listen to people speak or read poorly typed comments on YouTube. The idea is so important it deserves a special box:</p>
<blockquote><p>Only a subset of all possible messages we see or hear make sense (or are <strong>valid</strong>), and so when we see or hear a message that doesn&#8217;t make sense, in our minds we replace it with <strong>the closest valid message</strong>.</p></blockquote>
<p>Now we give a digital example. Let&#8217;s say I want to send messages to you one bit at a time, so a sample message could be 0 or 1. An error correcting protocol could be to triple all my messages, so that my sample message would be sent as 000 or 111. Among the 8 possible binary strings of length 3 that you could possibly receive, only the two (000 and 111) are valid. Our protocol then therefore <strong>detect up to 2 errors</strong> in any given message. If there are three errors, then 000 would become 111 and vice versa, so we wouldn&#8217;t know if there was an error. However, if we receive a message like 011, we&#8217;ll know something went wrong. Furthermore, our protocol can <strong>correct up to 1 error</strong>. If there was only 1 error, then we know the message is whatever the majority bit is. If we get the message 001, then the original message had to have been 000 if there was only 1 error. To summarize, if there are 2 or fewer errors, our system can detect it. If there is 1 error, then our system can correct it.</p>
<p>It is enlightening to think about error correcting geometrically. We measure distance between strings by the number of bits in which they differ, so for example 010 and 001 have a distance of 2 because they differ in the 2nd and 3rd bits. This can be easily seen by viewing the 8 binary strings of length 3 as vertices of a cube, where the strings dictate the coordinates, so 000 corresponds to the point (0,0,0) and 011 corresponds to (0,1,1):</p>
<div class="wp-caption aligncenter" style="width: 200px"><img title="Hamming distance cube" src="http://upload.wikimedia.org/wikipedia/commons/b/b4/Hamming_distance_3_bit_binary.svg" alt="" width="190" height="150" /><p class="wp-caption-text">Possible messages as vertices of cube. Only 000 and 111 are valid messages.</p></div>
<p>The distance measure is called the <strong>Hamming distance</strong>, named after Richard Hamming. The distance can be easily seen as the smallest number of steps it takes to travel between two points by traveling along the edges of the cube. Note that our two valid messages are opposite vertices of the cube and that they are a distance of 3 apart. Therefore, as long as there is 1 error (meaning we&#8217;ve strayed from a valid message by a distance of 1), then it is clear what the original message is by choosing the <strong>nearest valid codeword</strong>. In this case, since the two valid messages are a distance of 3 apart, an invalid message can only be a distance of 1 away from exactly one of the valid messages. In technical lingo, the set {000, 111} of valid messages forms the <strong>code</strong>, the individual valid messages are <strong>codewords</strong>, and the <strong>distance</strong> of the code is the smallest distance between two points in the code. In this case, there are only two points in the code, and the distance of the code is 3. In general, if the distance of the code is <img src='http://s0.wp.com/latex.php?latex=d&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='d' title='d' class='latex' />, then the code can</p>
<ul>
<li>detect up to <img src='http://s0.wp.com/latex.php?latex=d-1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='d-1' title='d-1' class='latex' /> errors; this is because the shortest distance between two valid codewords is <img src='http://s0.wp.com/latex.php?latex=d&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='d' title='d' class='latex' />, and so traveling up to <img src='http://s0.wp.com/latex.php?latex=d-1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='d-1' title='d-1' class='latex' /> away from a valid codeword will land you on an invalid codeword, but traveling a distance <img src='http://s0.wp.com/latex.php?latex=d&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='d' title='d' class='latex' /> from a valid codeword <em>could</em> land you on another valid codeword</li>
<li>correct up to <img src='http://s0.wp.com/latex.php?latex=%5Cleft%5Clceil+%5Cfrac%7Bd%7D%7B2%7D+%5Cright%5Crceil+-+1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;left&#92;lceil &#92;frac{d}{2} &#92;right&#92;rceil - 1' title='&#92;left&#92;lceil &#92;frac{d}{2} &#92;right&#92;rceil - 1' class='latex' /> errors (where <img src='http://s0.wp.com/latex.php?latex=%5Cleft%5Clceil+%5Ccdot+%5Cright%5Crceil&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;left&#92;lceil &#92;cdot &#92;right&#92;rceil' title='&#92;left&#92;lceil &#92;cdot &#92;right&#92;rceil' class='latex' /> is the ceiling function which rounds up to the nearest integer) ; this is because if you travel up to <img src='http://s0.wp.com/latex.php?latex=%5Cleft%5Clceil+%5Cfrac%7Bd%7D%7B2%7D+%5Cright%5Crceil+-+1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;left&#92;lceil &#92;frac{d}{2} &#92;right&#92;rceil - 1' title='&#92;left&#92;lceil &#92;frac{d}{2} &#92;right&#92;rceil - 1' class='latex' /> away from a valid codeword, that codeword is still the nearest valid codeword, since the shortest distance between two valid codewords is <img src='http://s0.wp.com/latex.php?latex=d&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='d' title='d' class='latex' />, but traveling a distance <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7Bd%7D%7B2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;frac{d}{2}' title='&#92;frac{d}{2}' class='latex' /> from a valid codeword <em>could</em> land you on a midpoint between two valid codewords, in which case it is ambiguous which one is the nearest neighbor</li>
</ul>
<p>This also explains why I chose to triple instead of double my messages. Had I chosen to double my messages instead, then my code would be {00, 11} out of the set of possible words {00, 01, 10, 11}, and the distance of my code would be 2. By the conclusion above, this code can detect up to 0 errors; that is, it&#8217;s not even an error correcting code!</p>
<p>In future posts, we&#8217;ll look at more complicated error correcting codes. Instead, let&#8217;s take a look at ISBN, which is an error-detecting code in practice. The 13-ISBN is a 13-digit code for books which specify information about them, such as author, publisher, language, etc. When scanning the barcode, it&#8217;s possible that the scanner reads the code erroneously. Or if a person is entering an ISBN by hand, he might make a mistake. However, ISBN is designed so that the last digit is a <strong>check digit</strong>, that is, it&#8217;s determined by the previous 12 digits. In fact, given the first 12 digits <img src='http://s0.wp.com/latex.php?latex=d_1%2C+d_2%2C+%5Cldots%2C+d_%7B12%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='d_1, d_2, &#92;ldots, d_{12}' title='d_1, d_2, &#92;ldots, d_{12}' class='latex' />, the 13th digit is</p>
<p><img src='http://s0.wp.com/latex.php?latex=d_%7B13%7D+%3D+%5C%5C+10+-+%28d_1+%2B+3d_2+%2B+d_3+%2B+3d_4+%2B+d_5+%2B+3d_6+%2B+d_7+%2B+3d_8+%2B+d_9+%2B+3d_%7B10%7D+%2B+d_%7B11%7D+%2B+3d_%7B12%7D+%5Cpmod%7B10%7D%29.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='d_{13} = &#92;&#92; 10 - (d_1 + 3d_2 + d_3 + 3d_4 + d_5 + 3d_6 + d_7 + 3d_8 + d_9 + 3d_{10} + d_{11} + 3d_{12} &#92;pmod{10}).' title='d_{13} = &#92;&#92; 10 - (d_1 + 3d_2 + d_3 + 3d_4 + d_5 + 3d_6 + d_7 + 3d_8 + d_9 + 3d_{10} + d_{11} + 3d_{12} &#92;pmod{10}).' class='latex' /></p>
<p>The mod 10 just means we take only the rightmost digit of the sum. This method is useful for two reasons. First, to detect an error, one can check if the sum of the digits, with alternate weights of 1 and 3, has rightmost digit 0. If not, then there is an error. Furthermore, the weights are designed so that if we transpose two adjacent digits, an error can be detected. Had we weighted all the digits evenly, then transposing two adjacent digits would not change the sum. This is also an example of an error-detecting code which is used outside of digital message transmission.</p>
<p>To recap, you should have learned the following from this post:</p>
<ul>
<li>Why we need error detection and correction</li>
<li>The basic idea of error detection and correction</li>
<li>Geometric intuition behind error detection and correction</li>
<li>An example of error detection in a common setting</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nolaymanleftbehind.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nolaymanleftbehind.wordpress.com/178/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=178&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nolaymanleftbehind.wordpress.com/2011/07/11/error-correcting-codes-why-your-texts-dont-end-up-as-gibberish/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0342b25cba1b6d106701db092ab3ec56?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aguo777</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/b/b4/Hamming_distance_3_bit_binary.svg" medium="image">
			<media:title type="html">Hamming distance cube</media:title>
		</media:content>
	</item>
		<item>
		<title>Calculus: Asymptotic growth</title>
		<link>http://nolaymanleftbehind.wordpress.com/2011/07/11/calculus-asymptotic-growth/</link>
		<comments>http://nolaymanleftbehind.wordpress.com/2011/07/11/calculus-asymptotic-growth/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 04:23:23 +0000</pubDate>
		<dc:creator>Alan Guo</dc:creator>
				<category><![CDATA[Analysis]]></category>
		<category><![CDATA[Mathematics]]></category>

		<guid isPermaLink="false">http://nolaymanleftbehind.wordpress.com/?p=139</guid>
		<description><![CDATA[In mathematics and science, it&#8217;s often too difficult to get precise formulas for things, so often researchers just estimate the growth. For example, in a previous post on the Fibonacci sequence, we found that the Fibonacci numbers grow roughly exponentially; that is, they are close to an exponential function, but there is a tiny error term. [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=139&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>In mathematics and science, it&#8217;s often too difficult to get precise formulas for things, so often researchers just <em>estimate</em> the growth. For example, in a previous post on the Fibonacci sequence, we found that the Fibonacci numbers grow roughly exponentially; that is, they are close to an exponential function, but there is a tiny error term. Often, we don&#8217;t actually care about the exact formula but we just want an idea of how quickly something grows. In order to capture this vague notion precisely, we use <strong>asymptotic notation</strong>, which captures all the long-run information contained in the original function.</p>
<p><span id="more-139"></span></p>
<p>Since all we care about is what happens in the long run, the definition of asymptotic notation involves limits. There are five primary notations: big-O, little-o, big-Omega, little-omega, and big-Theta. Don&#8217;t be intimidated by the large number of definitions. These are all defined very similarly, so once you understand one of them, you can understand them all. For that reason, we will focus on understanding big-O, and merely describe the differences from the others.</p>
<p>Big-O notation is used to describe upper bounds. Intuitively, the function <img src='http://s0.wp.com/latex.php?latex=f%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n)' title='f(n)' class='latex' /> is <img src='http://s0.wp.com/latex.php?latex=O%28g%28n%29%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='O(g(n))' title='O(g(n))' class='latex' />, pronounced &#8220;big-O of <img src='http://s0.wp.com/latex.php?latex=g%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='g(n)' title='g(n)' class='latex' />,&#8221; if in the long run <img src='http://s0.wp.com/latex.php?latex=f%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n)' title='f(n)' class='latex' /> grows no faster than <img src='http://s0.wp.com/latex.php?latex=g%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='g(n)' title='g(n)' class='latex' />. We&#8217;ll briefly take a look at the technical definition, and then explain it in English:</p>
<blockquote><p>A function <img src='http://s0.wp.com/latex.php?latex=f%28n%29+%3D+O%28g%28n%29%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n) = O(g(n))' title='f(n) = O(g(n))' class='latex' /> if there is a constant <img src='http://s0.wp.com/latex.php?latex=C+%3E+0&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='C &gt; 0' title='C &gt; 0' class='latex' /> such that <img src='http://s0.wp.com/latex.php?latex=f%28n%29+%5Cle+Cg%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n) &#92;le Cg(n)' title='f(n) &#92;le Cg(n)' class='latex' /> whenever <img src='http://s0.wp.com/latex.php?latex=n+%5Cge+n_0&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n &#92;ge n_0' title='n &#92;ge n_0' class='latex' />, for some <img src='http://s0.wp.com/latex.php?latex=n_0&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n_0' title='n_0' class='latex' />.</p></blockquote>
<p>The phrase &#8220;whenever <img src='http://s0.wp.com/latex.php?latex=n+%5Cge+n_0&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n &#92;ge n_0' title='n &#92;ge n_0' class='latex' />, for some <img src='http://s0.wp.com/latex.php?latex=n_0&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n_0' title='n_0' class='latex' />&#8221; can be interpreted as &#8220;when <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n' title='n' class='latex' /> gets large enough.&#8221; The <img src='http://s0.wp.com/latex.php?latex=n_0&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n_0' title='n_0' class='latex' /> can be seen as the &#8220;cutoff point,&#8221; where any larger <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n' title='n' class='latex' /> will cause <img src='http://s0.wp.com/latex.php?latex=f%28n%29+%5Cle+Cg%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n) &#92;le Cg(n)' title='f(n) &#92;le Cg(n)' class='latex' />. Why do we want the constant <img src='http://s0.wp.com/latex.php?latex=C&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='C' title='C' class='latex' /> to be there? Intuitively, constant multipliers don&#8217;t affect asymptotic growth. That is, we want to say that <img src='http://s0.wp.com/latex.php?latex=an%5E2&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='an^2' title='an^2' class='latex' /> grows faster than <img src='http://s0.wp.com/latex.php?latex=bn&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='bn' title='bn' class='latex' />, no matter how small <img src='http://s0.wp.com/latex.php?latex=a&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='a' title='a' class='latex' /> is or how large <img src='http://s0.wp.com/latex.php?latex=b&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='b' title='b' class='latex' /> is. These details only matter if you want to know the precise definition of big-O. If you just want to understand intuitively what big-O means, it means &#8220;grows no faster than.&#8221; Some properties and examples:</p>
<ul>
<li><img src='http://s0.wp.com/latex.php?latex=f%28n%29+%3D+O%28f%28n%29%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n) = O(f(n))' title='f(n) = O(f(n))' class='latex' />; obviously, no function grows faster than itself</li>
<li><img src='http://s0.wp.com/latex.php?latex=af%28n%29+%3D+O%28f%28n%29%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='af(n) = O(f(n))' title='af(n) = O(f(n))' class='latex' />; this is a consequence of how we designed big-O so that constant multipliers don&#8217;t matter</li>
<li><img src='http://s0.wp.com/latex.php?latex=n%5Ei+%3D+O%28n%5Ej%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n^i = O(n^j)' title='n^i = O(n^j)' class='latex' /></li>
<li>If <img src='http://s0.wp.com/latex.php?latex=f%28n%29+%3D+O%28g%28n%29%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n) = O(g(n))' title='f(n) = O(g(n))' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=g%28n%29+%3D+O%28h%28n%29%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='g(n) = O(h(n))' title='g(n) = O(h(n))' class='latex' />, then <img src='http://s0.wp.com/latex.php?latex=f%28n%29+%3D+O%28h%28n%29%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n) = O(h(n))' title='f(n) = O(h(n))' class='latex' />; this can be checked by the definitions, but it also makes sense intuitively&#8212;if <img src='http://s0.wp.com/latex.php?latex=f%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n)' title='f(n)' class='latex' /> grows no faster than <img src='http://s0.wp.com/latex.php?latex=g%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='g(n)' title='g(n)' class='latex' />, which grows no faster than <img src='http://s0.wp.com/latex.php?latex=h%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='h(n)' title='h(n)' class='latex' />, then of course <img src='http://s0.wp.com/latex.php?latex=f%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n)' title='f(n)' class='latex' /> grows no faster than <img src='http://s0.wp.com/latex.php?latex=h%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='h(n)' title='h(n)' class='latex' />!</li>
<li>If $f(n) = O(g(n))$, then $O(f(n) + g(n)) = O(f(n))$</li>
</ul>
<p>The last property is extremely important for polynomials. It basically means that when we look at polynomials, in big-O only the highest degree term matters, and we don&#8217;t care about the constants. This makes finding big-O of polynomials super easy. For example:</p>
<ul>
<li><img src='http://s0.wp.com/latex.php?latex=n%5E2+%2B+n+%2B+1+%3D+O%28n%5E2%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n^2 + n + 1 = O(n^2)' title='n^2 + n + 1 = O(n^2)' class='latex' /></li>
<li><img src='http://s0.wp.com/latex.php?latex=3n%5E%7B10%7D+%2B+5n%5E4+%2B+9n%5E%7B11%7D+%2B+100000n+%3D+O%28n%5E%7B11%7D%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='3n^{10} + 5n^4 + 9n^{11} + 100000n = O(n^{11})' title='3n^{10} + 5n^4 + 9n^{11} + 100000n = O(n^{11})' class='latex' /></li>
</ul>
<p>This comes in especially handy when estimating running times for algorithms. Let&#8217;s say we have an algorithm which, given <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n' title='n' class='latex' /> points in the plane, finds the closest pair of points, and it does so by brute-force, comparing every pair of points. There are <img src='http://s0.wp.com/latex.php?latex=n%28n-1%29%2F2&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n(n-1)/2' title='n(n-1)/2' class='latex' /> possible pairs, and each comparison takes some constant amount of time (this is why we don&#8217;t care about constants, because they change with advances in hardware), so in total the algorithm&#8217;s running time is <img src='http://s0.wp.com/latex.php?latex=O%28n%5E2%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='O(n^2)' title='O(n^2)' class='latex' />.</p>
<p>Now, the other asymptotic notations are defined similarly. Intuitively, all you need to know is the following:</p>
<ul>
<li>A function <img src='http://s0.wp.com/latex.php?latex=f%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n)' title='f(n)' class='latex' /> is little-o of <img src='http://s0.wp.com/latex.php?latex=g%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='g(n)' title='g(n)' class='latex' />, written <img src='http://s0.wp.com/latex.php?latex=f%28n%29+%3D+o%28g%28n%29%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n) = o(g(n))' title='f(n) = o(g(n))' class='latex' />, if <img src='http://s0.wp.com/latex.php?latex=f%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n)' title='f(n)' class='latex' /> grows <strong>strictly slower</strong> than <img src='http://s0.wp.com/latex.php?latex=g%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='g(n)' title='g(n)' class='latex' />. In other words, little-o is to big-O as <img src='http://s0.wp.com/latex.php?latex=%3C&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&lt;' title='&lt;' class='latex' /> is to <img src='http://s0.wp.com/latex.php?latex=%5Cle&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;le' title='&#92;le' class='latex' />.</li>
<li>A function <img src='http://s0.wp.com/latex.php?latex=f%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n)' title='f(n)' class='latex' /> is big-Omega of <img src='http://s0.wp.com/latex.php?latex=g%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='g(n)' title='g(n)' class='latex' />, written <img src='http://s0.wp.com/latex.php?latex=f%28n%29+%3D+%5COmega%28g%28n%29%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n) = &#92;Omega(g(n))' title='f(n) = &#92;Omega(g(n))' class='latex' />, if <img src='http://s0.wp.com/latex.php?latex=f%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n)' title='f(n)' class='latex' /> grows <strong>at least as fast</strong> as <img src='http://s0.wp.com/latex.php?latex=g%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='g(n)' title='g(n)' class='latex' />. In other words, big-Omega is to big-O as <img src='http://s0.wp.com/latex.php?latex=%5Cge&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;ge' title='&#92;ge' class='latex' /> is to <img src='http://s0.wp.com/latex.php?latex=%5Cle&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;le' title='&#92;le' class='latex' />.</li>
<li>A function <img src='http://s0.wp.com/latex.php?latex=f%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n)' title='f(n)' class='latex' /> is little-omega of <img src='http://s0.wp.com/latex.php?latex=g%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='g(n)' title='g(n)' class='latex' />, written <img src='http://s0.wp.com/latex.php?latex=f%28n%29+%3D+%5Comega%28g%28n%29%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n) = &#92;omega(g(n))' title='f(n) = &#92;omega(g(n))' class='latex' />, if <img src='http://s0.wp.com/latex.php?latex=f%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n)' title='f(n)' class='latex' /> grows <strong>strictly faster</strong> than <img src='http://s0.wp.com/latex.php?latex=g%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='g(n)' title='g(n)' class='latex' />. In other words, little-omega is to big-O as <img src='http://s0.wp.com/latex.php?latex=%3E&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&gt;' title='&gt;' class='latex' /> is to <img src='http://s0.wp.com/latex.php?latex=%5Cle&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;le' title='&#92;le' class='latex' />.</li>
<li>Finally, a function <img src='http://s0.wp.com/latex.php?latex=f%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n)' title='f(n)' class='latex' /> is big-Theta of <img src='http://s0.wp.com/latex.php?latex=g%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='g(n)' title='g(n)' class='latex' />, written <img src='http://s0.wp.com/latex.php?latex=f%28n%29+%3D+%5CTheta%28g%28n%29%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n) = &#92;Theta(g(n))' title='f(n) = &#92;Theta(g(n))' class='latex' />, if <img src='http://s0.wp.com/latex.php?latex=f%28n%29+%3D+O%28g%28n%29%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n) = O(g(n))' title='f(n) = O(g(n))' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=f%28n%29+%3D+%5COmega%28g%28n%29%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n) = &#92;Omega(g(n))' title='f(n) = &#92;Omega(g(n))' class='latex' />. This means that <img src='http://s0.wp.com/latex.php?latex=f%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n)' title='f(n)' class='latex' /> grows <strong>asymptotically at the same rate</strong> as <img src='http://s0.wp.com/latex.php?latex=g%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='g(n)' title='g(n)' class='latex' />.</li>
</ul>
<p>To recap, you should have learned the following from this post:</p>
<ul>
<li>What asymptotic notation is</li>
<li>How to compute big-O of polynomials</li>
<li>The use of asymptotic notation</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nolaymanleftbehind.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nolaymanleftbehind.wordpress.com/139/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=139&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nolaymanleftbehind.wordpress.com/2011/07/11/calculus-asymptotic-growth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0342b25cba1b6d106701db092ab3ec56?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aguo777</media:title>
		</media:content>
	</item>
		<item>
		<title>Intro Post: Eugene</title>
		<link>http://nolaymanleftbehind.wordpress.com/2011/07/11/intro-post-eugene/</link>
		<comments>http://nolaymanleftbehind.wordpress.com/2011/07/11/intro-post-eugene/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 02:51:56 +0000</pubDate>
		<dc:creator>cryophilous</dc:creator>
				<category><![CDATA[Authors]]></category>

		<guid isPermaLink="false">http://nolaymanleftbehind.wordpress.com/?p=132</guid>
		<description><![CDATA[Hi everyone, my name is Eugene. I completed my undergraduate degree at Duke University with a double major in Mathematics and Physics, as well as a minor in Chemistry. My main interests are in applications of mathematics and physics towards understanding and manipulating biological systems. My prior research experience has been in the areas of [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=132&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi everyone, my name is Eugene. I completed my undergraduate degree at Duke University with a double major in Mathematics and Physics, as well as a minor in Chemistry. My main interests are in applications of mathematics and physics towards understanding and manipulating biological systems. My prior research experience has been in the areas of mathematical biology, biochemistry, and biophysics. As such, my posts will generally concern topics in these fields with particular emphasis on their relation to medicine and physiology. I will also write occasionally about concepts from theoretical physics. Happy reading!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nolaymanleftbehind.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nolaymanleftbehind.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=132&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nolaymanleftbehind.wordpress.com/2011/07/11/intro-post-eugene/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/daa8ec826c1626f16bb8e57df85bfe2c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cryophilous</media:title>
		</media:content>
	</item>
		<item>
		<title>Algorithms: What are they?</title>
		<link>http://nolaymanleftbehind.wordpress.com/2011/07/11/algorithms-what-are-they/</link>
		<comments>http://nolaymanleftbehind.wordpress.com/2011/07/11/algorithms-what-are-they/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 00:02:45 +0000</pubDate>
		<dc:creator>Alan Guo</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Theory]]></category>

		<guid isPermaLink="false">http://nolaymanleftbehind.wordpress.com/?p=111</guid>
		<description><![CDATA[Algorithms lie at the heart of computing. When you surf the web, you open up a web browser. When you view a website, your web browser takes the HTML file, which contains code, and then the browser uses an algorithm to convert the code into a page that actually makes sense to humans. When you [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=111&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Algorithms lie at the heart of computing. When you surf the web, you open up a web browser. When you view a website, your web browser takes the HTML file, which contains code, and then the browser uses an algorithm to convert the code into a page that actually makes sense to humans. When you listen to music on iTunes, the music player takes the MP3 file, which encodes the sound as 0&#8242;s and 1&#8242;s, and it uses an algorithm read the 0&#8242;s and 1&#8242;s and tell your computer speakers to output sound. When you&#8217;re looking for a particular song in your music library, you might want to search alphabetically, so you click on the Name column to sort your songs alphabetically. Your computer doesn&#8217;t magically know how to sort your library. It follows a precise set of instructions every time it&#8217;s told to sort something. That set of instructions is an algorithm!</p>
<p><span id="more-111"></span></p>
<p>Modern electronic computers actually follow a theoretical model invented by <a href="http://en.wikipedia.org/wiki/Alan_Turing">Alan Turing</a> in the 1930s. This theoretical model, now called a <strong>Turing machine</strong>, can be informally described quite simply. A Turing machine is composed of three parts: states, a tape (consisting of blocks or cells), and a tape head, which points to a cell. The modern computer counterpart to the tape is memory, and the counterpart to the tape head is the program counter. In addition, the Turing machine has a transition function, which tells it which state to go to and what to do on the tape, given its current state and tape contents. Think of it this way: you have a set of states such as &#8220;hungry&#8221;, &#8220;sad&#8221;, &#8220;happy&#8221;, etc. and you have a row of infinitely many sheets of paper laid side by side on the ground, but they&#8217;re so big that you can only see one of them at a time by walking over it, and each sheet can only contain one character (you have to write them so large so that aliens from space can see them). A transition function would be like a look-up table you carry in your pocket, which says stuff like &#8220;if you&#8217;re hungry and the paper you&#8217;re on contains a 1, then you become angry, change the 1 to a 0 on your sheet of paper, and move to the right by one sheet of paper.&#8221; Moreover, one of the states of the Turing machine is designated the initial state (the state which it starts in every time it&#8217;s run), some of the states are designated <strong>accepting</strong> states, and some of them are designated <strong>rejecting</strong> states. A Turing machine is completely specified by its states along with the above designations and its transition function. When you think Turing machine, think &#8220;theoretical computer.&#8221; Turing machines don&#8217;t have to be simulated by electronic computers. Anything that can do what a Turing machine does can act like a computer. Instead of electronic circuits acting as logic gates, you can use billiard-balls bouncing inside a box instead. This <a href="http://en.wikipedia.org/wiki/Billiard-ball_computer">model</a> has actually been proposed.</p>
<p>Now, every program in your computer acts like a Turing machine, except for one difference: the tape is not infinitely long, i.e., you have a finite amount of work space. For now, let&#8217;s only consider programs which answer Yes/No questions. For example, consider a program which decides if a given positive integer is prime. Many graphing calculators, such as the TI-89 graphing calculator, have such a function; on the TI-89, the function is called isPrime(). The calculator doesn&#8217;t magically know if a number is prime or not. When you tell it to do isPrime(123), it follows a specific set of instructions, or algorithm, which was programmed into it. The algorithm corresponds to the transition function of the Turing machine. When you tell the calculator or Turing machine to do isPrime(123), it first converts the input, 123, into the language with which it operates, for example, binary numbers. In this case, the Turing machine reads as its input the binary of 123, which is 1111011 and writes that down on the first 7 cells of its tape. Then it faithfully follows its transition function and performs steps and finally halts in either an accepting state or rejecting state. If it ends on an accepting state, it spits out the answer True, and if it ends on a rejecting state, it spits out the answer False. In our case, the machine will end up on a rejecting state, since 123 = 3 x 41.</p>
<p>However, programmers nowadays don&#8217;t have to worry about the nitty-gritty details of coming up with an appropriate transition function for a Turing machine that will correctly decide if its input is prime and then putting together an electronic circuit that will simulate the Turing machine. Thankfully, all that hard work has been done decades ago, and now everything&#8217;s been abstracted. We can write programs in programming languages like C++ or Java, and the compiler does all the work of translating our code into machine code, which the machine then reads in and performs the necessary steps to simulate the appropriate Turing machine.</p>
<p>Now, how does a computer actually check if a number is prime? That is, what is a sequence of instructions such that, when given a positive integer n, will always output the correct answer as to whether n is prime or not? Often one can write an algorithm by thinking about how one would do it by hand. If you were asked to determine if a number is prime or not, how would you do it? Well, one can directly use the definition of primality. The number n is prime if and only if some integer d &gt; 1 evenly divides n. So, one way would be to start from 2 and check if every number up to n-1 divides n. If none do, then n is prime, otherwise n is not. This may seem like a stupid way to do it, and in some sense it is, but it works and you have to keep in mind that computers crunch numbers a lot faster than humans do. The algorithm just described can be written in Python as follows:</p>
<pre class="brush: python; title: ; notranslate">
def isPrime(n):
    if n &lt; 2:
        return False
    else:
        for d in range(2, n):
            if n % d == 0:
                return False
        return True
</pre>
<p>In case you&#8217;re not familiar with Python syntax, this is what the code does: it defines a function isPrime(n) which takes n as its input. Then, it first checks if n &lt; 2. If so, then it&#8217;ll spit out False, since there are no primes less than 2. If not, then the code goes to the else branch. The for loop basically iteratively sets d to be 2, 3, 4, etc. all the way until n-1. For each value, it&#8217;ll test if d divides n. The n % d means taking the remainder when dividing n by d, and == 0 is checking if the result is equal to 0. If this condition is true, then d divides n, so n is not prime, so we return False. Finally, after running through all these values of d, if no divisors were found, then return True.</p>
<p>You may notice that this algorithm takes a linear amount of time in n. That is, if you double n, then the number of divisors the algorithm checks roughly doubles as well. We say that this is an <img src='http://s0.wp.com/latex.php?latex=O%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='O(n)' title='O(n)' class='latex' />-time algorithm, where <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n' title='n' class='latex' /> is the input. Note that we can modify the algorithm so that it only checks divisors d up to <img src='http://s0.wp.com/latex.php?latex=%5Csqrt+n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;sqrt n' title='&#92;sqrt n' class='latex' />. We can do this because if n had a divisor <img src='http://s0.wp.com/latex.php?latex=d+%5Cge+%5Csqrt+n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='d &#92;ge &#92;sqrt n' title='d &#92;ge &#92;sqrt n' class='latex' />, then it would have to have a corresponding divisor <img src='http://s0.wp.com/latex.php?latex=%5Cfrac+nd+%5Cle+%5Csqrt+n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;frac nd &#92;le &#92;sqrt n' title='&#92;frac nd &#92;le &#92;sqrt n' class='latex' />. Therefore we could make the algorithm an <img src='http://s0.wp.com/latex.php?latex=O%28%5Csqrt+n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='O(&#92;sqrt n)' title='O(&#92;sqrt n)' class='latex' />-time algorithm. Making algorithms more efficient is a huge area of study in computer science, and deserves at least a post on its own.</p>
<p>To recap, you should have learned the following from this post:</p>
<ul>
<li>An intuitive idea of what a Turing machine is, and how modern electronic computers relate to them</li>
<li>What an algorithm is</li>
<li>The relationship between algorithms and Turing machines</li>
<li>An algorithm for determining the primality of positive integers</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nolaymanleftbehind.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nolaymanleftbehind.wordpress.com/111/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=111&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nolaymanleftbehind.wordpress.com/2011/07/11/algorithms-what-are-they/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0342b25cba1b6d106701db092ab3ec56?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aguo777</media:title>
		</media:content>
	</item>
		<item>
		<title>Combinatorics: Power of generating functions</title>
		<link>http://nolaymanleftbehind.wordpress.com/2011/07/10/combinatorics-power-of-generating-functions/</link>
		<comments>http://nolaymanleftbehind.wordpress.com/2011/07/10/combinatorics-power-of-generating-functions/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 21:30:00 +0000</pubDate>
		<dc:creator>Alan Guo</dc:creator>
				<category><![CDATA[Combinatorics]]></category>
		<category><![CDATA[Mathematics]]></category>

		<guid isPermaLink="false">http://nolaymanleftbehind.wordpress.com/?p=74</guid>
		<description><![CDATA[Sometimes sequences of numbers are defined recursively, so that given the previous terms of the sequence we can find the next term. A classic example of this is the sequence of Fibonacci numbers, where every two consecutive terms determine the next term, and so if we are given the first two terms, we can calculate [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=74&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Sometimes sequences of numbers are defined recursively, so that given the previous terms of the sequence we can find the next term. A classic example of this is the sequence of <strong>Fibonacci numbers</strong>, where every two consecutive terms determine the next term, and so if we are given the first two terms, we can calculate the whole sequence. However, if we wanted to, say, calculated the 1000th Fibonacci number, we&#8217;d have to start out with the first two, add them to compute the 3rd, add the second and third to compute the 4th, and so on, to slowly build up every single Fibonacci number before the 1000th in order to get there. It&#8217;d be much nicer if we had a formula for the Fibonacci sequence. That way, if we wanted the 1000th Fibonacci number, all we&#8217;d have to do is plug 1000 into the formula to compute it. Of course, the formula is only useful if it takes less time to crunch it out than it does to do it the brute-force way. A method of finding closed formulas for sequences defined by recurrences is the use of <strong>generating functions</strong>. Generating functions are functions which &#8220;encapsulate&#8221; all the information about a sequence, except you can define it without knowing the actual terms of the sequence. The power of generating functions comes from the fact that you can do things like add and multiply them together to create generating functions of other sequences, or write them in terms of themselves to find an explicit formula. Once you have an explicit form for a generating function, you can use some algebra to &#8220;extract&#8221; the information from the function, which usually means you can find a formula for the sequence in question.</p>
<p><span id="more-74"></span></p>
<p>Probably the most famous sequence defined by a linear recurrence is the <strong>Fibonacci sequence</strong> of numbers <img src='http://s0.wp.com/latex.php?latex=F_0%2CF_1%2C+F_2%2C+F_3%2C+F_4%2C+%5Cldots&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_0,F_1, F_2, F_3, F_4, &#92;ldots' title='F_0,F_1, F_2, F_3, F_4, &#92;ldots' class='latex' />, defined by</p>
<p><img src='http://s0.wp.com/latex.php?latex=F_0+%3D+0+%5C%5C+F_1+%3D+1+%5C%5C+F_n+%3D+F_%7Bn-1%7D+%2B+F_%7Bn-2%7D%2C+n+%5Cge+1%2C&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_0 = 0 &#92;&#92; F_1 = 1 &#92;&#92; F_n = F_{n-1} + F_{n-2}, n &#92;ge 1,' title='F_0 = 0 &#92;&#92; F_1 = 1 &#92;&#92; F_n = F_{n-1} + F_{n-2}, n &#92;ge 1,' class='latex' /></p>
<p>that is, each term is the sum of the two previous terms. The first few terms are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 81. These numbers arise in nature. For example, consider modeling the population of some sort of asexually reproducing single-celled organism. Let&#8217;s suppose this species takes 1 day to reach &#8220;maturity,&#8221; after which it begins to asexually reproduce, and it takes 1 day to actually divide. Then, if the population on day <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n' title='n' class='latex' /> is <img src='http://s0.wp.com/latex.php?latex=P_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='P_n' title='P_n' class='latex' />, then <img src='http://s0.wp.com/latex.php?latex=P_n+%3D+P_%7Bn-1%7D+%2B+P_%7Bn-2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='P_n = P_{n-1} + P_{n-2}' title='P_n = P_{n-1} + P_{n-2}' class='latex' />, since on the previous day there are <img src='http://s0.wp.com/latex.php?latex=P_%7Bn-1%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='P_{n-1}' title='P_{n-1}' class='latex' /> cells but only <img src='http://s0.wp.com/latex.php?latex=P_%7Bn-2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='P_{n-2}' title='P_{n-2}' class='latex' /> of them are mature enough to start reproducing. For example, on day 1 there is 1 baby cell. On day 2, the baby cell becomes an adult. On day 3, the 1 adult has given birth, so there are 2 cells, 1 adult and 1 baby. On day 4, the baby has just matured and the adult has given birth again, yielding 3 cells, 2 adults and 1 baby. On day 5, the new baby matures and the 2 adults give birth, yielding 3 adults and 2 babies, and so on.</p>
<p>Now, it would be nice to be able to find a closed formula for <img src='http://s0.wp.com/latex.php?latex=F_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_n' title='F_n' class='latex' />, so that if we wanted to find <img src='http://s0.wp.com/latex.php?latex=F_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_n' title='F_n' class='latex' />, we don&#8217;t have to start from <img src='http://s0.wp.com/latex.php?latex=F_0&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_0' title='F_0' class='latex' /> and build our way up. For example, if we had a sequence <img src='http://s0.wp.com/latex.php?latex=G_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G_n' title='G_n' class='latex' /> defined by <img src='http://s0.wp.com/latex.php?latex=G_0+%3D+1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G_0 = 1' title='G_0 = 1' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=G_n+%3D+G_%7Bn-1%7D+%2B+G_%7Bn-1%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G_n = G_{n-1} + G_{n-1}' title='G_n = G_{n-1} + G_{n-1}' class='latex' />, then the numbers would be 1, 2, 4, 8, 16, etc. and it would be easy to see that a closed formula for this sequence is <img src='http://s0.wp.com/latex.php?latex=G_n+%3D+2%5En&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G_n = 2^n' title='G_n = 2^n' class='latex' />.</p>
<p>Intuitively, things whose growth rate is related to their current size grow exponentially. For example, the growth rate for our <img src='http://s0.wp.com/latex.php?latex=G_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G_n' title='G_n' class='latex' /> is <img src='http://s0.wp.com/latex.php?latex=%5CDelta+G_n+%3D+G_n+-+G_%7Bn-1%7D+%3D+G_%7Bn-1%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;Delta G_n = G_n - G_{n-1} = G_{n-1}' title='&#92;Delta G_n = G_n - G_{n-1} = G_{n-1}' class='latex' />, that is, the amount <img src='http://s0.wp.com/latex.php?latex=G_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G_n' title='G_n' class='latex' /> increases by each time is equal to how many there are right now. This is a model of cells dividing which do not require time to mature. The rate of growth for Fibonacci numbers is <img src='http://s0.wp.com/latex.php?latex=%5CDelta+F_n+%3D+F_n+-+F_%7Bn-1%7D+%3D+F_%7Bn-2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;Delta F_n = F_n - F_{n-1} = F_{n-2}' title='&#92;Delta F_n = F_n - F_{n-1} = F_{n-2}' class='latex' />, so the growth rate is equal to the population one generation ago, so it&#8217;s &#8220;delayed&#8221; in some sense, but our intuition still tells us that this should be close to exponential. Of course, it isn&#8217;t actually exponential, otherwise the ratio <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7BF_n%7D%7BF_%7Bn-1%7D%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;frac{F_n}{F_{n-1}}' title='&#92;frac{F_n}{F_{n-1}}' class='latex' /> would be constant. Nevertheless, the ratio <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7BF_n%7D%7BF_%7Bn-1%7D%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;frac{F_n}{F_{n-1}}' title='&#92;frac{F_n}{F_{n-1}}' class='latex' /> approaches <img src='http://s0.wp.com/latex.php?latex=%5Cphi+%3D+1.6180339885%5Cldots&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;phi = 1.6180339885&#92;ldots' title='&#92;phi = 1.6180339885&#92;ldots' class='latex' />, commonly known as the <strong>golden ratio</strong>. That means that in the long run, <img src='http://s0.wp.com/latex.php?latex=F_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_n' title='F_n' class='latex' /> behaves more or less like the function <img src='http://s0.wp.com/latex.php?latex=f%28n%29+%3D+%5Cphi%5En&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(n) = &#92;phi^n' title='f(n) = &#92;phi^n' class='latex' />. However, we want an <strong>exact</strong> formula for <img src='http://s0.wp.com/latex.php?latex=F_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_n' title='F_n' class='latex' />, so let&#8217;s see how we go about finding that.</p>
<p>One way is by using generating functions. A <strong>generating function</strong> for a sequence is just a power series whose coefficients record information about that sequence, usually the actual numbers. For example, let&#8217;s take a look at our beloved sequence <img src='http://s0.wp.com/latex.php?latex=G_n+%3D+2%5En&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G_n = 2^n' title='G_n = 2^n' class='latex' />. The terms are 1, 2, 4, 8, 16, 32, and so on, so the generating function for the sequence is</p>
<p><img src='http://s0.wp.com/latex.php?latex=G%28x%29+%3D+1+%2B+2x+%2B+4x%5E2+%2B+8x%5E3+%2B+16x%5E4+%2B+32x%5E5+%2B+%5Ccdots&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G(x) = 1 + 2x + 4x^2 + 8x^3 + 16x^4 + 32x^5 + &#92;cdots' title='G(x) = 1 + 2x + 4x^2 + 8x^3 + 16x^4 + 32x^5 + &#92;cdots' class='latex' /></p>
<p>where the coefficient of <img src='http://s0.wp.com/latex.php?latex=x%5En&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='x^n' title='x^n' class='latex' /> is simply <img src='http://s0.wp.com/latex.php?latex=G_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G_n' title='G_n' class='latex' />. Notice that we can write <img src='http://s0.wp.com/latex.php?latex=G%28x%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G(x)' title='G(x)' class='latex' /> more compactly. Since we know that <img src='http://s0.wp.com/latex.php?latex=G_n+%3D+2%5En&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G_n = 2^n' title='G_n = 2^n' class='latex' />, we have</p>
<p><img src='http://s0.wp.com/latex.php?latex=G%28x%29+%3D+1+%2B+2x+%2B+2%5E2x%5E2+%2B+2%5E3x%5E3+%2B+2%5E4x%5E4+%2B+%5Ccdots+%3D+1+%2B+%282x%29+%2B+%282x%29%5E2+%2B+%282x%29%5E3+%2B+%282x%29%5E4+%2B+%5Ccdots.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G(x) = 1 + 2x + 2^2x^2 + 2^3x^3 + 2^4x^4 + &#92;cdots = 1 + (2x) + (2x)^2 + (2x)^3 + (2x)^4 + &#92;cdots.' title='G(x) = 1 + 2x + 2^2x^2 + 2^3x^3 + 2^4x^4 + &#92;cdots = 1 + (2x) + (2x)^2 + (2x)^3 + (2x)^4 + &#92;cdots.' class='latex' /></p>
<p>Now, the function <img src='http://s0.wp.com/latex.php?latex=H%28x%29+%3D+1+%2B+x+%2B+x%5E2+%2B+x%5E3+%2B+x%5E4+%2B+%5Ccdots&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='H(x) = 1 + x + x^2 + x^3 + x^4 + &#92;cdots' title='H(x) = 1 + x + x^2 + x^3 + x^4 + &#92;cdots' class='latex' /> is pretty nice, and if we remember anything about infinite geometric series, then we know that if <img src='http://s0.wp.com/latex.php?latex=%7Cx%7C+%3C+1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='|x| &lt; 1' title='|x| &lt; 1' class='latex' />, then this function converges and we can write it as <img src='http://s0.wp.com/latex.php?latex=H%28x%29+%3D+%5Cfrac%7B1%7D%7B1-x%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='H(x) = &#92;frac{1}{1-x}' title='H(x) = &#92;frac{1}{1-x}' class='latex' />. But when we&#8217;re talking about generating functions, we don&#8217;t care about converging, so we can just say <img src='http://s0.wp.com/latex.php?latex=H%28x%29+%3D+%5Cfrac%7B1%7D%7B1-x%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='H(x) = &#92;frac{1}{1-x}' title='H(x) = &#92;frac{1}{1-x}' class='latex' /> since</p>
<p><img src='http://s0.wp.com/latex.php?latex=%281-x%29H%28x%29+%3D+%281-x%29%281+%2B+x+%2B+x%5E2+%2B+x%5E3+%2B+%5Ccdots%29+%5C%5C+%3D+%281+%2B+x+%2B+x%5E2+%2B+x%5E3+%2B+%5Ccdots+%29+-+%28x+%2B+x%5E2+%2B+x%5E3+%2B+x%5E4+%2B+%5Ccdots%29+%3D+1.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='(1-x)H(x) = (1-x)(1 + x + x^2 + x^3 + &#92;cdots) &#92;&#92; = (1 + x + x^2 + x^3 + &#92;cdots ) - (x + x^2 + x^3 + x^4 + &#92;cdots) = 1.' title='(1-x)H(x) = (1-x)(1 + x + x^2 + x^3 + &#92;cdots) &#92;&#92; = (1 + x + x^2 + x^3 + &#92;cdots ) - (x + x^2 + x^3 + x^4 + &#92;cdots) = 1.' class='latex' /></p>
<p>Now we notice that <img src='http://s0.wp.com/latex.php?latex=G%28x%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G(x)' title='G(x)' class='latex' /> is just <img src='http://s0.wp.com/latex.php?latex=H%28x%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='H(x)' title='H(x)' class='latex' /> with <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='x' title='x' class='latex' /> replaced with <img src='http://s0.wp.com/latex.php?latex=2x&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='2x' title='2x' class='latex' />, so we can write</p>
<p><img src='http://s0.wp.com/latex.php?latex=G%28x%29+%3D+H%282x%29+%3D+%5Cfrac%7B1%7D%7B1+-+2x%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G(x) = H(2x) = &#92;frac{1}{1 - 2x}' title='G(x) = H(2x) = &#92;frac{1}{1 - 2x}' class='latex' />.</p>
<p>Since we have <img src='http://s0.wp.com/latex.php?latex=G%28x%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G(x)' title='G(x)' class='latex' /> in this nice form, we can expand it to get <img src='http://s0.wp.com/latex.php?latex=G%28x%29+%3D+1+%2B+%282x%29+%2B+%282x%29%5E2+%2B+%282x%29%5E3+%2B+%5Ccdots&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G(x) = 1 + (2x) + (2x)^2 + (2x)^3 + &#92;cdots' title='G(x) = 1 + (2x) + (2x)^2 + (2x)^3 + &#92;cdots' class='latex' /> and find out that <img src='http://s0.wp.com/latex.php?latex=G_n+%3D+2%5En&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G_n = 2^n' title='G_n = 2^n' class='latex' />. Wait a minute. Didn&#8217;t we <em>use</em> the fact that <img src='http://s0.wp.com/latex.php?latex=G_n+%3D+2%5En&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G_n = 2^n' title='G_n = 2^n' class='latex' /> to get the nice form? This is true, but there is another way to get the nice form of <img src='http://s0.wp.com/latex.php?latex=G%28x%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G(x)' title='G(x)' class='latex' /> without knowing the explicit formula for <img src='http://s0.wp.com/latex.php?latex=G_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G_n' title='G_n' class='latex' />, and it just involves a little algebraic trickery.</p>
<p>We know that <img src='http://s0.wp.com/latex.php?latex=G_n+%3D+2G_%7Bn-1%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G_n = 2G_{n-1}' title='G_n = 2G_{n-1}' class='latex' />. Therefore,</p>
<p><img src='http://s0.wp.com/latex.php?latex=G%28x%29+%3D+G_0+%2B+G_1x+%2B+G_2x%5E2+%2B+G_3x%5E3+%2B+G_4x%5E4+%2B+%5Ccdots+%5C%5C+%3D+G_0+%2B+2G_0x+%2B+2G_1x%5E2+%2B+2G_2x%5E3+%2B+2G_3x%5E4+%2B+%5Ccdots.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G(x) = G_0 + G_1x + G_2x^2 + G_3x^3 + G_4x^4 + &#92;cdots &#92;&#92; = G_0 + 2G_0x + 2G_1x^2 + 2G_2x^3 + 2G_3x^4 + &#92;cdots.' title='G(x) = G_0 + G_1x + G_2x^2 + G_3x^3 + G_4x^4 + &#92;cdots &#92;&#92; = G_0 + 2G_0x + 2G_1x^2 + 2G_2x^3 + 2G_3x^4 + &#92;cdots.' class='latex' /></p>
<p>Furthermore, if we multiply <img src='http://s0.wp.com/latex.php?latex=G%28x%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G(x)' title='G(x)' class='latex' /> by <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='x' title='x' class='latex' />, we get a similarly looking thing:</p>
<p><img src='http://s0.wp.com/latex.php?latex=xG%28x%29+%3D+G_0x+%2B+G_1x%5E2+%2B+G_2x%5E3+%2B+G_3x%5E4+%2B+%5Ccdots.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='xG(x) = G_0x + G_1x^2 + G_2x^3 + G_3x^4 + &#92;cdots.' title='xG(x) = G_0x + G_1x^2 + G_2x^3 + G_3x^4 + &#92;cdots.' class='latex' /></p>
<p>In fact, what we have is</p>
<p><img src='http://s0.wp.com/latex.php?latex=G%28x%29+%3D+1+%2B+2xG%28x%29.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G(x) = 1 + 2xG(x).' title='G(x) = 1 + 2xG(x).' class='latex' /></p>
<p>If we move all the terms involving <img src='http://s0.wp.com/latex.php?latex=G%28x%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G(x)' title='G(x)' class='latex' /> to the left-hand side and factor out by <img src='http://s0.wp.com/latex.php?latex=G%28x%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G(x)' title='G(x)' class='latex' />, we get</p>
<p><img src='http://s0.wp.com/latex.php?latex=G%28x%29%281+-+2x%29+%3D+1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G(x)(1 - 2x) = 1' title='G(x)(1 - 2x) = 1' class='latex' /></p>
<p>from which it is easy to see that <img src='http://s0.wp.com/latex.php?latex=G%28x%29+%3D+%5Cfrac%7B1%7D%7B1-2x%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='G(x) = &#92;frac{1}{1-2x}' title='G(x) = &#92;frac{1}{1-2x}' class='latex' />.</p>
<p>Now let&#8217;s try doing this with the generating function</p>
<p><img src='http://s0.wp.com/latex.php?latex=F%28x%29+%3D+F_0+%2B+F_1x+%2B+F_2x%5E2+%2B+F_3x%5E3+%2B+%5Ccdots+%3D+0+%2B+x+%2B+x%5E2+%2B+2x%5E3+%2B+3x%5E4+%2B+5x%5E5+%2B+%5Ccdots&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F(x) = F_0 + F_1x + F_2x^2 + F_3x^3 + &#92;cdots = 0 + x + x^2 + 2x^3 + 3x^4 + 5x^5 + &#92;cdots' title='F(x) = F_0 + F_1x + F_2x^2 + F_3x^3 + &#92;cdots = 0 + x + x^2 + 2x^3 + 3x^4 + 5x^5 + &#92;cdots' class='latex' /></p>
<p>and see what happens. Our recurrence relation <img src='http://s0.wp.com/latex.php?latex=F_n+%3D+F_%7Bn-1%7D+%2B+F_%7Bn-2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_n = F_{n-1} + F_{n-2}' title='F_n = F_{n-1} + F_{n-2}' class='latex' /> means</p>
<p><img src='http://s0.wp.com/latex.php?latex=F%28x%29+%3D+F_0+%2B+F_1x+%2B+%28F_1+%2B+F_0%29x%5E2+%2B+%28F_2+%2B+F_1%29x%5E3+%2B+%28F_3+%2B+F_2%29x%5E4+%2B+%5Ccdots+%5C%5C+%3D+F_0%281+%2B+x+%2B+x%5E2%29+%2B+F_1%28x+%2B+x%5E2+%2B+x%5E3%29+%2B+F_2%28x%5E3+%2B+x%5E4%29+%2B+F_3%28x%5E4+%2B+x%5E5%29+%2B+%5Ccdots&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F(x) = F_0 + F_1x + (F_1 + F_0)x^2 + (F_2 + F_1)x^3 + (F_3 + F_2)x^4 + &#92;cdots &#92;&#92; = F_0(1 + x + x^2) + F_1(x + x^2 + x^3) + F_2(x^3 + x^4) + F_3(x^4 + x^5) + &#92;cdots' title='F(x) = F_0 + F_1x + (F_1 + F_0)x^2 + (F_2 + F_1)x^3 + (F_3 + F_2)x^4 + &#92;cdots &#92;&#92; = F_0(1 + x + x^2) + F_1(x + x^2 + x^3) + F_2(x^3 + x^4) + F_3(x^4 + x^5) + &#92;cdots' class='latex' /></p>
<p>meanwhile</p>
<p><img src='http://s0.wp.com/latex.php?latex=xF%28x%29+%3D+F_0x+%2B+F_1x%5E2+%2B+F_2x%5E3+%2B+F_3x%5E4+%2B+%5Ccdots+%5C%5C+x%5E2F%28x%29+%3D+F_0x%5E2+%2B+F_1x%5E3+%2B+F_2x%5E4+%2B+F_3x%5E5+%2B+%5Ccdots&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='xF(x) = F_0x + F_1x^2 + F_2x^3 + F_3x^4 + &#92;cdots &#92;&#92; x^2F(x) = F_0x^2 + F_1x^3 + F_2x^4 + F_3x^5 + &#92;cdots' title='xF(x) = F_0x + F_1x^2 + F_2x^3 + F_3x^4 + &#92;cdots &#92;&#92; x^2F(x) = F_0x^2 + F_1x^3 + F_2x^4 + F_3x^5 + &#92;cdots' class='latex' /></p>
<p>and so</p>
<p><img src='http://s0.wp.com/latex.php?latex=F%28x%29+%3D+F_0+%2B+F_1x+%2B+xF%28x%29+%2B+x%5E2F%28x%29+%3D+x+%2B+xF%28x%29+%2B+x%5E2F%28x%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F(x) = F_0 + F_1x + xF(x) + x^2F(x) = x + xF(x) + x^2F(x)' title='F(x) = F_0 + F_1x + xF(x) + x^2F(x) = x + xF(x) + x^2F(x)' class='latex' /></p>
<p>which we can rearrange to get</p>
<p><img src='http://s0.wp.com/latex.php?latex=F%28x%29%281+-+x+-+x%5E2%29+%3D+x&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F(x)(1 - x - x^2) = x' title='F(x)(1 - x - x^2) = x' class='latex' /></p>
<p>and so</p>
<p><img src='http://s0.wp.com/latex.php?latex=F%28x%29+%3D+%5Cfrac%7Bx%7D%7B1+-+x+-+x%5E2%7D+%3D+%5Cfrac%7B-x%7D%7Bx%5E2+%2B+x+-+1%7D.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F(x) = &#92;frac{x}{1 - x - x^2} = &#92;frac{-x}{x^2 + x - 1}.' title='F(x) = &#92;frac{x}{1 - x - x^2} = &#92;frac{-x}{x^2 + x - 1}.' class='latex' /></p>
<p>We can use the quadratic formula to find the roots of <img src='http://s0.wp.com/latex.php?latex=x%5E2+%2B+x+-+1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='x^2 + x - 1' title='x^2 + x - 1' class='latex' /> which happen to be <img src='http://s0.wp.com/latex.php?latex=%5Cphi+%3D+%5Cfrac%7B-1+%2B+%5Csqrt+5%7D%7B2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;phi = &#92;frac{-1 + &#92;sqrt 5}{2}' title='&#92;phi = &#92;frac{-1 + &#92;sqrt 5}{2}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cpsi+%3D+%5Cfrac%7B-1+-+%5Csqrt+5%7D%7B2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;psi = &#92;frac{-1 - &#92;sqrt 5}{2}' title='&#92;psi = &#92;frac{-1 - &#92;sqrt 5}{2}' class='latex' />. Therefore, we can write</p>
<p><img src='http://s0.wp.com/latex.php?latex=F%28x%29+%3D+%5Cfrac%7B-x%7D%7B%28x+-+%5Calpha%29%28x+-+%5Cbeta%29%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F(x) = &#92;frac{-x}{(x - &#92;alpha)(x - &#92;beta)}' title='F(x) = &#92;frac{-x}{(x - &#92;alpha)(x - &#92;beta)}' class='latex' />.</p>
<p>Moreover, we can use partial fraction decomposition to write</p>
<p><img src='http://s0.wp.com/latex.php?latex=F%28x%29+%3D+%5Cfrac%7B-x%7D%7B%28x+-+%5Calpha%29%28x+-+%5Cbeta%29%7D+%3D+%5Cfrac%7BA%7D%7Bx+-+%5Calpha%7D+%2B+%5Cfrac%7BB%7D%7Bx+-+%5Cbeta%7D.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F(x) = &#92;frac{-x}{(x - &#92;alpha)(x - &#92;beta)} = &#92;frac{A}{x - &#92;alpha} + &#92;frac{B}{x - &#92;beta}.' title='F(x) = &#92;frac{-x}{(x - &#92;alpha)(x - &#92;beta)} = &#92;frac{A}{x - &#92;alpha} + &#92;frac{B}{x - &#92;beta}.' class='latex' /></p>
<p>To solve for <img src='http://s0.wp.com/latex.php?latex=A&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='A' title='A' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=B&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='B' title='B' class='latex' />, we note that</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7BA%7D%7Bx+-+%5Calpha%7D+%2B+%5Cfrac%7BB%7D%7Bx+-+%5Cbeta%7D+%3D+%5Cfrac%7B%28A%2BB%29x+-+A%5Cbeta+-+B%5Calpha%7D%7Bx%5E2+%2B+x+-+1%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;frac{A}{x - &#92;alpha} + &#92;frac{B}{x - &#92;beta} = &#92;frac{(A+B)x - A&#92;beta - B&#92;alpha}{x^2 + x - 1}' title='&#92;frac{A}{x - &#92;alpha} + &#92;frac{B}{x - &#92;beta} = &#92;frac{(A+B)x - A&#92;beta - B&#92;alpha}{x^2 + x - 1}' class='latex' /></p>
<p>which gives us the system of linear equations</p>
<p><img src='http://s0.wp.com/latex.php?latex=A%2BB+%3D+-1+%5C%5C+A%5Cbeta+%2B+B%5Calpha+%3D+0.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='A+B = -1 &#92;&#92; A&#92;beta + B&#92;alpha = 0.' title='A+B = -1 &#92;&#92; A&#92;beta + B&#92;alpha = 0.' class='latex' /></p>
<p>Solving for <img src='http://s0.wp.com/latex.php?latex=A%2CB&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='A,B' title='A,B' class='latex' /> yields</p>
<p><img src='http://s0.wp.com/latex.php?latex=A+%3D+%5Cfrac%7B%5Calpha%7D%7B%5Cbeta+-+%5Calpha%7D+%5C%5C+B+%3D+%5Cfrac%7B%5Cbeta%7D%7B%5Calpha+-+%5Cbeta%7D.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='A = &#92;frac{&#92;alpha}{&#92;beta - &#92;alpha} &#92;&#92; B = &#92;frac{&#92;beta}{&#92;alpha - &#92;beta}.' title='A = &#92;frac{&#92;alpha}{&#92;beta - &#92;alpha} &#92;&#92; B = &#92;frac{&#92;beta}{&#92;alpha - &#92;beta}.' class='latex' /></p>
<p>However, we want our denominators to be of the form <img src='http://s0.wp.com/latex.php?latex=1+-+%5Calpha+x&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='1 - &#92;alpha x' title='1 - &#92;alpha x' class='latex' />, so that we can expand it into <img src='http://s0.wp.com/latex.php?latex=1+%2B+%28%5Calpha+x%29+%2B+%28%5Calpha+x%29%5E2+%2B+%5Ccdots&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='1 + (&#92;alpha x) + (&#92;alpha x)^2 + &#92;cdots' title='1 + (&#92;alpha x) + (&#92;alpha x)^2 + &#92;cdots' class='latex' />, so we rewrite</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7BA%7D%7Bx+-+%5Calpha%7D+%3D+%5Cfrac%7B-A%2F%5Calpha%7D%7B1+-+x%2F%5Calpha%7D+%5C%5C+%5Cfrac%7BB%7D%7Bx+-+%5Cbeta%7D+%3D+%5Cfrac%7B-B%2F%5Cbeta%7D%7B1+-+x%2F%5Cbeta%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;frac{A}{x - &#92;alpha} = &#92;frac{-A/&#92;alpha}{1 - x/&#92;alpha} &#92;&#92; &#92;frac{B}{x - &#92;beta} = &#92;frac{-B/&#92;beta}{1 - x/&#92;beta}' title='&#92;frac{A}{x - &#92;alpha} = &#92;frac{-A/&#92;alpha}{1 - x/&#92;alpha} &#92;&#92; &#92;frac{B}{x - &#92;beta} = &#92;frac{-B/&#92;beta}{1 - x/&#92;beta}' class='latex' /></p>
<p>and finally we note that</p>
<p><img src='http://s0.wp.com/latex.php?latex=-%5Cfrac%7BA%7D%7B%5Calpha%7D+%3D+%5Cfrac%7B1%7D%7B%5Calpha+-+%5Cbeta%7D+%3D+%5Cfrac%7B1%7D%7B%5Csqrt+5%7D+%5C%5C+-%5Cfrac%7BB%7D%7B%5Cbeta%7D+%3D+%5Cfrac%7B1%7D%7B%5Cbeta+-+%5Calpha%7D+%3D+-%5Cfrac%7B1%7D%7B%5Csqrt+5%7D.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='-&#92;frac{A}{&#92;alpha} = &#92;frac{1}{&#92;alpha - &#92;beta} = &#92;frac{1}{&#92;sqrt 5} &#92;&#92; -&#92;frac{B}{&#92;beta} = &#92;frac{1}{&#92;beta - &#92;alpha} = -&#92;frac{1}{&#92;sqrt 5}.' title='-&#92;frac{A}{&#92;alpha} = &#92;frac{1}{&#92;alpha - &#92;beta} = &#92;frac{1}{&#92;sqrt 5} &#92;&#92; -&#92;frac{B}{&#92;beta} = &#92;frac{1}{&#92;beta - &#92;alpha} = -&#92;frac{1}{&#92;sqrt 5}.' class='latex' /></p>
<p>Moreover, <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7B1%7D%7B%5Calpha%7D+%3D+%5Cfrac%7B2%7D%7B-1+%2B+%5Csqrt+5%7D+%3D+%5Cfrac%7B1+%2B+%5Csqrt+5%7D%7B2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;frac{1}{&#92;alpha} = &#92;frac{2}{-1 + &#92;sqrt 5} = &#92;frac{1 + &#92;sqrt 5}{2}' title='&#92;frac{1}{&#92;alpha} = &#92;frac{2}{-1 + &#92;sqrt 5} = &#92;frac{1 + &#92;sqrt 5}{2}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7B1%7D%7B%5Cbeta%7D+%3D+%5Cfrac%7B2%7D%7B-1+-+%5Csqrt+5%7D+%3D+%5Cfrac%7B1+-+%5Csqrt+5%7D%7B2%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;frac{1}{&#92;beta} = &#92;frac{2}{-1 - &#92;sqrt 5} = &#92;frac{1 - &#92;sqrt 5}{2}' title='&#92;frac{1}{&#92;beta} = &#92;frac{2}{-1 - &#92;sqrt 5} = &#92;frac{1 - &#92;sqrt 5}{2}' class='latex' />. Let&#8217;s call these numbers <img src='http://s0.wp.com/latex.php?latex=%5Cphi&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;phi' title='&#92;phi' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cpsi&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;psi' title='&#92;psi' class='latex' />, respectively. Then what we have is</p>
<p><img src='http://s0.wp.com/latex.php?latex=F%28x%29+%3D+%5Cfrac%7B1%7D%7B%5Csqrt+5%7D%5Cleft%28+%5Cfrac%7B1%7D%7B1+-+%5Cphi+x%7D+-+%5Cfrac%7B1%7D%7B1+-+%5Cpsi+x%7D+%5Cright%29+%5C%5C+%3D+%5Cfrac%7B1%7D%7B%5Csqrt+5%7D%5Cleft%5B+%281+%2B+%5Cphi+x+%2B+%5Cphi%5E2x%5E2+%2B+%5Cphi%5E3x%5E3+%2B+%5Ccdots%29+-+%281+%2B+%5Cpsi+x+%2B+%5Cpsi%5E2+x%5E2+%2B+%5Cpsi%5E3+x%5E3+%2B+%5Ccdots%29+%5Cright%5D+%5C%5C+%3D+%5Cfrac%7B1%7D%7B%5Csqrt+5%7D+%5Cleft%5B+%28%5Cphi+-+%5Cpsi%29x+%2B+%28%5Cphi%5E2+-+%5Cpsi%5E2%29x%5E2+%2B+%28%5Cphi%5E3+-+%5Cpsi%5E3%29x%5E3+%2B+%5Ccdots+%5Cright%5D.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F(x) = &#92;frac{1}{&#92;sqrt 5}&#92;left( &#92;frac{1}{1 - &#92;phi x} - &#92;frac{1}{1 - &#92;psi x} &#92;right) &#92;&#92; = &#92;frac{1}{&#92;sqrt 5}&#92;left[ (1 + &#92;phi x + &#92;phi^2x^2 + &#92;phi^3x^3 + &#92;cdots) - (1 + &#92;psi x + &#92;psi^2 x^2 + &#92;psi^3 x^3 + &#92;cdots) &#92;right] &#92;&#92; = &#92;frac{1}{&#92;sqrt 5} &#92;left[ (&#92;phi - &#92;psi)x + (&#92;phi^2 - &#92;psi^2)x^2 + (&#92;phi^3 - &#92;psi^3)x^3 + &#92;cdots &#92;right].' title='F(x) = &#92;frac{1}{&#92;sqrt 5}&#92;left( &#92;frac{1}{1 - &#92;phi x} - &#92;frac{1}{1 - &#92;psi x} &#92;right) &#92;&#92; = &#92;frac{1}{&#92;sqrt 5}&#92;left[ (1 + &#92;phi x + &#92;phi^2x^2 + &#92;phi^3x^3 + &#92;cdots) - (1 + &#92;psi x + &#92;psi^2 x^2 + &#92;psi^3 x^3 + &#92;cdots) &#92;right] &#92;&#92; = &#92;frac{1}{&#92;sqrt 5} &#92;left[ (&#92;phi - &#92;psi)x + (&#92;phi^2 - &#92;psi^2)x^2 + (&#92;phi^3 - &#92;psi^3)x^3 + &#92;cdots &#92;right].' class='latex' /></p>
<p>Therefore, we have just concluded that</p>
<p><img src='http://s0.wp.com/latex.php?latex=F_n+%3D+%5Cfrac%7B%5Cphi%5En+-+%5Cpsi%5En%7D%7B%5Csqrt+5%7D+%3D+%5Cfrac%7B1%7D%7B%5Csqrt+5%7D+%5Cleft%5B+%5Cleft%28+%5Cfrac%7B1+%2B+%5Csqrt+5%7D%7B2%7D+%5Cright%29%5En+-+%5Cleft%28+%5Cfrac%7B1+-+%5Csqrt+5%7D%7B2%7D+%5Cright%29%5En+%5Cright%5D.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_n = &#92;frac{&#92;phi^n - &#92;psi^n}{&#92;sqrt 5} = &#92;frac{1}{&#92;sqrt 5} &#92;left[ &#92;left( &#92;frac{1 + &#92;sqrt 5}{2} &#92;right)^n - &#92;left( &#92;frac{1 - &#92;sqrt 5}{2} &#92;right)^n &#92;right].' title='F_n = &#92;frac{&#92;phi^n - &#92;psi^n}{&#92;sqrt 5} = &#92;frac{1}{&#92;sqrt 5} &#92;left[ &#92;left( &#92;frac{1 + &#92;sqrt 5}{2} &#92;right)^n - &#92;left( &#92;frac{1 - &#92;sqrt 5}{2} &#92;right)^n &#92;right].' class='latex' /></p>
<p>Now that we have worked so hard to get this formula, let&#8217;s take a step back and appreciate it. This formula is useful in several ways. For starters, it allows us to compute <img src='http://s0.wp.com/latex.php?latex=F_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_n' title='F_n' class='latex' /> much faster. For example, using the method of building up <img src='http://s0.wp.com/latex.php?latex=F_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_n' title='F_n' class='latex' /> from all the previous terms, we have to do a linear number of operations, or <img src='http://s0.wp.com/latex.php?latex=O%28n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='O(n)' title='O(n)' class='latex' /> in asymptotic notation. However, using the formula, we can compute <img src='http://s0.wp.com/latex.php?latex=%5Cphi%5En&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;phi^n' title='&#92;phi^n' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cpsi%5En&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;psi^n' title='&#92;psi^n' class='latex' /> by repeatedly squaring <img src='http://s0.wp.com/latex.php?latex=%5Cphi&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;phi' title='&#92;phi' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cpsi&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;psi' title='&#92;psi' class='latex' />, which is logarithmic asymptotically, or <img src='http://s0.wp.com/latex.php?latex=O%28%5Clog+n%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='O(&#92;log n)' title='O(&#92;log n)' class='latex' />. Furthermore, this formula shows us the exponential growth in <img src='http://s0.wp.com/latex.php?latex=F_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_n' title='F_n' class='latex' />. Not only that, it is crystal clear from this formula where the golden ratio comes from! Note that <img src='http://s0.wp.com/latex.php?latex=%7C%5Cpsi%7C+%3C+1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='|&#92;psi| &lt; 1' title='|&#92;psi| &lt; 1' class='latex' />, so as <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n' title='n' class='latex' /> gets large, the <img src='http://s0.wp.com/latex.php?latex=%5Cpsi%5En&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;psi^n' title='&#92;psi^n' class='latex' /> term becomes negligible, which is why for large <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n' title='n' class='latex' />, <img src='http://s0.wp.com/latex.php?latex=F_n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='F_n' title='F_n' class='latex' /> is approximately <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7B1%7D%7B%5Csqrt+5%7D+%5Cphi%5En&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;frac{1}{&#92;sqrt 5} &#92;phi^n' title='&#92;frac{1}{&#92;sqrt 5} &#92;phi^n' class='latex' />.</p>
<p>To recap, from this post you should have learned the following:</p>
<ul>
<li>What generating functions are and how they can be used to find closed formulae for sequences given by linear recurrences</li>
<li>What the Fibonacci numbers are and how they arise in nature</li>
<li>How to find a closed formula for the Fibonacci numbers using generating functions</li>
<li>Why knowing the closed formula allows us to compute terms faster</li>
<li>How the closed formula for the Fibonacci numbers sheds light on its growth rate and where the golden ratio comes about</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nolaymanleftbehind.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nolaymanleftbehind.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=74&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nolaymanleftbehind.wordpress.com/2011/07/10/combinatorics-power-of-generating-functions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0342b25cba1b6d106701db092ab3ec56?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aguo777</media:title>
		</media:content>
	</item>
		<item>
		<title>Linear Algebra: What matrices actually are</title>
		<link>http://nolaymanleftbehind.wordpress.com/2011/07/10/linear-algebra-what-matrices-actually-are/</link>
		<comments>http://nolaymanleftbehind.wordpress.com/2011/07/10/linear-algebra-what-matrices-actually-are/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 09:27:30 +0000</pubDate>
		<dc:creator>Alan Guo</dc:creator>
				<category><![CDATA[Algebra]]></category>
		<category><![CDATA[Linear Algebra]]></category>
		<category><![CDATA[Mathematics]]></category>

		<guid isPermaLink="false">http://nolaymanleftbehind.wordpress.com/?p=11</guid>
		<description><![CDATA[Most high school students in the United States learn about matrices and matrix multiplication, but they often are not taught why matrix multiplication works the way it does. Adding matrices is easy: you just add the corresponding entries. However, matrix multiplication does not work this way, and for someone who doesn&#8217;t understand the theory behind matrices, [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=11&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Most high school students in the United States learn about matrices and matrix multiplication, but they often are not taught <em>why</em> matrix multiplication works the way it does. Adding matrices is easy: you just add the corresponding entries. However, matrix multiplication does not work this way, and for someone who doesn&#8217;t understand the theory behind matrices, this way of multiplying matrices may seem extremely contrived and strange. To truly understand matrices, we view them as representations of part of a bigger picture. Matrices represent <em>functions</em> between spaces, called vector spaces, and not just any functions either, but <strong>linear</strong> functions. This is in fact why <strong>linear algebra</strong> focuses on matrices. The two fundamental facts about matrices is that <em>every matrix represents some linear function</em>, and <em>every linear function is represented by a matrix</em>. Therefore, there is in fact a one-to-one correspondence between matrices and linear functions. We&#8217;ll show that multiplying matrices corresponds to composing the functions that they represent. Along the way, we&#8217;ll examine what matrices are good for and why linear algebra sprang up in the first place.</p>
<p><span id="more-11"></span></p>
<p>Most likely, if you&#8217;ve taken algebra in high school, you&#8217;ve seen something like the following:</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Bpmatrix%7D+2+%26+1+%5C%5C+4+%26+3+%5Cend%7Bpmatrix%7D.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix}.' title='&#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix}.' class='latex' /></p>
<p>Your high school algebra teacher probably told you this thing was a &#8220;matrix.&#8221;  You then learned how to do things with matrices. For example, you can add two matrices, and the operation is fairly intuitive:</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Bpmatrix%7D+2+%26+1+%5C%5C+4+%26+3+%5Cend%7Bpmatrix%7D+%2B+%5Cbegin%7Bpmatrix%7D+1+%26+2+%5C%5C+1+%26+0+%5Cend%7Bpmatrix%7D+%3D+%5Cbegin%7Bpmatrix%7D+3+%26+3+%5C%5C+5+%26+3+%5Cend%7Bpmatrix%7D.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix} + &#92;begin{pmatrix} 1 &amp; 2 &#92;&#92; 1 &amp; 0 &#92;end{pmatrix} = &#92;begin{pmatrix} 3 &amp; 3 &#92;&#92; 5 &amp; 3 &#92;end{pmatrix}.' title='&#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix} + &#92;begin{pmatrix} 1 &amp; 2 &#92;&#92; 1 &amp; 0 &#92;end{pmatrix} = &#92;begin{pmatrix} 3 &amp; 3 &#92;&#92; 5 &amp; 3 &#92;end{pmatrix}.' class='latex' /></p>
<p>You can also subtract matrices, which works similarly. You can multiply a matrix by a number:</p>
<p><img src='http://s0.wp.com/latex.php?latex=2+%5Ctimes+%5Cbegin%7Bpmatrix%7D+2+%26+1+%5C%5C+4+%26+3+%5Cend%7Bpmatrix%7D+%3D+%5Cbegin%7Bpmatrix%7D+4+%26+2+%5C%5C+8+%26+6+%5Cend%7Bpmatrix%7D.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='2 &#92;times &#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix} = &#92;begin{pmatrix} 4 &amp; 2 &#92;&#92; 8 &amp; 6 &#92;end{pmatrix}.' title='2 &#92;times &#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix} = &#92;begin{pmatrix} 4 &amp; 2 &#92;&#92; 8 &amp; 6 &#92;end{pmatrix}.' class='latex' /></p>
<p>Then, when you were taught how to multiply matrices, everything seemed wrong:</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Bpmatrix%7D+2+%26+1+%5C%5C+4+%26+3+%5Cend%7Bpmatrix%7D%5Cbegin%7Bpmatrix%7D+1+%26+2+%5C%5C+1+%26+0+%5Cend%7Bpmatrix%7D+%3D+%5Cbegin%7Bpmatrix%7D+3+%26+4+%5C%5C+7+%26+8+%5Cend%7Bpmatrix%7D.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix}&#92;begin{pmatrix} 1 &amp; 2 &#92;&#92; 1 &amp; 0 &#92;end{pmatrix} = &#92;begin{pmatrix} 3 &amp; 4 &#92;&#92; 7 &amp; 8 &#92;end{pmatrix}.' title='&#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix}&#92;begin{pmatrix} 1 &amp; 2 &#92;&#92; 1 &amp; 0 &#92;end{pmatrix} = &#92;begin{pmatrix} 3 &amp; 4 &#92;&#92; 7 &amp; 8 &#92;end{pmatrix}.' class='latex' /></p>
<p>That is, to find the entry in the <img src='http://s0.wp.com/latex.php?latex=i&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='i' title='i' class='latex' />-th row, <img src='http://s0.wp.com/latex.php?latex=j&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='j' title='j' class='latex' />-th column of the product, you look at the <img src='http://s0.wp.com/latex.php?latex=i&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='i' title='i' class='latex' />-th row of the first matrix, the <img src='http://s0.wp.com/latex.php?latex=j&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='j' title='j' class='latex' />-th column of the second matrix, you multiply together their corresponding numbers, and then you add up the results to get the entry in that position. In the above example, the 1st row, 2nd column entry is a <img src='http://s0.wp.com/latex.php?latex=4&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='4' title='4' class='latex' /> because the 1st row of the first matrix is <img src='http://s0.wp.com/latex.php?latex=%282%2C+1%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='(2, 1)' title='(2, 1)' class='latex' />, the 2nd column of the second matrix is <img src='http://s0.wp.com/latex.php?latex=%282%2C+0%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='(2, 0)' title='(2, 0)' class='latex' />, and we have <img src='http://s0.wp.com/latex.php?latex=4+%3D+2+%5Ctimes+2+%2B+1+%5Ctimes+0&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='4 = 2 &#92;times 2 + 1 &#92;times 0' title='4 = 2 &#92;times 2 + 1 &#92;times 0' class='latex' />. Moreover, this implies that matrix multiplication isn&#8217;t even commutative! If we switch the order of multiplication above, we get</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Bpmatrix%7D+1+%26+2+%5C%5C+1+%26+0+%5Cend%7Bpmatrix%7D%5Cbegin%7Bpmatrix%7D+2+%26+1+%5C%5C+4+%26+3+%5Cend%7Bpmatrix%7D+%3D+%5Cbegin%7Bpmatrix%7D+10+%26+7+%5C%5C+2+%26+1+%5Cend%7Bpmatrix%7D.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;begin{pmatrix} 1 &amp; 2 &#92;&#92; 1 &amp; 0 &#92;end{pmatrix}&#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix} = &#92;begin{pmatrix} 10 &amp; 7 &#92;&#92; 2 &amp; 1 &#92;end{pmatrix}.' title='&#92;begin{pmatrix} 1 &amp; 2 &#92;&#92; 1 &amp; 0 &#92;end{pmatrix}&#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix} = &#92;begin{pmatrix} 10 &amp; 7 &#92;&#92; 2 &amp; 1 &#92;end{pmatrix}.' class='latex' /></p>
<p>How come matrix multiplication doesn&#8217;t work like addition and subtraction? And if multiplication works this way, how the heck does division work? The goal of this post is to answer these questions.</p>
<p>To understand why matrix multiplication works this way, it&#8217;s necessary to understand what matrices actually are. But before we get to that, let&#8217;s briefly take a look at why we care about matrices in the first place. The most basic application of matrices is solving systems of linear equations. A linear equation is one in which all the variables appear by themselves with no powers; they don&#8217;t get multiplied with each other or themselves, and no funny functions either. An example of a system of linear equations is</p>
<p><img src='http://s0.wp.com/latex.php?latex=2x+%2By+%3D+3+%5C%5C+4x+%2B+3y+%3D+7&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='2x +y = 3 &#92;&#92; 4x + 3y = 7' title='2x +y = 3 &#92;&#92; 4x + 3y = 7' class='latex' /></p>
<p>The solution to this system is <img src='http://s0.wp.com/latex.php?latex=x+%3D+1%2C+y+%3D+1&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='x = 1, y = 1' title='x = 1, y = 1' class='latex' />. Such equations seem simple, but they easily arise in life. For example, let&#8217;s say I have two friends Alice and Bob who went shopping for candy. Alice bought 2 chocolate bars and 1 bag of skittles and spent $3, whereas Bob bought 4 chocolate bars and 3 bags of skittles and spent $7. If we want to figure out how much chocolate bars and skittles cost, we can let <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='x' title='x' class='latex' /> be the price of a chocolate bar and <img src='http://s0.wp.com/latex.php?latex=y&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='y' title='y' class='latex' /> be the price of a bag of skittles and the variables would satisfy the above system of linear equations. Therefore we can deduce that a chocolate bar costs $1 and so does a bag of skittles. This system was particularly easy to solve because one can guess and check the solution, but in general, with <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='n' title='n' class='latex' /> variables and equations instead of 2, it&#8217;s much harder. That&#8217;s where matrices come in! Note that, by matrix multiplication, the above system of linear equations can be re-written as</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Bpmatrix%7D+2+%26+1+%5C%5C+4+%26+3+%5Cend%7Bpmatrix%7D+%5Cbegin%7Bpmatrix%7D+x+%5C%5C+y+%5Cend%7Bpmatrix%7D+%3D+%5Cbegin%7Bpmatrix%7D+3+%5C%5C+7+%5Cend%7Bpmatrix%7D.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix} &#92;begin{pmatrix} x &#92;&#92; y &#92;end{pmatrix} = &#92;begin{pmatrix} 3 &#92;&#92; 7 &#92;end{pmatrix}.' title='&#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix} &#92;begin{pmatrix} x &#92;&#92; y &#92;end{pmatrix} = &#92;begin{pmatrix} 3 &#92;&#92; 7 &#92;end{pmatrix}.' class='latex' /></p>
<p>If only we could find a matrix <img src='http://s0.wp.com/latex.php?latex=A&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='A' title='A' class='latex' />, which is the inverse of the matrix <img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Bpmatrix%7D+2+%26+1+%5C%5C+4+%26+3+%5Cend%7Bpmatrix%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix}' title='&#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix}' class='latex' />, so that if we multiplied both sides of the equation (on the left) by <img src='http://s0.wp.com/latex.php?latex=A&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='A' title='A' class='latex' /> we&#8217;d get</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Bpmatrix%7D+x+%5C%5C+y+%5Cend%7Bpmatrix%7D+%3D+A+%5Cbegin%7Bpmatrix%7D+3+%5C%5C+7+%5Cend%7Bpmatrix%7D.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;begin{pmatrix} x &#92;&#92; y &#92;end{pmatrix} = A &#92;begin{pmatrix} 3 &#92;&#92; 7 &#92;end{pmatrix}.' title='&#92;begin{pmatrix} x &#92;&#92; y &#92;end{pmatrix} = A &#92;begin{pmatrix} 3 &#92;&#92; 7 &#92;end{pmatrix}.' class='latex' /></p>
<p>The applications of matrices reach far beyond this simple problem, but for now we&#8217;ll use this as our motivation. Let&#8217;s get back to understanding what matrices are. To understand matrices, we have to know what vectors are. A <strong>vector space</strong> is a set with a specific structure, and a <strong>vector</strong> is simply an element of the vector space. For now, for technical simplicity, we&#8217;ll stick with vector spaces over the real numbers, also known as <strong>real vector spaces</strong>. A real vector space is basically what you think of when you think of space. The number line is a 1-dimensional real vector space, the x-y plane is a 2-dimensional real vector space, 3-dimensional space is a 3-dimensional real vector space, and so on. If you learned about vectors in school, then you are probably familiar with thinking about them as arrows which you can add together, multiply by a real number, and so on, but multiplying vectors together works differently. Does this sound familiar? It should. That&#8217;s how matrices work, and it&#8217;s no coincidence.</p>
<p>The most important fact about vector spaces is that they always have a basis. A <strong>basis</strong> of a vector space is a set of vectors such that any vector in the space can be written as a linear combination of those basis vectors. If <img src='http://s0.wp.com/latex.php?latex=v_1%2C+v_2%2C+v_3&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='v_1, v_2, v_3' title='v_1, v_2, v_3' class='latex' /> are your basis vectors, then <img src='http://s0.wp.com/latex.php?latex=av_1+%2B+bv_2+%2B+cv_3&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='av_1 + bv_2 + cv_3' title='av_1 + bv_2 + cv_3' class='latex' /> is a linear combination if <img src='http://s0.wp.com/latex.php?latex=a%2Cb%2Cc&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='a,b,c' title='a,b,c' class='latex' /> are real numbers. A concrete example is the following: a basis for the x-y plane is the vectors <img src='http://s0.wp.com/latex.php?latex=%281%2C0%29%2C+%280%2C1%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='(1,0), (0,1)' title='(1,0), (0,1)' class='latex' />. Any vector is of the form <img src='http://s0.wp.com/latex.php?latex=%28a%2Cb%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='(a,b)' title='(a,b)' class='latex' /> which can be written as</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Bpmatrix%7D+a+%5C%5C+b+%5Cend%7Bpmatrix%7D+%3D+a+%5Cbegin%7Bpmatrix%7D+1+%5C%5C+0+%5Cend%7Bpmatrix%7D+%2B+b+%5Cbegin%7Bpmatrix%7D+0+%5C%5C+1+%5Cend%7Bpmatrix%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;begin{pmatrix} a &#92;&#92; b &#92;end{pmatrix} = a &#92;begin{pmatrix} 1 &#92;&#92; 0 &#92;end{pmatrix} + b &#92;begin{pmatrix} 0 &#92;&#92; 1 &#92;end{pmatrix}' title='&#92;begin{pmatrix} a &#92;&#92; b &#92;end{pmatrix} = a &#92;begin{pmatrix} 1 &#92;&#92; 0 &#92;end{pmatrix} + b &#92;begin{pmatrix} 0 &#92;&#92; 1 &#92;end{pmatrix}' class='latex' /></p>
<p>so we indeed have a basis! This is not the only possible basis. In fact, the vectors in our basis don&#8217;t even have to be perpendicular! For example, the vectors <img src='http://s0.wp.com/latex.php?latex=%281%2C0%29%2C+%281%2C1%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='(1,0), (1,1)' title='(1,0), (1,1)' class='latex' /> form a basis since we can write</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Bpmatrix%7D+a+%5C%5C+b+%5Cend%7Bpmatrix%7D+%3D+%28a-b%29+%5Cbegin%7Bpmatrix%7D+1+%5C%5C+0+%5Cend%7Bpmatrix%7D+%2B+b+%5Cbegin%7Bpmatrix%7D+1+%5C%5C+1+%5Cend%7Bpmatrix%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;begin{pmatrix} a &#92;&#92; b &#92;end{pmatrix} = (a-b) &#92;begin{pmatrix} 1 &#92;&#92; 0 &#92;end{pmatrix} + b &#92;begin{pmatrix} 1 &#92;&#92; 1 &#92;end{pmatrix}' title='&#92;begin{pmatrix} a &#92;&#92; b &#92;end{pmatrix} = (a-b) &#92;begin{pmatrix} 1 &#92;&#92; 0 &#92;end{pmatrix} + b &#92;begin{pmatrix} 1 &#92;&#92; 1 &#92;end{pmatrix}' class='latex' />.</p>
<p>Now, a <strong>linear transformation</strong> is simply a function between two vector spaces that happens to be <strong>linear</strong>. Being linear is an extremely nice property. A function <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f' title='f' class='latex' /> is linear if the following two properties hold:</p>
<p><img src='http://s0.wp.com/latex.php?latex=f%28x%2By%29+%3D+f%28x%29+%2B+f%28y%29+%5C%5C+f%28ax%29+%3D+af%28x%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(x+y) = f(x) + f(y) &#92;&#92; f(ax) = af(x)' title='f(x+y) = f(x) + f(y) &#92;&#92; f(ax) = af(x)' class='latex' /></p>
<p>For example, the function <img src='http://s0.wp.com/latex.php?latex=f%28x%29+%3D+x%5E2&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(x) = x^2' title='f(x) = x^2' class='latex' /> defined on the real line is not linear, since <img src='http://s0.wp.com/latex.php?latex=f%28x%2By%29+%3D+%28x%2By%29%5E2+%3D+x%5E2+%2B+y%5E2+%2B+2xy&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(x+y) = (x+y)^2 = x^2 + y^2 + 2xy' title='f(x+y) = (x+y)^2 = x^2 + y^2 + 2xy' class='latex' /> whereas <img src='http://s0.wp.com/latex.php?latex=f%28x%29+%2B+f%28y%29+%3D+x%5E2+%2B+y%5E2&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(x) + f(y) = x^2 + y^2' title='f(x) + f(y) = x^2 + y^2' class='latex' />. Now, we connect together all the ideas we&#8217;ve talked about so far: matrices, basis, and linear transformations. The connection is that <strong>matrices are representations of linear transformations</strong>, and you can figure out how to write the matrix down by seeing how it acts on a basis. To understand the first statement, we need to see why the second is true. The idea is that any vector is a linear combination of basis vectors, so you only need to know how the linear transformation affects each basis vector. This is because, since the function is linear, if we have an arbitrary vector <img src='http://s0.wp.com/latex.php?latex=v&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='v' title='v' class='latex' /> which can be written as a linear combination <img src='http://s0.wp.com/latex.php?latex=v+%3D+av_1+%2B+bv_2+%2B+cv_3&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='v = av_1 + bv_2 + cv_3' title='v = av_1 + bv_2 + cv_3' class='latex' />, then</p>
<p><img src='http://s0.wp.com/latex.php?latex=f%28v%29+%3D+f%28av_1+%2B+bv_2+%2B+cv_3%29+%3D+af%28v_1%29+%2B+bf%28v_2%29+%2B+cf%28v_3%29.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(v) = f(av_1 + bv_2 + cv_3) = af(v_1) + bf(v_2) + cf(v_3).' title='f(v) = f(av_1 + bv_2 + cv_3) = af(v_1) + bf(v_2) + cf(v_3).' class='latex' /></p>
<p>Notice that the value of <img src='http://s0.wp.com/latex.php?latex=f%28v%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(v)' title='f(v)' class='latex' /> is completely determined by the values <img src='http://s0.wp.com/latex.php?latex=f%28v_1%29%2C+f%28v_2%29%2C+f%28v_3%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(v_1), f(v_2), f(v_3)' title='f(v_1), f(v_2), f(v_3)' class='latex' />, and so that&#8217;s all the information we need to completely define the linear transformation. Where does the matrix come in? Well, once we choose a basis for both the domain and the target of the linear transformation, the columns of the matrix will represent the images of the basis vectors under the function. For example, suppose we have a linear transformation <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f' title='f' class='latex' /> which maps <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%5E3&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;mathbb{R}^3' title='&#92;mathbb{R}^3' class='latex' /> to <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%5E2&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;mathbb{R}^2' title='&#92;mathbb{R}^2' class='latex' />, meaning it takes in 3-dimensional vectors and spits out 2-dimensional vectors. Right now <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f' title='f' class='latex' /> is just some abstract function for which we have no way of writing down on paper. Let&#8217;s pick a basis for both our domain (3-space) and our target (2-space, or the plane). A nice choice would be <img src='http://s0.wp.com/latex.php?latex=v_1+%3D+%281%2C0%2C0%29%2C+v_2+%3D+%280%2C1%2C0%29%2C+v_3+%3D+%280%2C0%2C1%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='v_1 = (1,0,0), v_2 = (0,1,0), v_3 = (0,0,1)' title='v_1 = (1,0,0), v_2 = (0,1,0), v_3 = (0,0,1)' class='latex' /> for the former and <img src='http://s0.wp.com/latex.php?latex=w_1+%3D+%281%2C0%29%2C+w_2+%3D+%280%2C1%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='w_1 = (1,0), w_2 = (0,1)' title='w_1 = (1,0), w_2 = (0,1)' class='latex' /> for the latter. All we need to know is how <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f' title='f' class='latex' /> affects <img src='http://s0.wp.com/latex.php?latex=v_1%2C+v_2%2C+v_3&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='v_1, v_2, v_3' title='v_1, v_2, v_3' class='latex' />, and the basis for the target is for writing down the values <img src='http://s0.wp.com/latex.php?latex=f%28v_1%29%2C+f%28v_2%29%2C+f%28v_3%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(v_1), f(v_2), f(v_3)' title='f(v_1), f(v_2), f(v_3)' class='latex' /> concretely. The matrix <img src='http://s0.wp.com/latex.php?latex=M&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='M' title='M' class='latex' /> for our function will be a 2-by-3 matrix, where the 3 columns are indexed by <img src='http://s0.wp.com/latex.php?latex=v_1%2C+v_2%2C+v_3&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='v_1, v_2, v_3' title='v_1, v_2, v_3' class='latex' /> and the 2 rows are indexed by <img src='http://s0.wp.com/latex.php?latex=w_1%2C+w_2&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='w_1, w_2' title='w_1, w_2' class='latex' />. All we need to write down <img src='http://s0.wp.com/latex.php?latex=M&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='M' title='M' class='latex' /> are the values <img src='http://s0.wp.com/latex.php?latex=f%28v_1%29%2C+f%28v_2%29%2C+f%28v_3%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(v_1), f(v_2), f(v_3)' title='f(v_1), f(v_2), f(v_3)' class='latex' />. For concreteness, let&#8217;s say</p>
<p><img src='http://s0.wp.com/latex.php?latex=f%28v_1%29+%3D+2w_1+%2B+4w_2+%5C%5C+f%28v_2%29+%3D+w_1+-+w_2+%5C%5C+f%28v_3%29+%3D+w_2.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(v_1) = 2w_1 + 4w_2 &#92;&#92; f(v_2) = w_1 - w_2 &#92;&#92; f(v_3) = w_2.' title='f(v_1) = 2w_1 + 4w_2 &#92;&#92; f(v_2) = w_1 - w_2 &#92;&#92; f(v_3) = w_2.' class='latex' /></p>
<p>Then the corresponding matrix will be</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Bpmatrix%7D+2+%26+1+%26+0+%5C%5C+4+%26+-1+%26+1+%5Cend%7Bpmatrix%7D.&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;begin{pmatrix} 2 &amp; 1 &amp; 0 &#92;&#92; 4 &amp; -1 &amp; 1 &#92;end{pmatrix}.' title='&#92;begin{pmatrix} 2 &amp; 1 &amp; 0 &#92;&#92; 4 &amp; -1 &amp; 1 &#92;end{pmatrix}.' class='latex' /></p>
<p>The reason why this works is that matrix multiplication was designed so that if you multiply a matrix by the vector with all zeroes except a 1 in the <img src='http://s0.wp.com/latex.php?latex=i&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='i' title='i' class='latex' />-th entry, then the result is just the <img src='http://s0.wp.com/latex.php?latex=i&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='i' title='i' class='latex' />-th column of the matrix. You can check this for yourself. So we know that the matrix <img src='http://s0.wp.com/latex.php?latex=M&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='M' title='M' class='latex' /> works correctly when applied to (multiplied to) basis vectors. But also matrices satisfy the same properties as linear transformations, namely <img src='http://s0.wp.com/latex.php?latex=M%28x+%2B+y%29+%3D+Mx+%2B+My&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='M(x + y) = Mx + My' title='M(x + y) = Mx + My' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=M%28ax%29+%3D+aMx&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='M(ax) = aMx' title='M(ax) = aMx' class='latex' />, where <img src='http://s0.wp.com/latex.php?latex=x%2Cy&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='x,y' title='x,y' class='latex' /> are vectors and <img src='http://s0.wp.com/latex.php?latex=a&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='a' title='a' class='latex' /> is a real number. Therefore <img src='http://s0.wp.com/latex.php?latex=M&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='M' title='M' class='latex' /> works for all vectors, so it&#8217;s the correct representation of <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f' title='f' class='latex' />. Note that if we had chosen different vectors for the basis vectors, the matrix would look different. Therefore, matrices are not natural in the sense that they depend on what bases we choose.</p>
<p>Now, finally to answer the question posed at the beginning. Why does matrix multiplication work the way it does? Let&#8217;s take a look at the two matrices we had in the beginning: <img src='http://s0.wp.com/latex.php?latex=A+%3D+%5Cbegin%7Bpmatrix%7D+2+%26+1+%5C%5C+4+%26+3+%5Cend%7Bpmatrix%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='A = &#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix}' title='A = &#92;begin{pmatrix} 2 &amp; 1 &#92;&#92; 4 &amp; 3 &#92;end{pmatrix}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=B+%3D+%5Cbegin%7Bpmatrix%7D+1+%26+2+%5C%5C+1+%26+0+%5Cend%7Bpmatrix%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='B = &#92;begin{pmatrix} 1 &amp; 2 &#92;&#92; 1 &amp; 0 &#92;end{pmatrix}' title='B = &#92;begin{pmatrix} 1 &amp; 2 &#92;&#92; 1 &amp; 0 &#92;end{pmatrix}' class='latex' />. We know that these correspond to linear functions on the plane, let&#8217;s call them <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f' title='f' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=g&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='g' title='g' class='latex' />, respectively. Multiplying matrices corresponds to <strong>composing</strong> their functions. Therefore, doing <img src='http://s0.wp.com/latex.php?latex=ABx&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='ABx' title='ABx' class='latex' /> is the same as doing <img src='http://s0.wp.com/latex.php?latex=f%28g%28x%29%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(g(x))' title='f(g(x))' class='latex' /> for any vector <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='x' title='x' class='latex' />. To determine what the matrix <img src='http://s0.wp.com/latex.php?latex=AB&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='AB' title='AB' class='latex' /> should look like, we can see how it affects the basis vectors <img src='http://s0.wp.com/latex.php?latex=w_1+%3D+%281%2C0%29%2C+w_2+%3D+%280%2C1%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='w_1 = (1,0), w_2 = (0,1)' title='w_1 = (1,0), w_2 = (0,1)' class='latex' />. We have</p>
<p><img src='http://s0.wp.com/latex.php?latex=f%28g%28w_1%29%29+%3D+f%28w_1+%2B+w_2%29+%3D+f%28w_1%29+%2B+f%28w_2%29+%5C%5C+%3D+%282w_1+%2B+4w_2%29+%2B+%28w_1+%2B+3w_2%29+%3D+3w_1+%2B+7w_2&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(g(w_1)) = f(w_1 + w_2) = f(w_1) + f(w_2) &#92;&#92; = (2w_1 + 4w_2) + (w_1 + 3w_2) = 3w_1 + 7w_2' title='f(g(w_1)) = f(w_1 + w_2) = f(w_1) + f(w_2) &#92;&#92; = (2w_1 + 4w_2) + (w_1 + 3w_2) = 3w_1 + 7w_2' class='latex' /></p>
<p>so the first column of <img src='http://s0.wp.com/latex.php?latex=AB&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='AB' title='AB' class='latex' /> should be <img src='http://s0.wp.com/latex.php?latex=%283%2C7%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='(3,7)' title='(3,7)' class='latex' />, and</p>
<p><img src='http://s0.wp.com/latex.php?latex=f%28g%28w_2%29%29+%3D+f%282w_1%29+%3D+2f%28w_1%29+%3D+2%282w_1+%2B+4w_2%29+%3D+4w_1+%2B+8w_2&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(g(w_2)) = f(2w_1) = 2f(w_1) = 2(2w_1 + 4w_2) = 4w_1 + 8w_2' title='f(g(w_2)) = f(2w_1) = 2f(w_1) = 2(2w_1 + 4w_2) = 4w_1 + 8w_2' class='latex' /></p>
<p>so the second column of <img src='http://s0.wp.com/latex.php?latex=AB&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='AB' title='AB' class='latex' /> should be <img src='http://s0.wp.com/latex.php?latex=%284%2C8%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='(4,8)' title='(4,8)' class='latex' />. Indeed, this agrees with the answer we got in the beginning by matrix multiplication! Although this is not at all a rigorous proof, since it&#8217;s just an example, it captures the idea of the reason matrix multiplication is the way it is.</p>
<p>Now that we understand how and why matrix multiplication works the way it does, how does matrix division work? You are probably familiar with functional inverses. The <strong>inverse</strong> of a function <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f' title='f' class='latex' /> is a function <img src='http://s0.wp.com/latex.php?latex=g&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='g' title='g' class='latex' /> such that <img src='http://s0.wp.com/latex.php?latex=f%28g%28x%29%29+%3D+x+%3D+g%28f%28x%29%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(g(x)) = x = g(f(x))' title='f(g(x)) = x = g(f(x))' class='latex' /> for all <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='x' title='x' class='latex' />. Since multiplication of matrices corresponds to composition of functions, it only makes sense that the multiplicative inverse of a matrix is the compositional inverse of the corresponding function. That&#8217;s why not all matrices have multiplicative inverses. Some functions don&#8217;t have compositional inverses! For example, the linear function <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f' title='f' class='latex' /> mapping <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%5E2&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;mathbb{R}^2' title='&#92;mathbb{R}^2' class='latex' /> to <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;mathbb{R}' title='&#92;mathbb{R}' class='latex' /> defined by <img src='http://s0.wp.com/latex.php?latex=f%28x%2Cy%29+%3D+x%2By&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f(x,y) = x+y' title='f(x,y) = x+y' class='latex' /> has no inverse, since many vectors get mapped to the same value (what would <img src='http://s0.wp.com/latex.php?latex=f%5E%7B-1%7D%280%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='f^{-1}(0)' title='f^{-1}(0)' class='latex' /> be? <img src='http://s0.wp.com/latex.php?latex=%280%2C0%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='(0,0)' title='(0,0)' class='latex' />? <img src='http://s0.wp.com/latex.php?latex=%281%2C-1%29&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='(1,-1)' title='(1,-1)' class='latex' />?). This corresponds to the fact that the 1&#215;2 matrix <img src='http://s0.wp.com/latex.php?latex=%5Cbegin%7Bpmatrix%7D+1+%26+1+%5Cend%7Bpmatrix%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='&#92;begin{pmatrix} 1 &amp; 1 &#92;end{pmatrix}' title='&#92;begin{pmatrix} 1 &amp; 1 &#92;end{pmatrix}' class='latex' /> has no multiplicative inverse. So dividing by a matrix <img src='http://s0.wp.com/latex.php?latex=B&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='B' title='B' class='latex' /> is just multiplication by <img src='http://s0.wp.com/latex.php?latex=B%5E%7B-1%7D&amp;bg=ffffff&amp;fg=545454&amp;s=0' alt='B^{-1}' title='B^{-1}' class='latex' />, if it exists. There are algorithms for computing inverses of matrices, but we&#8217;ll save that for another post.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nolaymanleftbehind.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nolaymanleftbehind.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nolaymanleftbehind.wordpress.com&#038;blog=24976627&#038;post=11&#038;subd=nolaymanleftbehind&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nolaymanleftbehind.wordpress.com/2011/07/10/linear-algebra-what-matrices-actually-are/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0342b25cba1b6d106701db092ab3ec56?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aguo777</media:title>
		</media:content>
	</item>
	</channel>
</rss>
