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

<channel>
	<title>The Lowly Mathematician</title>
	<atom:link href="http://lowlymath.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://lowlymath.net</link>
	<description>The Disparate Notions of the Lowly Mathematician</description>
	<pubDate>Mon, 08 Sep 2008 04:39:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Grad School Tags</title>
		<link>http://lowlymath.net/2008/grad-school-tags/</link>
		<comments>http://lowlymath.net/2008/grad-school-tags/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 04:39:54 +0000</pubDate>
		<dc:creator>jfredett</dc:creator>
		
		<guid isPermaLink="false">http://lowlymath.net/2008/grad-school-tags/</guid>
		<description><![CDATA[You can see all the various sites I&#8217;ve bookmarked about Gradschool @:
http://feeds.delicious.com/v2/rss/jfredett/gradschool 
&#160;
It&#8217;s an RSS feed, but also the only sane url-link to the specific tag. It&#8217;s just my del.icio.us space under the tag &#8220;gradschool&#8221;
]]></description>
			<content:encoded><![CDATA[<p>You can see all the various sites I&#8217;ve bookmarked about Gradschool @:</p>
<p><a href="http://feeds.delicious.com/v2/rss/jfredett/gradschool">http://feeds.delicious.com/v2/rss/jfredett/gradschool</a> </p>
<p>&nbsp;</p>
<p>It&#8217;s an RSS feed, but also the only sane url-link to the specific tag. It&#8217;s just my del.icio.us space under the tag &#8220;gradschool&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://lowlymath.net/2008/grad-school-tags/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Down the Graduate School Rabbit Hole</title>
		<link>http://lowlymath.net/2008/down-the-graduate-school-rabbit-hole/</link>
		<comments>http://lowlymath.net/2008/down-the-graduate-school-rabbit-hole/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 04:31:45 +0000</pubDate>
		<dc:creator>jfredett</dc:creator>
		
		<guid isPermaLink="false">http://lowlymath.net/2008/down-the-graduate-school-rabbit-hole/</guid>
		<description><![CDATA[So, I know my posts are quite sparse to begin with, and sporadic at that. But, sadly, I&#8217;m here to tell you, my faithful and equally sporadic readers, that problem will be getting worse.
Heres my situation, I transferred last year from one school (WPI) to another, cheaper school (WSC)[1]. In doing so, two things happened.

I [...]]]></description>
			<content:encoded><![CDATA[<p>So, I know my posts are quite sparse to begin with, and sporadic at that. But, sadly, I&#8217;m here to tell you, my faithful and equally sporadic readers, that problem will be getting worse.</p>
<p>Heres my situation, I transferred last year from one school (WPI) to another, cheaper school (WSC)[1]. In doing so, two things happened.</p>
<ol>
<li>I had to redo a fair deal of work. Many credits didn&#8217;t transfer, weren&#8217;t applicable, or became electives due to requirement differences</li>
<li>I suffered a bit of a blow to my now fragile GPA, I&#8217;ve had 10 classes so far, and due to the rapid change of material and teaching style, as well as the new stresses and frustrations of repeating much of what I already knew, or taking classes I had no interest in, I did not do very well in most of them. My GPA is a pitiful 2.6&#8230; (I got a <em>fuckload</em> of C&#8217;s.)</li>
</ol>
<p>Now, fortunately, I have good grades in my Core courses, most of the outliers (Philosophy excepted, I am stunningly good at that, it seems) are the ones that caused the brunt of the average-destruction. My hope is to pull these grades up with all my vigor. I have calculated that &#8212; in the 10-12 classes I have left, I need to get consisent B&#8217;s and B+&#8217;s to recover to a &#8220;safe&#8221; 3.2 or so (what I had when I left WPI). The various websites I&#8217;ve read say that this is a good average, and combined with me doing un-fucking-believable on the GRE&#8217;s, I should be able to get into a decent grad school.</p>
<p>I&#8217;ll try to keep Lowlymath.net[2] updated with my adventures in grad school application, and hopefully it will be a resource to anyone else hunting for graduate education.</p>
<p>No little thing like a bad GPA will keep me down, if necessary, I&#8217;ll take every math class WSC, WPI, and the rest of the consortium[3] offers to pull up my grade! Someday you&#8217;ll all be able to say &#8220;Whatsup Doc?&#8221; to me, and I will be quite pleased about it!</p>
<p>/Joe</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>[1] Thats Worcester Polytechnical Institute and Worcester State College, respectively.</p>
<p>[2] I&#8217;m actually posting to both blogs at once right now, so the Lowlymath Readers can just mentally replace &#8220;Lowlymath.net&#8221; with &#8220;this blog&#8221;</p>
<p>[3] The Consortium is a group of 6 schools which allow for &#8220;easy&#8221; crossregistration of classes and (supposedly) &#8220;easy&#8221; transfers between institutions. Though the latter is somewhat of a misrepresentation, given my experience.</p>
]]></content:encoded>
			<wfw:commentRss>http://lowlymath.net/2008/down-the-graduate-school-rabbit-hole/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Evolve &#8212; The History Channel may have finally done something right.</title>
		<link>http://lowlymath.net/2008/evolve-the-history-channel-may-have-finally-done-something-right/</link>
		<comments>http://lowlymath.net/2008/evolve-the-history-channel-may-have-finally-done-something-right/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 16:23:37 +0000</pubDate>
		<dc:creator>jfredett</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lowlymath.net/2008/evolve-the-history-channel-may-have-finally-done-something-right/</guid>
		<description><![CDATA[I just watched this show, on THC. I actually liked it, the title of the show was &#8220;Evolve&#8221; and it has to be the first show I&#8217;ve seen on THC that didn&#8217;t bugger up the science much at all. It was unabashedly pro-evolution, one of the biologists on the show (whose name escapes me) called [...]]]></description>
			<content:encoded><![CDATA[<p>I just watched this show, on THC. I actually liked it, the title of the show was &#8220;Evolve&#8221; and it has to be the first show I&#8217;ve seen on THC that didn&#8217;t bugger up the science much at all. It was unabashedly pro-evolution, one of the biologists on the show (whose name escapes me) called out the ID frakwittery without any qualms. It was fantastic.</p>
<p>Everyone should watch this show, Hold off on buying episodes till they air a few more, but I guarantee, if this is going to be the road the show takes, I&#8217;ll be buying a full season.</p>
<p>Fan-frigging-tastic.</p>
<p>&nbsp;</p>
<p>On another note, hopefully I&#8217;ll start being able to do some more blogging, I&#8217;ve been working on some videos, I&#8217;ve put a few up on the <a href="http://www.youtube.com/user/jfredett">tubes.</a> In any case, check it out, subscribe if you like, hopefully I&#8217;ll be internet-famous someday, like thunderfoot or edwardcurrent. <img src='http://lowlymath.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Oh, one more tube related thing. In case you people feel that I hate all religious people, you should check out DonExodus2 on the tubes, he&#8217;s a PhD biologist, anticreationist christian.</p>
<p>If all Christians were like DonExodus, I would be out of a job.</p>
]]></content:encoded>
			<wfw:commentRss>http://lowlymath.net/2008/evolve-the-history-channel-may-have-finally-done-something-right/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Basic Math: Algebra 101</title>
		<link>http://lowlymath.net/2008/basic-math-algebra-101/</link>
		<comments>http://lowlymath.net/2008/basic-math-algebra-101/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 04:53:51 +0000</pubDate>
		<dc:creator>jfredett</dc:creator>
		
		<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://lowlymath.net/2008/basic-math-algebra-101/</guid>
		<description><![CDATA[In High schools across the country, kids learn algebra. I know quite a few parents who have some big problems with algebra. For some, it&#8217;s just because it&#8217;s been a while since they&#8217;ve needed to use it, for others, it&#8217;s always been a hard thing, but it doesn&#8217;t have to be. In this post, I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>In High schools across the country, kids learn algebra. I know quite a few parents who have some big problems with algebra. For some, it&#8217;s just because it&#8217;s been a while since they&#8217;ve needed to use it, for others, it&#8217;s always been a hard thing, but it doesn&#8217;t have to be. In this post, I&#8217;ll take you through some of the basic concepts of algebra as if you had never seen it before, it&#8217;ll be a bit of a whirlwind review of the idea, but (hopefully) written well enough so that someone who has never fully understood algebra. Oh, yes, by the way, there will be word problems. <img src='http://lowlymath.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-38"></span></p>
<p>Here&#8217;s the solution from last time.</p>
<p>Recall that the problem was to determine what score you would need on the new SATs to match your older brothers score of 1460 on the old SATs.</p>
<p>The first step is to realize that the old score is really 1460 out of 1600, or 1460/1600 = 146/160 = 73/80. We&#8217;ll call that number B, for &#8220;<em>B</em>rothers score.&#8221; Next, we need to realize that your score will be something out of 2400, we can write that as m = x/2400. The next step is to convert B to a percentage, and then we have the problem in a form we know, that of a &#8220;x percent of y&#8221; problem. Using the definition, we find that 73/80 is 91.25% of 80. So now we want to find 91.25% of 2400, using a calculator we find that this is: 2190.0 even, so you&#8217;d need to score 2190 to match your older brothers score.</p>
<hr />
<p>So what is algebra? Most people would answer, &#8220;That math with the letters in it.&#8221; But really, this is just what algebra <em>looks like</em>. Really, Algebra is about equalities, and specificly about equalities involving unknown numbers. To understand equalities, we need to name the two types, what I call &#8220;resolved equalities&#8221;, eg:</p>
<p>&#8220;x = 2&#8243;, &#8220;y = z&#8221;, or &#8220;x = 3/4 + 1&#8243;.</p>
<p>and &#8220;unresolved equalities&#8221;, eg:</p>
<p>&#8220;(x + y)*(x - y) = 2&#8243; or &#8220;x^2 + 2 = 4&#8243;</p>
<p>The basic idea is that, when you read the equality, if it looks like &#8220;&lt;some letter&gt; = &lt;any old expression&gt;&#8221; then it&#8217;s a resolved equality.</p>
<p>The neat thing about equalities is that you can substitute with them, in math, this is called the <em>transitive property,</em> it just means that if I know: &#8220;x = y&#8221; and &#8220;y = z&#8221;, then I can substitute &#8216;z&#8217; for &#8216;y&#8217; to get &#8220;x = z&#8221;. Simple enough.</p>
<p>The other idea that gives rise to algebra is the idea of unknowns, we&#8217;ve used them a bit already, but let me explain the motivation for them a little more.</p>
<p>When you do normal arithmetic, you typically do problems like &#8220;12 x 23 = something&#8221;, or &#8220;12 + 23 = something&#8221;, or some combination of these. These things are really algebraic expressions, in the language of algebra, we&#8217;d write them as &#8220;x = 12*23&#8243; or &#8220;x = 12 + 23&#8243;, when we do arithmetic we&#8217;re really <em>solving resolved equalities in algebra.</em> So then, algebra is the next logical jump, it&#8217;s a set of rules for solving <em>unresolved equalities.</em></p>
<p>So, how do we come up with rules to do that? Really, it only requires one rule, we&#8217;ll call it the &#8220;fairness&#8221; rule, specificly it says that, given <em>any</em> equality, we can take some operation and do it to both sides, and get an equality back. Later we&#8217;ll learn how to write this in symbols, but for now, we&#8217;ll just remember it as the following adage, &#8220;Anything you do to one side, you have to do to the other.&#8221; This rule, along with the transitivity rule, allows us to transform just about any unresolved equality into a resolved one. Pretty powerful stuff.</p>
<p>So lets do a couple of problems with unresolved equalities, solve for x in the following:</p>
<ul>
<li>
<div>&#8220;3x = 9&#8243;</div>
</li>
<li>
<div>&#8220;3x - 1 + y = 2x + y&#8221;</div>
</li>
<li>
<div>&#8220;3x^2 = 27&#8243;</div>
</li>
</ul>
<p>The first one is pretty easy, we just need to find an operation to get rid of the 3 on the left side, the obvious choice is to divide by three on both sides, and in fact, thats the right choice. Doing so, we get &#8220;3x/3 = 9/3.&#8221; So now how do we simplify that to get a resolved equality? Well, realize that saying &#8220;3x&#8221; is just saying that you have a number with a factor of three in it, a factor which you can remove by dividing, and in general saying &#8220;n*x&#8221; is the same as saying that you have a number with a factor of n in it. So what do you have left from a multiple of three when you divide by three? Simply, &#8220;x&#8221; &#8212; the other factor of the equation. So our answer is then &#8220;x = 9/3&#8243;, or more simply &#8220;x = 3&#8243;. That was easy.</p>
<p>What we did with multiplication, also works with addition, or any other operation. So lets try it out on the second equation. We won&#8217;t do as much explaining, I&#8217;m just going to list the steps:</p>
<ol>
<li>
<div>3x - 1 + y = 2x + y</div>
</li>
<li>
<div>3x - 1 + y - y = 2x + y - y</div>
</li>
<li>
<div>3x - 1 = 2x</div>
</li>
<li>
<div>3x - 2x - 1 = 2x - 2x</div>
</li>
<li>
<div>x - 1 = 0</div>
</li>
<li>
<div>x - 1 + 1 = 0 + 1</div>
</li>
<li>
<div>x = 1</div>
</li>
</ol>
<p>The important things to note here are in steps 4 and 5. In step 4, we&#8217;re subtracting a multiple of an unknown from a multiple of an unknown, this implicitly[1] uses a notion called &#8220;factoring,&#8221; which you may have heard of in arithmetic, where you would factor numbers into individual components. Here, it means the following, If you have something like: k*x + n*x, then you can write it as x * (k + n). This is because when we expand multiplication on an expression in parenthesis, we multiply the expression on the outside of the parenthesis with each item in the parenthesis. We can see this with numbers by looking at the following example:</p>
<ul>
<li>
<div>x = 9 + 27</div>
</li>
<li>
<div>x = (3*3) + (3*9)</div>
</li>
<li>
<div>x = 3(3 + 9) &#8212; you see how we removed the common factor of three, and now we have two simpler problems</div>
</li>
<li>x = 3*12</li>
<li>x = 36</li>
</ul>
<p>The other step I noted, step 5, underlies a really important thing in algebra, the existence of the number zero, and specifically, the fact that you can have expressions equal to it. This comes up when dealing with quadratic equations (we&#8217;ll talk about those later), Calculus, and virtually <em>all</em> of the rest of mathematics.</p>
<p>The third equation I listed is solved as follows:</p>
<ol>
<li>
<div>3x^2 = 27</div>
</li>
<li>
<div>3x^2 / 3 = 27/3</div>
</li>
<li>
<div>x^2 = 9</div>
</li>
<li>
<div>sqrt(x^2) = sqrt(9)</div>
</li>
<li>
<div>x = +3 or -3</div>
</li>
</ol>
<p>The important, and possibly confusing step here is step 5, after taking the square root (written as sqrt(x^2) here) &#8212; the inverse operation of x^2, which means &#8220;x multiplied by itself twice&#8221;, and in general x^n means &#8220;x times itself n times&#8221; &#8212; I wrote that x is equal to either +3 or -3. It&#8217;s easy to see if we plug either answer in to the equation in step 3, both +3*+3 = 9, and (-3) * (-3) = 9. [2]</p>
<p>So, with what I&#8217;ve armed you with so far, you should be able to master a few more problems, since algebra is such a big subject, I can&#8217;t teach it in just one post, so this is as far as we&#8217;ll go this time, I&#8217;ll leave a few more algebra problems for you to try out. It&#8217;ll work like this, I&#8217;ll give you the original unresolved equality, and a variable to solve for, and your job is to find the list of manipulations, one at a time, to go from the unresolved equality to a resolved equality. Here they are.</p>
<p>In all three, solve for x, they rank from easiest to hardest:</p>
<ol>
<li>8x + 1 = 17</li>
<li>2(9x + 4y) = (18 + 16y)/2</li>
<li>10x^2 + 6 = 1006</li>
</ol>
<hr />
<p>[1] In case you haven&#8217;t seen that term before, it means that we&#8217;re using some rule without explicitly stating it.</p>
<p>[2] It may seem counterintuitive now, but you&#8217;ll have to take my word on it, a negative times a negative is a positive. We&#8217;ll get to this idea later.</p>
]]></content:encoded>
			<wfw:commentRss>http://lowlymath.net/2008/basic-math-algebra-101/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Quoting in Haskell, Redux</title>
		<link>http://lowlymath.net/2008/quoting-in-haskell-redux/</link>
		<comments>http://lowlymath.net/2008/quoting-in-haskell-redux/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 03:38:54 +0000</pubDate>
		<dc:creator>jfredett</dc:creator>
		
		<category><![CDATA[FP]]></category>

		<category><![CDATA[Functional]]></category>

		<category><![CDATA[Haskell]]></category>

		<category><![CDATA[Math]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lowlymath.net/2008/quoting-in-haskell-redux/</guid>
		<description><![CDATA[So- Apparently I have no idea what I&#8217;m talking about when it comes to scheme-style quoting in haskell. Augustss Says you can&#8217;t do it because of- well, some reason beyond my comprehension. He&#8217;s a smart guy, so I&#8217;m inclined to believe him. However, I still think that what I proved in my last post holds- [...]]]></description>
			<content:encoded><![CDATA[<p>So- Apparently I have no idea what I&#8217;m talking about when it comes to scheme-style quoting in haskell. Augustss Says you can&#8217;t do it because of- well, some reason beyond my comprehension. He&#8217;s a smart guy, so I&#8217;m inclined to believe him. However, I still think that what I proved in my last post holds- if not for quoting in haskell, then for quoting in scheme. The operations are still the same, dequote is just eval, quote is &#8216;. In any case, my goal wasn&#8217;t to really come up with some fantastic new insight into haskell, it was mostly just something I hacked on in my spare time- and thought might interest others. In any case, like I said, Augustss knows what he&#8217;s talking about, so take the last post with a grain of salt.</p>
]]></content:encoded>
			<wfw:commentRss>http://lowlymath.net/2008/quoting-in-haskell-redux/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Quotable Haskell</title>
		<link>http://lowlymath.net/2008/quotable-haskell/</link>
		<comments>http://lowlymath.net/2008/quotable-haskell/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 20:44:03 +0000</pubDate>
		<dc:creator>jfredett</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[FP]]></category>

		<category><![CDATA[Functional]]></category>

		<category><![CDATA[Haskell]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Quoting]]></category>

		<category><![CDATA[Scheme]]></category>

		<guid isPermaLink="false">http://lowlymath.net/2008/quotable-haskell/</guid>
		<description><![CDATA[
> module Quotable where

This is a nice little code dump I was trying to have posted yesterday, I&#8217;ve finally got most of the formatting bugs worked out. I wasn&#8217;t thinking I was going to post this till I got about 2/3rd the way through it, so it&#8217;s pretty rough. Think of it as a look [...]]]></description>
			<content:encoded><![CDATA[<p><code><br />
> module Quotable where<br />
</code></p>
<p>This is a nice little code dump I was trying to have posted yesterday, I&#8217;ve finally got most of the formatting bugs worked out. I wasn&#8217;t thinking I was going to post this till I got about 2/3rd the way through it, so it&#8217;s pretty rough. Think of it as a look into my notebook. Enjoy.</p>
<p><span id="more-36"></span></p>
<p>One of the things I like about Scheme is the ability to seamlessly jump from code as code and code as data, or vice versa. This is called &#8220;Quoting&#8221; and it works something like this:</p>
<pre>
<code>(define a-list '(1 2 3))
(define quoted-list 'a-list)
;;;;
a-list =: (1 2 3)
(eval quoted-list) =: (1 2 3)
</code>
</pre>
<p>Quoting allows us to pass things by name, and evaluated them as needed, that is, if I define a bit of scheme a la:</p>
<pre>
<code>(define (stream generator initial-value)
   (define next-val (generator initial-value))
   (cons initial-value
        `(stream ,generator ,next-val)))

(define (head/s a-stream)
    (car a-stream))

(define (tail/s a-stream)
    (eval (cdr a-stream)))

(define naturals
    (stream (lambda (x) (+ x 1)) 0))
</code>
</pre>
<p>This will give a lazy-list function given a generator which operates on one initial value and inductively defines the next and so on. It uses something called &#8220;quasiquoting&#8221; which allows for partially quoted sexps. All we really do in the above is construct an infinite list one element at a time. When we call &#8220;head/s&#8221; we&#8217;re just taking the already computed value, when we call &#8220;tail/s&#8221;, we simply compute the second half of the cons pair, which we stored as the quoted function</p>
<pre>
<code>`(stream ,generator ,next-val)</code>
</pre>
<p>, which gives us a new stream (of the same form) but which has the next-value in the first position, and a new quoted function as:</p>
<pre>
<code>`(stream ,generator ,(generator (eval (stream ,generator ,next-val))))
</code>
</pre>
<p>(more or less) This does exactly what Haskell does for it&#8217;s lazy-lists, (and it&#8217;s lazyness in general) it computes what it needs as you ask for it. However, we don&#8217;t have this neat quoting ability exposed in Haskell. So how can we recreate it?</p>
<hr />
<p>Well, first of all, We need to examine exactly what a &#8220;quote&#8221; is, each of these different quote-functions, namely quote (written as &#8216;) quasi-quote (written as `) and unquote (written as ,), are just maps of the following form: Quotable a =&gt; a -&gt; Quoted a Similarly, we need an inverse function, going from a Quoted a -&gt; a. In scheme, we call this &#8216;eval&#8217;, for our case, let&#8217;s call it dequote- since eval is used for more than just quoting/dequoting. Dequote has the signature:</p>
<pre>
<code>Quotable a =&gt; Quoted a -&gt; a
</code>
</pre>
<p>and the property</p>
<pre>
<code>&gt; prop_inv x = x == (dequote . quote) x

</code>
</pre>
<p>holds. So, we notice one interesting thing, Quoting has a monadic looking signature, namely that &#8216;quote&#8217; looks a good bit like &#8216;return&#8217;, in fact, quoting does form a monad under</p>
<pre>
<code>(x &gt;&gt;= f) = (f . dequote) x
return x = quote x
</code>
</pre>
<p>Not a very interesting monad, but a monad nonetheless, a quick proof of the monad-ness of quoting is as follows: Left Identity:</p>
<pre>
<code>(return x) &gt;&gt;= f = (f . dequote) $ (quote x)          -- definition
                                 = f . dequote . quote $ x -- definition
                                 = f . id $ x           -- prop_inv
                                 = f x                          -- identity property
</code>
</pre>
<p>Right Identitiy:</p>
<pre>
<code>(x &gt;&gt;= return) = (quote . dequote) $ x -- definition
                         = id $ x            -- prop_inv
                         = x                 -- identity
</code>
</pre>
<p>Associativity:</p>
<pre>
<code>(x &gt;&gt;= f) &gt;&gt;= g == (x &gt;&gt;= (\y -&gt; f x &gt;&gt;= g))                      -- given
                                 == ((\y -&gt; f x &gt;&gt;= g) . dequote $ x -- definition
                                 == f (dequote x) &gt;&gt;= g                    -- beta-reduction (iirc)
                                 == (g . dequote) $ f (dequote x)          -- definition
remember that, momentarily
(x &gt;&gt;= f) &gt;&gt;= g == (g . dequote) $ (f . dequote $ x) -- definition
                                 == (g . dequote) $ f (dequote x)        -- simplification
but this is the same as the above side, so the law holds.
</code>
</pre>
<p>I&#8217;m fairly sure that the definition</p>
<pre>
<code>x &gt;&gt;= f = f . quote $ x
return x = dequote x
</code>
</pre>
<p>is a monad too. I&#8217;ll leave that as an excercise. A quick recap, we haven&#8217;t written any actual code yet, but we know that the two functions (quote/dequote) yield two monads. We might ask if it satisfies any other constraints. Before that, though, lets write up some code.</p>
<pre>
<code>&gt; newtype Quote a = Q a
&gt; quote :: a -&gt; Quote a
&gt; quote = undefined -- we don't care how it's implemented, we just need to pretend
&gt;                       -- it exists
&gt; dequote :: Quote a -&gt; a
&gt; dequote = undefined

&gt; instance Monad Quote where
&gt;       return x = quote x
&gt;       x &gt;&gt;= f = (f . dequote) x 

</code>
</pre>
<p>Note how we are only proving that these types check out- we&#8217;re not saying how to build this quoting mechanism, simply that if it does exist, then it has the property of being a monad. Later, we might try to actually build such a infrastructure, but for now, let&#8217;s just do some math. Specifically, lets look at whats available? One natural area to look at is functors and their applicative variants: Recall that a functor implies the structure can be mapped over, that is there exists some function:</p>
<pre>
<code>fmap :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</code>
</pre>
<p>This obeys the following laws:</p>
<pre>
<code>fmap id = id
fmap (f . g) = fmap f . fmap g
</code>
</pre>
<p>We can easily show Quote is a functor, a la:</p>
<pre>
<code>&gt; instance Functor Quote where
&gt;       fmap f = (quote . f . dequote)

</code>
</pre>
<p>This satisfies the laws as follows:</p>
<pre>
<code>fmap id = quote . id . dequote  -- hypothesis
                = quote . dequote       -- defn
                = id                    -- prop_inv

fmap (f . g) = fmap f . fmap g                                          -- hypothesis
                         = (quote . f . dequote . quote . g . dequote) -- defn
                         = (quote . f . id . g . dequote)              -- prop_inv
                         = (quote . f . g . dequote)                 -- defn
                         = fmap (f . g)                                                                 

</code>
</pre>
<p>So we have a functor and a monad, we can also show that it&#8217;s an applicative functor, a la:</p>
<pre>
<code>&gt; instance Applicative Quote where
&gt;       pure            = quote
&gt;       qf &lt;*&gt; qx       = fmap (dequote qf) qx 

</code>
</pre>
<p>That needs to satisfy the following:</p>
<pre>
<code>Identity:
pure id &lt;*&gt; v = v

Composition:
pure (.) &lt;*&gt; u &lt;*&gt; v &lt;*&gt; w = u &lt;*&gt; (v &lt;*&gt; w)

Homomorphism:
pure f &lt;*&gt; pure x = pure (f x)

Interchange:
u &lt;*&gt; pure y = pure ($ y) &lt;*&gt; u

</code>
</pre>
<p>We can show this also fairly easily:</p>
<pre>
<code>Identity:
pure id &lt;*&gt; v = (quote id) &lt;*&gt; v                                -- defn
                         = fmap (dequote . quote . id) v        -- defn
                         = fmap (id . id) v                     -- prop_inv
                         = fmap id v                            -- defn
                         = v                                    -- functor law
Composition:
Left as an exercise

Homomorphism:
pure (f x) = pure f &lt;*&gt; pure x                        -- hypothesis
                 = (quote f) &lt;*&gt; (quote x)                    -- defn
                 = fmap ((dequote . quote) f) (quote x) -- defn
                 = fmap f (quote x)                           -- prop_inv
                 = pure (f x)                                 -- defn

Interchange:
Exercise                 

</code>
</pre>
<p>So, we&#8217;ve shown quoting to be a functor, applicative functor, and a monad. Possible interesting questions include: Is there a quote-identity? Which might give rise to a monoid instance? How many ways are there to implement this infrastructure? Obviously using read/show is nice, but would only allow quoting of read/show types, can we generalize it somehow? Can we somehow generalize this to a kind of class, meaning that we could have different quote/dequote functions, but still have a general monad instance for all of those types? Can we make quoting derivable?</p>
<hr />
<p>In any case this was fun, I hope to come back sometime and actually implement some quoting ability for Haskell, but at least now I can see what kind of things that structure could do!</p>
]]></content:encoded>
			<wfw:commentRss>http://lowlymath.net/2008/quotable-haskell/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Thar&#8217; Be Gremlins</title>
		<link>http://lowlymath.net/2008/thar-be-gremlins/</link>
		<comments>http://lowlymath.net/2008/thar-be-gremlins/#comments</comments>
		<pubDate>Sat, 31 May 2008 22:42:05 +0000</pubDate>
		<dc:creator>jfredett</dc:creator>
		
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://lowlymath.net/2008/thar-be-gremlins/</guid>
		<description><![CDATA[So- I was going to treat you all with a nice brain-dump style posting about Scheme-style Quoting in Haskell. But Wordpress is being bitchy, so it&#8217;s going to take a while, disregard any spam in your RSS feeds, it&#8217;s unintentional, I promise.
&#160;
Sorry.
]]></description>
			<content:encoded><![CDATA[<p>So- I was going to treat you all with a nice brain-dump style posting about Scheme-style Quoting in Haskell. But Wordpress is being bitchy, so it&#8217;s going to take a while, disregard any spam in your RSS feeds, it&#8217;s unintentional, I promise.</p>
<p>&nbsp;</p>
<p>Sorry.</p>
]]></content:encoded>
			<wfw:commentRss>http://lowlymath.net/2008/thar-be-gremlins/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Basic Math, how to use numbers any day.</title>
		<link>http://lowlymath.net/2008/basic-math-how-to-use-numbers-any-day/</link>
		<comments>http://lowlymath.net/2008/basic-math-how-to-use-numbers-any-day/#comments</comments>
		<pubDate>Sun, 25 May 2008 21:35:36 +0000</pubDate>
		<dc:creator>jfredett</dc:creator>
		
		<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://lowlymath.net/2008/basic-math-how-to-use-numbers-any-day/</guid>
		<description><![CDATA[On reddit today, there was a comment about a radio personality who argued with a Mathematician about how percentages work, specifically about how percentages are combined. I replied with a short explaination of how 35% + 15% = 55.25% and not latex 50%. Shortly thereafter, there were half-a-dozen comments, ranging from &#8220;That explaination was longwinded/overcomplicated&#8221;, [...]]]></description>
			<content:encoded><![CDATA[<p>On reddit today, there was a comment about a radio personality who argued with a Mathematician about how percentages work, specifically about how percentages are combined. I replied with a short explaination of how 35% + 15% = 55.25% and not latex 50%. Shortly thereafter, there were half-a-dozen comments, ranging from &#8220;That explaination was longwinded/overcomplicated&#8221;, to &#8220;Thanks, that really made the idea clear.&#8221; I realized that, while I don&#8217;t hold a Teaching License, or Advanced degree in math, I am pretty good at it, and maybe teaching a bit of basic, useful math or programming that anyone can understand and use might be a pretty popular topic for blog posts, enter the new Sporadic Series &#8220;Basic Math, how to use number any day.&#8221; (To bastardize the tagline from Numb3rs, which is an excellent show, by the way).</p>
<p>The posts will be aimed at laypersons with no mathematical experience beyond 10th grade or so, we&#8217;ll talk about geometry and algebra, basic statistics and numerical stuff, maybe even some more abstract stuff, but always presented from a <em>practical</em> point of view.</p>
<p>For the inagural post, Let&#8217;s talk about percentages, we&#8217;ll aim to look at percentages from a qualitative, practical viewpoint.</p>
<p><span id="more-30"></span></p>
<p>First, what is a percentage? Basically, a percentage is just a fraction, it represents a portion of a whole. The basic meaning of a percentage is simply that, for some numbers x and y, finding x-percent of y is the same as saying &#8220;calculate latex y/100x.&#8221; For instance, heres a simple word problem.</p>
<p>You&#8217;ve got a &#8220;pay two-thirds-price&#8221; coupon on your favorite coffee, Moroccan French Roast, it usually costs 7.99$ for a 1-lb bag of these delicious beans, but you only have a five in your pocket, can you afford the coffee?</p>
<p>So first, how do we say &#8220;pay two-thirds-price&#8221; in the language of Percentages? Remember that every percentage is really a fraction, and two-thirds is just the fraction 2/3. So we can easily convert this fraction using the definition I gave above, namely that:</p>
<p>x% of y = y/100x.</p>
<p>So, we can represent 2/3 = 0.6666&#8230; in decimal. So if we apply the definition, the percentage equivalent to two-thirds is 66.7% percent, or so. All that is useful, but when push comes to shove, we really can&#8217;t use this notation for percentages, it&#8217;s a nice way to look at them, but as far actual usefulness goes, we know alot more about the fractional representation, so we like to use that.</p>
<p>Back to our problem, we are simply asking how much two-thirds of 7.99 is, and whether that is more or less than 5 dollars. we can evaluate this quickly by using the following trick. 7.99 is the same as (8.00 - 0.01), now when we try to take 2/3s of 7.99, we can instead take 2/3s of 8 and 2/3s of 0.01, which is 5.33 and 0.006, we then take the latter value from the former, and we find that we have 5.27, or so. So no coffee for us.</p>
<p>Thats the fundamental problem in every percentage question. How do we convert to a fraction, and then how do we multiply quickly? The interesting stuff comes when we start to combine percentages, like stacking coupons, or finding out how well you did on a test, and similar.</p>
<p>Now lets start taking an algebraic slant. Think about the following problem.</p>
<p>You&#8217;re back at the store, and this time, you&#8217;re prepared, you have <em>four</em> 10% off coupons for you coffee, and that same fiver. The 1-lb bag still costs 7.99$, can you afford the coffee now?</p>
<p>So, the first question, what does &#8220;10% off&#8221; mean? Intuitively, it means that the store will subtract 10% of the price of the item if you have the coupon. So for any x%-off coupon, what we really have is that you&#8217;re going to pay (100-x)% of the price. So 10% off really means 90% of the price. Now heres the interesting part, with some number <em>n</em> 10% off coupons, you might suspect that you&#8217;ll get 10n% off, but this isn&#8217;t always the case, most places that will give you 10%-off coupons <em>chain</em> the coupons together, meaning they apply the first coupon to the original price, the second to the now discounted price, and so on. So instead of getting 60% off the price of our coffee, we&#8217;d be getting 10% off of 10% off of 10% and so on off of the original price.</p>
<p>What does this mean for our total discount? Well, converting the chain above, we need to find 90% of 90% of 90% of 90% of 90% of 90% of 7.99. Note that 100% of the price is 7.99, so we could write this as a product of fractions: 9/10 * 9/10 * &#8230; * 9/10. That&#8217;s basic algebra though, we just compute 9^4 / 10^4, using a calculator, we find that that is equal to 6561/10000, which is equal to the percentage 65.61% of the original price, which is equivalent to (100 - 65.61)% = 34.39% off. Again, using a calculator, we use the fractional representation of 65.61% of 7.99$, and find that it&#8217;s equal to: 5.24$. Damn, no coffee.</p>
<p>So, depending on how your local store combines coupons, you may be getting a bigger or smaller discount.</p>
<p>I&#8217;ll leave you folks with an exercise, Imagine that you&#8217;re taking the SATs. As many of you may know, the SAT&#8217;s recently redesigned their system to include three tests, with a possible 800 points each. You want to compare your scores with that of your older brother, who scored 1460 on the old &#8220;double-800&#8217;s&#8221; version[1]. You want to at least tie your older brothers score, how well do you have to do on the SAT&#8217;s to match your brothers score?</p>
<p>Remember that the SAT&#8217;s score in 10s, that is, you can&#8217;t score a 1423.52, you can only score in a multiple of ten.</p>
<p>The answer will appear in the next post in this series. Stay tuned!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>[1] Yes, that is my real score on the SATs, I took them twice, that was the higher of the two (the first time I took them, I got a 1320, but I don&#8217;t like to talk about that. <img src='http://lowlymath.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://lowlymath.net/2008/basic-math-how-to-use-numbers-any-day/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New digs</title>
		<link>http://lowlymath.net/2008/new-digs/</link>
		<comments>http://lowlymath.net/2008/new-digs/#comments</comments>
		<pubDate>Fri, 23 May 2008 02:39:50 +0000</pubDate>
		<dc:creator>jfredett</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lowlymath.net/2008/new-digs/</guid>
		<description><![CDATA[Welcome to the new site, posting will soon restart after the admittedly long hiatus.
To update the crowd, I&#8217;ve recently been working with Android, the Google Phone platform, specifically working on a simplified interface for interphone communication via the GTalk interface. I&#8217;ve also been fiddling with GPS stuff. I&#8217;ll be posting about that soon, and about [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to the new site, posting will soon restart after the admittedly long hiatus.</p>
<p>To update the crowd, I&#8217;ve recently been working with Android, the Google Phone platform, specifically working on a simplified interface for interphone communication via the GTalk interface. I&#8217;ve also been fiddling with GPS stuff. I&#8217;ll be posting about that soon, and about a decentralized persistent game I&#8217;ve been hacking on in Haskell.</p>
]]></content:encoded>
			<wfw:commentRss>http://lowlymath.net/2008/new-digs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Note on formatting</title>
		<link>http://lowlymath.net/2007/note-on-formatting/</link>
		<comments>http://lowlymath.net/2007/note-on-formatting/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 06:51:42 +0000</pubDate>
		<dc:creator>jfredett</dc:creator>
		
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://lowlymath.wordpress.com/2007/12/30/note-on-formatting/</guid>
		<description><![CDATA[Turns out the import of posts from the blogger account didn&#8217;t go all too smoothly, alot of the formatting was lost in the translation. If you&#8217;d like me to fix up any particular post, I&#8217;ll be sure to get to it, but there are quite a few, so unless I&#8217;m asked, I don&#8217;t intend to [...]]]></description>
			<content:encoded><![CDATA[<p>Turns out the import of posts from the blogger account didn&#8217;t go all too smoothly, alot of the formatting was lost in the translation. If you&#8217;d like me to fix up any particular post, I&#8217;ll be sure to get to it, but there are quite a few, so unless I&#8217;m asked, I don&#8217;t intend to fix them right away, (I&#8217;m a bit strapped for time right now, working on some school extra credit stuff). Hopefully I&#8217;ll get caught up on it. Note though, that the text itself is fine, just the formatting tags (pre and code tags, specifically) are being interpreted as text, and not markup. So if you copy and paste it (if its a literate haskell file, for instance) it should still work (and even look okay, maybe).</p>
<p>Sorry,</p>
<p>~~Joe</p>
]]></content:encoded>
			<wfw:commentRss>http://lowlymath.net/2007/note-on-formatting/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
