<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>João F. Ferreira</title>
	
	<link>http://joaoff.com</link>
	<description>Programming, Algorithms, and Calculational Mathematics</description>
	<lastBuildDate>Sun, 29 Jan 2012 23:13:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/jff" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="jff" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">jff</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>On Peirce’s law and the law of the excluded middle</title>
		<link>http://joaoff.com/2012/01/29/on-peirces-law-and-the-law-of-the-excluded-middle/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=on-peirces-law-and-the-law-of-the-excluded-middle</link>
		<comments>http://joaoff.com/2012/01/29/on-peirces-law-and-the-law-of-the-excluded-middle/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 23:13:33 +0000</pubDate>
		<dc:creator>João Ferreira</dc:creator>
				<category><![CDATA[Computing Science]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://joaoff.com/?p=844</guid>
		<description><![CDATA[A few days ago I found a video on YouTube explaining how to use CoqIde, the IDE for the Coq proof assistant. The proof that was used to illustrate the IDE was the equivalence between Peirce&#8217;s law and the excluded &#8230; <a href="http://joaoff.com/2012/01/29/on-peirces-law-and-the-law-of-the-excluded-middle/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A few days ago I found a video on YouTube explaining how to use CoqIde, the IDE for the Coq proof assistant. The proof that was used to illustrate the IDE was the equivalence between <em>Peirce&#8217;s law</em> and the <em>excluded middle law</em>, that is, the equivalence between the two following laws:</p>
<p>$\mleq{(0)}<br />
{((p{\Rightarrow}q){\Rightarrow}p)\Rightarrow p}<br />
$</p>
<p>and<br />
$\mleq{(1)}<br />
{\neg{p} \vee p}<br />
$</p>
<p>After watching the video, I wrote a <em>goal-oriented, calculational</em> proof of the equivalence between (0) and (1). In this short note, I describe the design of my proof.</p>
<h2>A calculational proof</h2>
<p>A useful rule of thumb is to start with the most complicated side, for it is usually easier to simplify expressions than to complicate them. With this in mind, let us try to manipulate (0) so that it becomes (1). </p>
<p>Looking at the shapes of (0) and (1), we immediately see that $q$ occurs in (0), but not in (1). So, if we start with (0), we will have to eliminate the occurence of $q$. This suggests that we have to use laws that involve the elimination of variables. Two elementary rules that are of this kind are the so-called absorption rules for conjunction and disjunction:</p>
<p>$\mleq{(2)}{(p \wedge q) \vee p ~\equiv~ p}$</p>
<p>$\mleq{(3)}{(p \vee q) \wedge p ~\equiv~ p}$</p>
<p>At a first sight, these rules may not seem very useful, because they involve only conjunction and disjunction and we want to eliminate a variable from a formula involving implication. But we know that implication can be written in terms of negation and disjunction:</p>
<p>$\mleq{(4)}<br />
{{p{\Rightarrow}q} ~\equiv~ {\neg{p} \vee q}}<br />
$</p>
<p>These observations, together with the De Morgan rule, allow us to write a <em>goal-oriented, calculational</em> proof of the equivalence between (0) and (1):</p>
<p>\[<br />
\beginproof<br />
\pexp{((p{\Rightarrow}q){\Rightarrow}p)\Rightarrow p}<br />
\hint{=}{rewrite the two leftmost $\Rightarrow$ using (4)}<br />
\pexp{{\neg{(\neg{p} \vee q)} \vee p} ~\Rightarrow~ p}<br />
\hint{=}{De Morgan rule, that is, $\neg{(\neg{p} \vee q)} ~\equiv~ (p \wedge \neg{q})$}<br />
\pexp{{(p \wedge \neg{q}) \vee p} ~\Rightarrow~ p}<br />
\hint{=}{absorption (2)}<br />
\pexp{p{\Rightarrow}p}<br />
\hint{=}{rewrite $\Rightarrow$ using (4)}<br />
\pexp{\neg{p} \vee p ~~.}<br />
\endproof<br />
\]</p>
<h2>The video</h2>
<p>The video that I mentioned is shown below. It would be unfair to compare the proofs, since the main goal of the video is to illustrate Coq&#8217;s IDE and not to show how to design proofs. Nevertheless, I would like to invite the reader to comment on the use of automated/interactive theorem provers to design proofs. Thanks for reading.</p>
<p><iframe width="584" height="438" src="http://www.youtube.com/embed/7sk8hPWAMSw?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://joaoff.com/2012/01/29/on-peirces-law-and-the-law-of-the-excluded-middle/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>An improved proof of the handshaking lemma</title>
		<link>http://joaoff.com/2011/09/20/an-improved-proof-of-the-handshaking-lemma/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=an-improved-proof-of-the-handshaking-lemma</link>
		<comments>http://joaoff.com/2011/09/20/an-improved-proof-of-the-handshaking-lemma/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 17:04:15 +0000</pubDate>
		<dc:creator>João Ferreira</dc:creator>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[algorithmic problem solving]]></category>
		<category><![CDATA[goal-oriented]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[graph theory]]></category>
		<category><![CDATA[handshaking lemma]]></category>
		<category><![CDATA[proofs]]></category>

		<guid isPermaLink="false">http://joaoff.com/?p=769</guid>
		<description><![CDATA[In 2009, I posted a calculational proof of the handshaking lemma, a well-known elementary result on undirected graphs. I was very pleased about my proof because the amount of guessing involved was very small (especially when compared with conventional proofs). &#8230; <a href="http://joaoff.com/2011/09/20/an-improved-proof-of-the-handshaking-lemma/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In 2009, I posted a calculational proof of the handshaking lemma, a well-known elementary result on undirected graphs. I was very pleased about my proof because the amount of guessing involved was very small (especially when compared with conventional proofs). However, one of the steps was too complicated and I did not know how to improve it.</p>
<p>In June, Jeremy Weissmann read my proof and <a href="https://groups.google.com/d/topic/calculational-mathematics/Z2Ku9DUkB14/discussion" title="Jeremy Weissmann's alternative">he proposed a different development</a>. His argument was well structured, but it wasn&#8217;t as goal-oriented as I&#8217;d hoped for. Gladly, after a <a href="https://groups.google.com/d/msg/calculational-mathematics/RDQuyKXefxk/G49FjEqjdewJ" title="Discussion on the handshaking lemma">brief discussion</a>, we realised that we were missing a great opportunity to use the trading rule (details below)!</p>
<p>I was so pleased with the final outcome that I decided to record and share the new proof.</p>
<h2>Problem statement</h2>
<p>In graph theory, the degree of a vertex $A$, $\fapp{d}{A}$, is the number of edges incident with the vertex $A$, counting loops twice. So, considering Graph 0 below, we have $\fapp{d}{A}=3$, $\fapp{d}{B}=3$, $\fapp{d}{C}=1$, $\fapp{d}{D}=3$, and $\fapp{d}{E}=2$.</p>
<div id="attachment_90" class="wp-caption aligncenter" style="width: 310px"><a href="http://joaoff.com/wp-content/uploads/2009/03/graph.png"><img class="size-medium wp-image-90" title="Figure 0: Example of an undirected graph with five vertices" src="http://joaoff.com/wp-content/uploads/2009/03/graph.png" alt="Example of an undirected graph with five vertices" width="300" height="229" /></a><p class="wp-caption-text">Graph 0: Example of an undirected graph with five vertices</p></div>
<p>A well-known property is that <strong>every undirected graph contains an even number of vertices with odd degree</strong>. The result first appeared in <a href="http://math.dartmouth.edu/~euler/docs/originals/E053.pdf">Euler&#8217;s 1736 paper</a> on the <a href="http://en.wikipedia.org/wiki/Seven_Bridges_of_K%C3%B6nigsberg">Seven Bridges of Königsberg</a> and is also known as <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Handshaking_lemma">the handshaking lemma</a> (that&#8217;s because another way of formulating the property is that the number of people that have shaken hands an odd number of times is even).</p>
<p>As we can easily verify, Graph 0 satisfies this property. There are four vertices with odd degree ($A$,$B$, $C$, and $D$), and 4, of course, is an even number.</p>
<p>Although the proof of this property is simple, all the conventional proofs that I know of are not goal-oriented. My goal is to show you a development of a goal-oriented proof. Also, my proof is completely guided by the shape of the formulae involved, which helps reducing the amount of guessing involved.</p>
<p><span id="more-769"></span></p>
<h2>Notations that I use</h2>
<p>Before we start, let me explain the notations that I use. I assume the existence of two predicates, $even$ and $odd$, that test the parity of numbers. For example, $\fapp{even}{8}$ and $\fapp{odd}{3}$ are both true, and $\fapp{even}{5}$ and $\fapp{odd}{6}$ are both false. Also, I use the so-called Eindhoven notation for quantifiers; for example, to express the sum of all natural even numbers less than 50 I write $\quantifier{\Sigma}{n}{0{\leq}n{<}50~\wedge~\fapp{even}{n}}{n}$, and instead of writing $\fapp{even}{0}{\equiv}\fapp{even}{1}{\equiv}{\cdots}{\equiv}\fapp{even}{50}$, I write $\quantifier{\equiv}{n}{0{\leq}n{\leq}50}{\fapp{even}{n}}$.</p>
<p>An advantage of using a systematic notation for quantifiers is that we can write the rules that manipulate quantifiers in a very general way. For example, suppose that the quantifier $\bigoplus$ generalises the binary operator $\oplus$. Moreover, let us assume that $1_{\oplus}$ is the unit of $\oplus$, that is, for all $n$, we have:</p>
<p>\[<br />
n{\oplus}1_{\oplus} = 1_{\oplus}{\oplus}n = n ~~.<br />
\]</p>
<p>Then, the so-called <em>trading rule</em> is valid:</p>
<p>\[<br />
\beginproof<br />
\pexp{\quantifier{\bigoplus}{n}{P \wedge Q}{T}}<br />
\equiv &#038; \\<br />
\pexp{\quantifier{\bigoplus}{n}{P}{{\sf if~~} Q \rightarrow T~~\Box~~\neg{Q} \rightarrow 1_{\oplus} {~~\sf fi}} ~.}<br />
\endproof<br />
\]</p>
<p>This rule applies to all quantifiers that generalise operators with units. For example, because true is the unit of $\equiv$, we have </p>
<p>\[<br />
\beginproof<br />
\pexp{\quantifier{\equiv}{n}{P \wedge Q}{T}}<br />
\equiv &#038; \\<br />
\pexp{\quantifier{\equiv}{n}{P}{{\sf if~~} Q \rightarrow T~~\Box~~\neg{Q} \rightarrow true {~~\sf fi}} ~,}<br />
\endproof<br />
\]</p>
<p>which is the same as</p>
<p>\[<br />
\quantifier{\equiv}{n}{P \wedge Q}{T} \equiv<br />
\quantifier{\equiv}{n}{P}{Q \Rightarrow T} ~~.<br />
\]</p>
<h2>Calculating a solution to the handshaking lemma</h2>
<p>Now, the first step in any goal-oriented solution is to express the goal. In other words, what do we want to prove or calculate? Using the notation just described and assuming that the variable $v$ ranges over the set of all vertices, our goal is to determine the value of the following expression:</p>
<p>\[<br />
\fapp{even}<br />
{<br />
\quantifier{\Sigma}{v}<br />
{\fapp{odd}{(\fapp{d}{v})}}<br />
{1}<br />
}~~~.<br />
\]<br />
Note that we are adding 1 (counting) for each vertex $v$ with an odd degree. We then apply the predicate $even$ to the result. If the result is true, there is an even number of vertices with odd degree; otherwise, there is an odd number. Our goal is thus to determine its value. (We know that it must evaluate to true, because the property is well-known. However, in general, when doing mathematics, we don&#8217;t know what is the final value; that is why goal-oriented and calculational proofs are important.)</p>
<p>We know that the predicate $even$ distributes over addition, so we calculate:</p>
<p>\[<br />
\beginproof<br />
\pexp{\fapp{even}{\quantifier{\Sigma}{v}{\fapp{odd}{(\fapp{d}{v})}}{1}}}<br />
\hint{=}{$even$ distributes over addition}<br />
\pexp{\quantifier{\equiv}{v}{\fapp{odd}{(\fapp{d}{v})}}{\fapp{even}{1}}}<br />
\hint{=}{$\fapp{even}{1}\equiv false$}<br />
\pexp{\quantifier{\equiv}{v}{\fapp{odd}{(\fapp{d}{v})}}{false}}<br />
\hint{=}{trading rule (see above)}<br />
\pexp{\quantifier{\equiv}{v}{\!}{\fapp{odd}{(\fapp{d}{v})} \Rightarrow false}}<br />
\hint{=}{${\fapp{odd}{n}\Rightarrow{false}} ~\equiv~ {\fapp{even}{n}}$}<br />
\pexp{\quantifier{\equiv}{v}{\!}{\fapp{even}{(\fapp{d}{v})}}}<br />
\hint{=}{$even$ distributes over addition}<br />
\pexp{\fapp{even}{\quantifier{\Sigma}{v}{\!}{\fapp{d}{v}}}}<br />
\endproof<br />
\]</p>
<p>This calculation shows that the parity of the number of vertices with odd degree is the same as the parity of the sum of all the degrees. But <em>because each edge has two ends, the sum of all the degrees is simply twice the total number of edges</em>. We thus have:</p>
<p>\[<br />
\beginproof<br />
\pexp{\fapp{even}{\quantifier{\Sigma}{v}{\fapp{odd}{(\fapp{d}{v})}}{1}}}<br />
\hint{=}{calculation above}<br />
\pexp{\fapp{even}{\quantifier{\Sigma}{v}{\!}{\fapp{d}{v})}}}<br />
\hintf{=}{the sum of all the degrees is twice the}<br />
\hintl{number of edges, i.e., an even number}<br />
\pexp{true~~.}<br />
\endproof<br />
\]</p>
<p>And so we can conclude that every undirected graph contains an even number of vertices with odd degree.</p>
<h2>What is wrong with conventional solutions?</h2>
<p>Conventional solutions for this problem are usually very similar to the following one, taken from the book &#8220;Ingenuity in Mathematics&#8221; (p. 8), by Ross Honsberger:</p>
<blockquote><p>
The proof in general is simple. We denote by T the total of all the local degrees:</p>
<p>(1) T = d(A) + d(B) + d(C) + &#8230; + d(K) .</p>
<p>In evaluating T we count the number of edges running into A, the number into B, etc., and add. Because each edge has two ends, T is simply twice the number of edges; hence T is even.</p>
<p>Now the values d(P) on the right-hand side of (1) which are even add up to a sub-total which is also even. The remaining values d(P) each of which is odd, must also add up to an even sub-total (since T is even). This shows that there is an even number of odd d(P)&#8217;s (it takes an even number of odd numbers to give an even sum). Thus there must be an even number of vertices with odd local degree.
</p></blockquote>
<p>There is nothing wrong with this solution in the sense that it shows why the property holds. However, it is clearly oriented to verification: it starts by introducing the total sum of all the local degrees, observing that its value is even; then it analyses that sum to conclude the property. The question is: how can we teach students to come with the total sum of all the local degrees? <strong>In general, how can we teach students to come with seemingly unrelated concepts that will be crucial in the development of their arguments? I don&#8217;t think we can.</strong></p>
<p>On the other hand, if we look at the goal-oriented proof, we see that the goal is simple to express. Furthermore, with some training, most students would write it correctly and would be able to calculate that the parity of the number of vertices with odd degree is the same as the parity of the sum of all the degrees. And then (and only then) the introduction of the total sum of all the degrees would make sense. In a way, goal-oriented calculations are like that famous <a href="http://en.wikipedia.org/wiki/Breaking_the_Magician%27s_Code">masked magician that reveals magic&#8217;s biggest secrets</a>, for they reveal how the rabbit got into the hat.</p>
]]></content:encoded>
			<wfw:commentRss>http://joaoff.com/2011/09/20/an-improved-proof-of-the-handshaking-lemma/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Principles and Applications of Algorithmic Problem Solving</title>
		<link>http://joaoff.com/2011/06/02/principles-and-applications-of-aps/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=principles-and-applications-of-aps</link>
		<comments>http://joaoff.com/2011/06/02/principles-and-applications-of-aps/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 17:09:52 +0000</pubDate>
		<dc:creator>João Ferreira</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Computing Science]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[algorithmic problem solving]]></category>
		<category><![CDATA[combinatorics]]></category>
		<category><![CDATA[correctness]]></category>
		<category><![CDATA[distributivity]]></category>
		<category><![CDATA[principles]]></category>
		<category><![CDATA[proof]]></category>
		<category><![CDATA[proofs]]></category>
		<category><![CDATA[rationals]]></category>
		<category><![CDATA[teaching scenarios]]></category>
		<category><![CDATA[techniques]]></category>
		<category><![CDATA[thesis]]></category>

		<guid isPermaLink="false">http://www.joaoff.com/?p=330</guid>
		<description><![CDATA[I am currently in Salamanca (Spain), attending the conference Tools for Teaching Logic III. My talk was on teaching logic through algorithmic problem solving and it went quite well, I think. In particular, it seems that the audience enjoyed the &#8230; <a href="http://joaoff.com/2011/06/02/principles-and-applications-of-aps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am currently in Salamanca (Spain), attending the conference <a href="http://logicae.usal.es/TICTTL">Tools for Teaching Logic III</a>. My talk was on teaching logic through algorithmic problem solving and it went quite well, I think. In particular, it seems that the audience enjoyed the examples that I have used and the teaching scenarios that I have shown. As a result, I have promised that I would upload my <a href='http://joaoff.com/wp-content/uploads/2011/06/thesis-a4-colour.pdf'>PhD thesis</a> into this website. Since the thesis can also be useful for other people, I have decided to write a new blog post. I hope you enjoy!</p>
<h2>Abstract</h2>
<blockquote><p>
Algorithmic problem solving provides a radically new way of approaching and solving problems in general by using the advances that have been made in the basic principles of correct-by-construction algorithm design. The aim of this thesis is to provide educational material that shows how these advances can be used to support the teaching of mathematics and computing.</p>
<p>We rewrite material on elementary number theory and we show how the focus on the algorithmic content of the theory allows the systematisation of existing proofs and, more importantly, the construction of new knowledge in a practical and elegant way. For example, based on Euclid&#8217;s algorithm, we derive a new and efficient algorithm to enumerate the positive rational numbers in two different ways, and we develop a new and constructive proof of the two-squares theorem.</p>
<p>Because the teaching of any subject can only be effective if the teacher has access to abundant and sufficiently varied educational material, we also include a catalogue of teaching scenarios. Teaching scenarios are fully worked out solutions to algorithmic problems together with detailed guidelines on the principles captured by the problem, how the problem is tackled, and how it is solved. Most of the scenarios have a recreational flavour and are designed to promote self-discovery by the students.</p>
<p>Based on the material developed, we are convinced that goal-oriented, calculational algorithmic skills can be used to enrich and reinvigorate the teaching of mathematics and computing.
</p></blockquote>
<h2>Download the PDF</h2>
<p><a href='http://joaoff.com/wp-content/uploads/2011/06/thesis-a4-colour.pdf'>Principles and Applications of Algorithmic Problem Solving (PhD Thesis, João F. Ferreira, 345 pages)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://joaoff.com/2011/06/02/principles-and-applications-of-aps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Probabilities in Proofreading</title>
		<link>http://joaoff.com/2009/09/14/probabilities-in-proofreading/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=probabilities-in-proofreading</link>
		<comments>http://joaoff.com/2009/09/14/probabilities-in-proofreading/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 14:04:36 +0000</pubDate>
		<dc:creator>João Ferreira</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Computing Science]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[calculational]]></category>
		<category><![CDATA[polya]]></category>
		<category><![CDATA[probabilities]]></category>
		<category><![CDATA[probability]]></category>
		<category><![CDATA[proof]]></category>
		<category><![CDATA[proofreading]]></category>
		<category><![CDATA[proofs]]></category>

		<guid isPermaLink="false">http://www.joaoff.com/?p=267</guid>
		<description><![CDATA[Suppose you write a program and you send the source code to two of your friends, ${\cal A}$ and ${\cal B}$. Your two friends read the code and when they finish, $A$ errors are detected by ${\cal A}$, $B$ errors &#8230; <a href="http://joaoff.com/2009/09/14/probabilities-in-proofreading/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Suppose you write a program and you send the source code to two of your friends, ${\cal A}$ and ${\cal B}$. Your two friends read the code and when they finish, $A$ errors are detected by ${\cal A}$, $B$ errors are detected by ${\cal B}$, and $C$ errors are detected by both. So, in total, $A+B-C$ errors are detected and can now be eliminated. We wish to <em>estimate</em> the number of errors that remain unnoticed and uncorrected.</p>
<p>The original version of this problem concerns manuscripts and proofreaders, instead of source code and programmers. It was posed and solved by George Polya and published in 1976 on <a href="http://www.maa.org/pubs/monthly.html" title="The American Mathematical Monthly Journal">The American Mathematical Monthly</a> under the name of <em>Probabilities in Proofreading</em>. Because the problem is interesting and Polya&#8217;s solution is short and elegant, I have decided to record and share it. Also, since code sharing and reading is a frequent activity in the software development world, estimating the desired value can be helpful for some readers of this blog.</p>
<h2>Estimating the number of unnoticed errors</h2>
<p>Let $E$ be the number of all errors, noticed and unnoticed, in the source code. Our goal is to estimate the value of $E-(A+B-C)$. Let $p$ be the probability that friend ${\cal A}$ notices any given error and $q$ the analogous probability for friend ${\cal B}$. The expected number of errors that may be detected by ${\cal A}$ is $E{\cdot}p$ and by ${\cal B}$ is $E{\cdot}q$. Assuming that these probabilities are independent, the expected number of errors that may be mutually detected by both friends is $E{\cdot}p{\cdot}q$.</p>
<p>Because we are interested in an <em>estimate</em>, we can safely assume that the expected numbers are approximately equal to the number of errors detected, that is, $E{\cdot}p \sim A$, $E{\cdot}q \sim B$, and $E{\cdot}p{\cdot}q \sim C$. (We use the notation $\sim$ to denote that two numbers are approximately equal.)</p>
<p>We now have all the ingredients to conclude the solution. Recall that our goal is to estimate the value of $E-(A+B-C)$. We calculate:</p>
<p>\[<br />
\beginproof<br />
\pexp{E-(A+B-C)}<br />
\hint{=}{we rewrite $E$ to prepare the introduction of $A$, $B$, and $C$}<br />
\pexp{\frac{E{\cdot}p{\cdot}E{\cdot}q}{E{\cdot}p{\cdot}q} - (A+B-C)}<br />
\hint{\sim}{assumption on estimates}<br />
\pexp{\frac{A{\cdot}B}{C} - (A+B-C)}<br />
\hint{=}{arithmetic}<br />
\pexp{\frac{(A-C){\cdot}(B-C)}{C}~~.}<br />
\endproof<br />
\]</p>
<p>This is the desired estimate!</p>
]]></content:encoded>
			<wfw:commentRss>http://joaoff.com/2009/09/14/probabilities-in-proofreading/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Making ThinkFinger Faster</title>
		<link>http://joaoff.com/2009/06/30/making-thinkfinger-faster/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=making-thinkfinger-faster</link>
		<comments>http://joaoff.com/2009/06/30/making-thinkfinger-faster/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 10:47:55 +0000</pubDate>
		<dc:creator>João Ferreira</dc:creator>
				<category><![CDATA[Computing Science]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[archlinux]]></category>
		<category><![CDATA[fingerprint]]></category>
		<category><![CDATA[ibm]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[lenovo]]></category>
		<category><![CDATA[tablet]]></category>
		<category><![CDATA[thinkfinger]]></category>
		<category><![CDATA[timeout]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[usb_bulk_read]]></category>

		<guid isPermaLink="false">http://www.joaoff.com/?p=197</guid>
		<description><![CDATA[Some time ago, I have installed and configured ThinkFinger, a driver for the fingerprint-readers found in most IBM/Lenovo Thinkpads, including my Lenovo X61 Tablet. Although it worked well, it was very slow! I had to wait 5 to 10 seconds &#8230; <a href="http://joaoff.com/2009/06/30/making-thinkfinger-faster/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some time ago, I have installed and configured <a title="ThinkFinger" href="http://thinkfinger.sourceforge.net">ThinkFinger</a>, a driver for the fingerprint-readers found in most IBM/Lenovo Thinkpads, including my Lenovo X61 Tablet. Although it worked well, it was very slow! I had to wait 5 to 10 seconds for the prompt to show, then a bit more before I could swipe my finger or write my password, and then a bit more for the password to be accepted.</p>
<p>To make my world a better place to live, I have downloaded the development version of the driver and tried to figure out why it was being so slow. It turns out that in the library that is used to communicate with the fingerprint-reader, there was a call to the function <i>usb_bulk_read</i> that was taking too long. I have tried to find some official documentation about this function, but all I could find was <a title="How not to document your functions" href="http://libusb.sourceforge.net/doc/function.usbbulkread.html">how not to document a function</a> (seriously, what is the role of the parameter <i>timeout</i>? and is it measured in seconds? milliseconds?).</p>
<p>Anyway, I have changed the value of the <i>USB_TIMEOUT</i> constant from 5000 to 5 and the fingerprint-reader is much, much better! In detail, here is the patch:</p>
<pre>
Index: libthinkfinger/libthinkfinger.c
===================================================================
--- libthinkfinger/libthinkfinger.c     (revision 118)
+++ libthinkfinger/libthinkfinger.c     (working copy)
@@ -35,7 +35,7 @@

 #define USB_VENDOR_ID     0x0483
 #define USB_PRODUCT_ID    0x2016
-#define USB_TIMEOUT       5000
+#define USB_TIMEOUT       5
 #define USB_WR_EP         0x02
 #define USB_RD_EP         0x81
 #define DEFAULT_BULK_SIZE 0x40
</pre>
<p>I am not sure why this works and what are the implications, but all the tests I did were satisfactory. If you know more about this problem, please let me know! I would be more than happy to understand why the <i>USB_TIMEOUT</i> constant seems to be acting as a time-wait delay, rather than as a timeout in the following call (line 324, <a href="http://thinkfinger.svn.sourceforge.net/viewvc/thinkfinger/libthinkfinger/libthinkfinger.c?view=markup#l_324" title="libthinkfinger/libthinkfinger.c">libthinkfinger/libthinkfinger.c</a>):</p>
<pre>
usb_retval = usb_bulk_read (tf->usb_dev_handle, USB_RD_EP, bytes,
                            size, USB_TIMEOUT);
</pre>
<p>(I think it is strange that I haven&#8217;t found anyone complaining about the same problem. Nevertheless, I&#8217;ve decided to publish this post anyway, in case someone runs into the same problem.)</p>
<p><strong>Update (2009/07/31)</strong>: I&#8217;ve upload a patched SRC RPM: <a href="http://www.joaoff.com/downloads/thinkfinger-0.3-9.jff.src.rpm">thinkfinger-0.3-9.jff.src.rpm</a>. Please note that I have added the patch to Fedora&#8217;s SRC RPM.</p>
]]></content:encoded>
			<wfw:commentRss>http://joaoff.com/2009/06/30/making-thinkfinger-faster/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Sir Tony Hoare on the future of Computing Science</title>
		<link>http://joaoff.com/2009/04/30/sir-tony-hoare-on-the-future-of-computing-science/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=sir-tony-hoare-on-the-future-of-computing-science</link>
		<comments>http://joaoff.com/2009/04/30/sir-tony-hoare-on-the-future-of-computing-science/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 17:13:39 +0000</pubDate>
		<dc:creator>João Ferreira</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Computing Science]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[correctness]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[hoare]]></category>
		<category><![CDATA[quotes]]></category>

		<guid isPermaLink="false">http://www.joaoff.com/?p=100</guid>
		<description><![CDATA[Sir Tony Hoare on the future of Computing Science (CACM, March 2009): I expect the future to be as wonderful as the past has been. There&#8217;s still an enormous amount of interesting work to do. As far as the fundamental &#8230; <a href="http://joaoff.com/2009/04/30/sir-tony-hoare-on-the-future-of-computing-science/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/C._A._R._Hoare">Sir Tony Hoare</a> on the future of Computing Science (<a href="http://cacm.acm.org">CACM</a>, March 2009):</p>
<blockquote><p>I expect the future to be as wonderful as the past has been. There&#8217;s still an enormous amount of interesting work to do. As far as the fundamental science is concerned, we still certainly do not know how to prove programs correct. We need a lot of steady progress in this area, which one can foresee, and a lot of breakthroughs where people suddenly find there&#8217;s a simple way to do something that everybody hitherto has thought to be far too difficult.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://joaoff.com/2009/04/30/sir-tony-hoare-on-the-future-of-computing-science/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Calculational Proof of the Handshaking Lemma</title>
		<link>http://joaoff.com/2009/04/07/calculational-proof-handshaking-lemma/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=calculational-proof-handshaking-lemma</link>
		<comments>http://joaoff.com/2009/04/07/calculational-proof-handshaking-lemma/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 21:11:55 +0000</pubDate>
		<dc:creator>João Ferreira</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Computing Science]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[calculational]]></category>
		<category><![CDATA[goal-oriented]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[graph theory]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[proof]]></category>
		<category><![CDATA[quantifiers]]></category>
		<category><![CDATA[vertex]]></category>

		<guid isPermaLink="false">http://www.joaoff.com/?p=86</guid>
		<description><![CDATA[UPDATE (2011/09/20): This post was superseded by An improved proof of the handshaking lemma. In graph theory, the degree of a vertex $A$, $\fapp{d}{A}$, is the number of edges incident with the vertex $A$, counting loops twice. So, considering Graph &#8230; <a href="http://joaoff.com/2009/04/07/calculational-proof-handshaking-lemma/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE (2011/09/20):</strong> This post was superseded by <a href="http://joaoff.com/2011/09/20/an-improved-proof-of-the-handshaking-lemma">An improved proof of the handshaking lemma</a>.</p>
<p>In graph theory, the degree of a vertex $A$, $\fapp{d}{A}$, is the number of edges incident with the vertex $A$, counting loops twice. So, considering Graph 0 below, we have $\fapp{d}{A}=3$, $\fapp{d}{B}=3$, $\fapp{d}{C}=1$, $\fapp{d}{D}=3$, and $\fapp{d}{E}=2$.</p>
<div id="attachment_90" class="wp-caption aligncenter" style="width: 310px"><a href="http://joaoff.com/wp-content/uploads/2009/03/graph.png"><img class="size-medium wp-image-90" title="Figure 0: Example of an undirected graph with five nodes" src="http://joaoff.com/wp-content/uploads/2009/03/graph.png" alt="Example of an undirected graph with five nodes" width="300" height="229" /></a><p class="wp-caption-text">Graph 0: Example of an undirected graph with five nodes</p></div>
<p>A well-known property is that every undirected graph contains an even number of vertices with odd degree. The result first appeared in <a href="http://math.dartmouth.edu/~euler/docs/originals/E053.pdf">Euler&#8217;s 1736 paper</a> on the <a href="http://en.wikipedia.org/wiki/Seven_Bridges_of_K%C3%B6nigsberg">Seven Bridges of Königsberg</a> and is also known as <a href="http://en.wikipedia.org/wiki/Handshaking_lemma#Handshaking_lemma">the handshaking lemma</a> (that&#8217;s because another way of formulating the property is that the number of people that have shaken hands an odd number of times is even).</p>
<p>As we can easily verify, Graph 0 satisfies this property. There are four vertices with odd degree ($A$,$B$, $C$, and $D$), and 4, of course, is an even number.</p>
<p>Although the proof of this property is simple, I have never seen it proved in a calculational and goal-oriented way. My aim with this post is to show you a development of a goal-oriented proof.<br />
<span id="more-335"></span><br />
Before we start, let me explain the notations that I use. I assume the existence of two predicates, $even$ and $odd$, that test the parity of numbers. For example, $\fapp{even}{8}$ and $\fapp{odd}{3}$ are both true, and $\fapp{even}{5}$ and $\fapp{odd}{6}$ are both false. Also, I use the so-called Eindhoven notation for quantifiers; for example, to express the sum of all natural even numbers less than 50 I write $\quantifier{\Sigma}{n}{0{\leq}n{<}50~\wedge~\fapp{even}{n}}{n}$, and instead of writing $\fapp{even}{0}{\equiv}\fapp{even}{1}{\equiv}{\cdots}{\equiv}\fapp{even}{50}$, I write $\quantifier{\equiv}{n}{0{\leq}n{\leq}50}{\fapp{even}{n}}$.</p>
<p>Now, the first step in any goal-oriented solution is to express the goal. In other words, what do we want to prove or calculate? Using the notation just described and assuming that $V$ is the set of all vertices, our goal is to determine the value of the following expression:</p>
<p>\[<br />
\fapp{even}<br />
{<br />
\quantifier{\Sigma}{a}<br />
{a{\in}V{\wedge}\fapp{odd}{(\fapp{d}{a})}}<br />
{1}<br />
}~~~.<br />
\]<br />
Note that we are adding 1 (counting) for each node $a$ in $V$ with an odd degree. We then apply the predicate $even$ to the result. If the result is true, there is an even number of vertices with odd degree; otherwise, there is an odd number. Our goal is thus to determine its value. (We know that it must evaluate to true, because the property is well-known. However, in general, when doing mathematics, we don't know what is the final value; that is why goal-oriented and calculational proofs are important.)</p>
<p>We know that the predicate $even$ distributes over addition, so we calculate:</p>
<p>\[<br />
\beginproof<br />
\pexp{\fapp{even}{\quantifier{\Sigma}{a}{a{\in}V\,{\wedge}\,\fapp{odd}{(\fapp{d}{a})}}{1}}}<br />
\hint{=}{$even$ distributes over addition}<br />
\pexp{\quantifier{\equiv}{a}{a{\in}V\,{\wedge}\,\fapp{odd}{(\fapp{d}{a})}}{\fapp{even}{1}}}<br />
\hintf{=}{the most reasonable thing to do is to simplify the}<br />
\hintm{range; this step prepares that simplification, because}<br />
\hintm{$\quantifier{\equiv}{a}{a{\in}V\,{\wedge}\,\fapp{even}{(\fapp{d}{a})}}{true}$ is true and $\equiv$ is reflexive.}<br />
\hintl{Also, $\fapp{even}{1}{\equiv}false$.}<br />
\pexp{\quantifier{\equiv}{a}{a{\in}V\,{\wedge}\,\fapp{odd}{(\fapp{d}{a})}}{false} \equiv \quantifier{\equiv}{a}{a{\in}V\,{\wedge}\,\fapp{even}{(\fapp{d}{a})}}{true}}<br />
\hint{=}{we make the terms equal, using the information in the range}<br />
\pexp{\quantifier{\equiv}{a}{a{\in}V\,{\wedge}\,\fapp{odd}{(\fapp{d}{a})}}{\fapp{even}{(\fapp{d}{a})}} \equiv \quantifier{\equiv}{a}{a{\in}V\,{\wedge}\,\fapp{even}{(\fapp{d}{a})}}{\fapp{even}{(\fapp{d}{a})}}}<br />
\hint{=}{range splitting}<br />
\pexp{\quantifier{\equiv}{a}{a{\in}V}{\fapp{even}{(\fapp{d}{a})}}}<br />
\hint{=}{$even$ distributes over addition}<br />
\pexp{\fapp{even}{\quantifier{\Sigma}{a}{a{\in}V}{\fapp{d}{a})}}~~.}<br />
\endproof<br />
\]</p>
<p>This calculation shows that the parity of the number of vertices with odd degree is the same as the parity of the sum of all the degrees. But because each edge has two ends, the sum of all the degrees is simply twice the total number of edges. We thus have:</p>
<p>\[<br />
\beginproof<br />
\pexp{\quantifier{\equiv}{a}{a{\in}V\,{\wedge}\,\fapp{odd}{(\fapp{d}{a})}}{\fapp{even}{1}}}<br />
\hint{=}{calculation above}<br />
\pexp{\fapp{even}{\quantifier{\Sigma}{a}{a{\in}V}{\fapp{d}{a})}}}<br />
\hintf{=}{the sum of all the degrees is twice the}<br />
\hintl{number of edges, i.e., an even number}<br />
\pexp{true~~.}<br />
\endproof<br />
\]</p>
<p>And so we can conclude that every undirected graph contains an even number of vertices with odd degree.</p>
<h2>What is wrong with conventional solutions?</h2>
<p>Conventional solutions for this problem are usually very similar to the following one, taken from the book &#8220;Ingenuity in Mathematics&#8221; (p. 8), by Ross Honsberger:</p>
<blockquote><p>
The proof in general is simple. We denote by T the total of all the local degrees:</p>
<p>(1) T = d(A) + d(B) + d(C) + &#8230; + d(K) .</p>
<p>In evaluating T we count the number of edges running into A, the number into B, etc., and add. Because each edge has two ends, T is simply twice the number of edges; hence T is even.</p>
<p>Now the values d(P) on the right-hand side of (1) which are even add up to a sub-total which is also even. The remaining values d(P) each of which is odd, must also add up to an even sub-total (since T is even). This shows that there is an even number of odd d(P)&#8217;s (it takes an even number of odd numbers to give an even sum). Thus there must be an even number of vertices with odd local degree.
</p></blockquote>
<p>There is nothing <em>seriously</em> wrong with this solution. It clearly shows why the property holds. However, it is, in my view, oriented to verification: it starts by introducing the total sum of all the local degrees, observing that its value is even; then it analyses that sum to conclude the property. My question is: how can we teach students to come with the total sum of all the local degrees? In general, how can we teach students to come with seemingly unrelated concepts that will be crucial in the development of their arguments? I don&#8217;t think we can.</p>
<p>On the other hand, if we look at the goal-oriented proof, we see that the goal is simple to express. Furthermore, with some training, most students would write it correctly and would be able to calculate that the parity of the number of vertices with odd degree is the same as the parity of the sum of all the degrees. And then (and only then) the introduction of the total sum of all the degrees would make sense. In a way, goal-oriented calculations are like that famous <a href="http://en.wikipedia.org/wiki/Breaking_the_Magician%27s_Code">masked magician that reveals magic&#8217;s biggest secrets</a>, for they reveal how the rabbit got into the hat.</p>
]]></content:encoded>
			<wfw:commentRss>http://joaoff.com/2009/04/07/calculational-proof-handshaking-lemma/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Multiples in the Fibonacci series</title>
		<link>http://joaoff.com/2008/05/09/multiples-in-the-fibonacci-series/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=multiples-in-the-fibonacci-series</link>
		<comments>http://joaoff.com/2008/05/09/multiples-in-the-fibonacci-series/#comments</comments>
		<pubDate>Fri, 09 May 2008 16:18:30 +0000</pubDate>
		<dc:creator>João Ferreira</dc:creator>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[calculational]]></category>
		<category><![CDATA[distributivity]]></category>
		<category><![CDATA[fibonacci]]></category>
		<category><![CDATA[proof]]></category>
		<category><![CDATA[puzzles]]></category>

		<guid isPermaLink="false">http://www.joaoff.com/?p=64</guid>
		<description><![CDATA[I found the following problem on K. Rustan M. Leino&#8217;s puzzles page: [Carroll Morgan told me this puzzle.] Prove that for any positive K, every Kth number in the Fibonacci sequence is a multiple of the Kth number in the &#8230; <a href="http://joaoff.com/2008/05/09/multiples-in-the-fibonacci-series/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
<p>I found the following problem on <a href="http://research.microsoft.com/~leino/puzzles.html#Multiples%20in%20the%20Fibonacci%20series" title="K. Rustan M. Leino's puzzles page">K. Rustan M. Leino&#8217;s puzzles page</a>:</p>
<blockquote><p>
[Carroll Morgan told me this puzzle.]</p>
<p>Prove that for any positive K, every Kth number in the Fibonacci sequence is a multiple of the Kth number in the Fibonacci sequence.</p>
<p>More formally, for any natural number n, let F(n) denote Fibonacci number n. That is, F(0) = 0, F(1) = 1, and F(n+2) = F(n+1) + F(n).  Prove that for any positive K and natural n, F(n*K) is a multiple of F(K).
</p></blockquote>
<p>This problem caught my attention, because it looks like a good example for using a result that I have derived last year. My result gives a <a href="http://www.joaoff.com/publications/JFFs/JFF0" title="JFF0: Distributivity and the greatest common divisor">reasonable sufficient condition for showing that a function distributes over the greatest common divisor</a> and shows that the Fibonacci function satisfies the condition.</p>
<p>In fact, using the property that the Fibonacci function distributes over the greatest common divisor, we can solve this problem very easily. Using $\fapp{fib}{n}$ to denote the Fibonacci number $n$, $m{\nabla}n$ to denote the greatest common divisor of $m$ and $n$, and $\setminus$ to denote the division relation, a possible proof is:</p>
<p>\[<br />
\beginproof<br />
\pexp{\text{$\fapp{fib}{(n{\times}k)}$ is a multiple of $\fapp{fib}{k}$}}<br />
\hint{=}{definition}<br />
\pexp{\fapp{fib}{k} \setminus \fapp{fib}{(n{\times}k)}}<br />
\hint{=}{rewrite in terms of $\nabla$}<br />
\pexp{\fapp{fib}{k} ~\nabla~ \fapp{fib}{(n{\times}k)} ~=~ \fapp{fib}{k}}<br />
\hint{=}{$fib$ distributes over $\nabla$}<br />
\pexp{\fapp{fib}{(k{\nabla}(n{\times}k))} = \fapp{fib}{k}}<br />
\hint{=}{$k{\nabla}(n{\times}k) = k$}<br />
\pexp{\fapp{fib}{k} = \fapp{fib}{k}}<br />
\hint{=}{reflexivity}<br />
\pexp{true~~.}<br />
\endproof<br />
\]</p>
<p>The crucial step is clearly the one where we apply the distributivity property. Distributivity properties are very important, because they allow us to rewrite expressions in a way that prioritizes the function that has the most relevant properties. In the example above we could not simplify $\fapp{fib}{k}$ nor $\fapp{fib}{(n{\times}k)}$, but applying the distributivity property prioritised the $\nabla$ operator &#8212; and we know how to simplify $k{\nabla}(n{\times}k)$. Furthermore, in practice, distributivity properties reduce to simple syntactic manipulations, thus reducing the introduction of error and simplifying the verification of our arguments.</p>
<p>(Now that I think about it, perhaps it would be a good idea to write a note on distributivity properties, summarizing their importance and their relation with symbol dynamics.)</p>
<p>If you have any corrections, questions, or alternative proofs, please leave a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://joaoff.com/2008/05/09/multiples-in-the-fibonacci-series/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>New domain name (joaoff.com)</title>
		<link>http://joaoff.com/2008/02/25/new-domain-name-joaoffcom/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=new-domain-name-joaoffcom</link>
		<comments>http://joaoff.com/2008/02/25/new-domain-name-joaoffcom/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 20:21:58 +0000</pubDate>
		<dc:creator>João Ferreira</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[joaoff.com]]></category>

		<guid isPermaLink="false">http://www.joaoff.com/2008/02/25/new-domain-name-joaoffcom/</guid>
		<description><![CDATA[Some people were complaining about the domain joaoferreira.org, because it was a bit long and they never got the number of r&#8217;s in Ferreira right. From today, they can&#8217;t complain anymore! The new and official URL of this website is &#8230; <a href="http://joaoff.com/2008/02/25/new-domain-name-joaoffcom/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some people were complaining about the domain <a href="http://joaoferreira.org" title="Joao's website">joaoferreira.org</a>, because it was a bit long and they never got the number of r&#8217;s in Ferreira right. From today, they can&#8217;t complain anymore! </p>
<p>The new and official URL of this website is now shorter and r&#8217;s-free: <b><a href="http://joaoff.com" title="Joao's website">joaoff.com</a></b> .</p>
<p>If you don&#8217;t like it and prefer the old one, please let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://joaoff.com/2008/02/25/new-domain-name-joaoffcom/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A reward check from Donald Knuth</title>
		<link>http://joaoff.com/2008/02/25/a-reward-check-from-donald-knuth/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=a-reward-check-from-donald-knuth</link>
		<comments>http://joaoff.com/2008/02/25/a-reward-check-from-donald-knuth/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 20:10:51 +0000</pubDate>
		<dc:creator>João Ferreira</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[correction]]></category>
		<category><![CDATA[knuth]]></category>

		<guid isPermaLink="false">http://www.joaoff.com/2008/02/25/a-reward-check-from-donald-knuth/</guid>
		<description><![CDATA[The other day I went to my pigeon-hole to collect my snail mail, and I had a letter from Donald E. Knuth, Professor Emeritus of the Art of Computer Programming! Inside, there was a check for a correction I sent &#8230; <a href="http://joaoff.com/2008/02/25/a-reward-check-from-donald-knuth/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The other day I went to my pigeon-hole to collect my snail mail, and I had a letter from Donald E. Knuth, Professor Emeritus of the Art of Computer Programming!</p>
<div style="text-align: center;"><img src="http://joaoff.com/wp-content/uploads/2008/02/knuth-cover.jpg" alt="Cover of the letter that Knuth sent to Joao" /></div>
<p>Inside, there was a check for a correction I sent him some months ago. In fact, it was not really a correction; it was more like a comment. And it was so obvious (he even said that) that he just sent $\$$0.32, instead of the usual $\$$2.56. But hey, who cares? I&#8217;ve got Knuth&#8217;s autograph now <img src='http://joaoff.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div style="text-align: center;"><img class="alignnone size-full wp-image-309" title="A reward check from Donald Knuth" src="http://joaoff.com/wp-content/uploads/2008/02/knuth-check1.jpg" alt="A reward check from Donald Knuth" width="600" height="511" /></div>
<p>Perhaps I should set as one of my goals to find a proper error, so that I can receive a $\$$2.56 check <img src='http://joaoff.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  By the way, <a title="Concrete Mathematics Errata" href="http://www-cs-faculty.stanford.edu/~knuth/gkp.html">the errata of the Concrete Mathematics is available online</a> and this particular omission is documented as follows:</p>
<blockquote><p>page 338, line 2 from the bottom<br />
change &#8220;for $z$&#8221; to &#8220;for $z$ and multiplying by $a$&#8221;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://joaoff.com/2008/02/25/a-reward-check-from-donald-knuth/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 0.667 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-02-04 11:00:20 -->

