<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>João Ferreira &#187; Personal</title>
	<atom:link href="http://www.joaoff.com/tag/personal/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joaoff.com</link>
	<description>Programming, Algorithms, and Mathematics</description>
	<lastBuildDate>Wed, 09 Jun 2010 10:41:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>New domain name (joaoff.com)</title>
		<link>http://www.joaoff.com/2008/02/25/new-domain-name-joaoffcom/</link>
		<comments>http://www.joaoff.com/2008/02/25/new-domain-name-joaoffcom/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 20:21:58 +0000</pubDate>
		<dc:creator>jff</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 now shorter and r&#8217;s-free: joaoff.com . If you don&#8217;t like it and prefer the old [...]]]></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://www.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://www.joaoff.com/2008/02/25/a-reward-check-from-donald-knuth/</link>
		<comments>http://www.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>jff</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 him some months ago. In fact, it was not really a correction; it was more [...]]]></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://www.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://www.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://www.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://www.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://www.joaoff.com/2008/02/25/a-reward-check-from-donald-knuth/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>I am still alive!</title>
		<link>http://www.joaoff.com/2007/06/15/i-am-still-alive/</link>
		<comments>http://www.joaoff.com/2007/06/15/i-am-still-alive/#comments</comments>
		<pubDate>Fri, 15 Jun 2007 00:00:00 +0000</pubDate>
		<dc:creator>jff</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.joaoferreira.org/2007/06/15/i-am-still-alive/</guid>
		<description><![CDATA[That&#8217;s true: the last post was exactly 5 months ago, but I&#8217;m still alive! A lot of new stuff happened during these 5 months. Two days after writing the last post, I went with my group (Foundations of Programming) to a very nice hotel in Ruddington, where, during two days, each member had to present [...]]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s true: the last post was exactly 5 months ago, but I&#8217;m still alive! A lot of new stuff happened during these 5 months. Two days after writing the last post, I went with my <a href="http://www.cs.nott.ac.uk/Research/fop/" title="Foundations of Programming Group">group</a> (Foundations of Programming) to a very nice hotel in Ruddington, where, during two days, each member had to present something about his/her work. I&#8217;ve talked about a result I&#8217;ve derived related with distributivity through the Greatest Common Divisor. <a href="http://www.cs.nott.ac.uk/~nhn/FoPAD2007/Talks/jff-FoPAD2007.pdf" title="My slides at the FoP Away Day 2007">My slides</a> are available at the <a href="http://www.cs.nott.ac.uk/~nhn/FoPAD2007/" title="FoP Away Day 2007">event&#8217;s webpage</a> and I will put online a note with all the details.</p>
<p>A few days later Alexandra got ill with some strange pain in the abdominal area. The following weeks were really hard, since she had to go to the hospital emergency services. So that you have an idea of how strange the whole thing was, the doctors still don&#8217;t know what the problem is! Now, she has occasional pain, but it seems to be much more controlled.</p>
<p>Anyway, more or less at the same time I started to read a very nice article (a Functional Pearl) written by Jeremy Gibbons, Richard Bird and David Lester named &#8220;<a href="http://web.comlab.ox.ac.uk/oucl/work/jeremy.gibbons/publications/rationals.pdf" title="Enumerating the Rationals article">Enumerating the Rationals</a>&#8220;. The paper presents some algorithms encoded in Haskell to enumerate the positive rational numbers. In particular, it presents algorithms to construct the famous <a href="http://www.cut-the-knot.org/blue/Stern.shtml" title="Stern-Brocot tree">Stern-Brocot</a> and <a href="http://www.math.upenn.edu/~wilf/website/recounting.pdf" title="Recounting the Rationals article, where Calkin-Wilf tree is presented">Calkin-Wilf</a> trees. It also presents a very efficient algorithm to enumerate the rationals in Calkin-Wilf order just by using as current state the previous rational (i.e., two integer numbers). However, the authors claim that &#8220;it is not at all obvious&#8221; how to create a similar efficient algorithm for enumerating the rationals in Stern-Brocot order. Well, after reading it, Roland (my supervisor) and me found a way of doing it. The key idea is that rational numbers are pairs of coprime numbers (numbers which greatest common divisor is 1) and thus, we can use Euclid&#8217;s algorithm as a basis for enumerating these pairs. By using the Extended Euclid&#8217;s algorithm written using matrix multiplication, we were able to derive both Calkin-Wilf and Stern-Brocot enumerations from the same algorithm. We wrote a <a href="http://cs.nott.ac.uk/~jff/papers/RecountingRationalsTwice.pdf" title="Recounting the Rationals: Twice!">paper named &#8220;Recounting the Rationals: Twice!&#8221;</a> that was submitted to the journal <a href="http://www.maa.org/pubs/monthly.html" title="American Mathematical Monthly">American Mathematical Monthly</a>.</p>
<p><span id="more-20"></span>I&#8217;ve also presented the algorithm at the <a href="http://sneezy.cs.nott.ac.uk/fun/may-07" title="Fun in the Afternoon, Cambridge, May 2007">&#8220;Fun in the Afternoon&#8221; event in Cambridge</a>, last May. I think the talk was clear enough and, although it has nothing to do with functional programming, its methodological aspect should be interesting enough to any (functional) programmer. I&#8217;ve had very positive feedback on the talk, which is a good sign. <a href="http://sneezy.cs.nott.ac.uk/fun/may-07/EnumeratingRationalsTwice.pdf" title="Slides of my talk at Fun in the Afternoon, May 2007, Cambridge">The slides of the talk</a> are available in the event&#8217;s webpage.</p>
<p>In April I&#8217;ve attended to the <a href="http://www.cs.nott.ac.uk/~nhn/MGS2007/" title="Midlands Graduate School 2007, Nottingham">Midlands Graduate School</a> (MGS Spring School). It was a very nice event organised by our group (in particular, I have to congratulate <a href="http://www.cs.nott.ac.uk/~nhn" title="Henrik Nilsson">Henrik</a> and <a href="http://www.cs.nott.ac.uk/~gmh/" title="Graham Hutton">Graham</a> for their excellent work!) with very nice talks as well. My favourite courses were Category Theory, Algorithmic Problem Solving and Operational Semantics, but I&#8217;ve also enjoyed the others I&#8217;ve attended. The best thing about this kind of event is the social interaction that you have with other students and researchers. And again, as happened before in other similar events, I always get that cold sensation that I don&#8217;t know nothing about anything! The good news is that this feeling is a constructive one, since I get motivated to learn more!</p>
<p>And since we&#8217;re talking about learning, I&#8217;m currently studying <a href="http://www.cut-the-knot.org/blue/GeneratingFunctions.shtml" title="Generating Functions at cut-the-knot.org">Generating Functions</a>, which are formal power series that encode information about sequences. Generating Functions are a very powerful tool: they can be used to prove identities very easily, to find nice and closed formulas to recurrence relations, to work with datatypes in order to find isomorphisms and, more importantly to my work, they can be used to solve counting problems in a very effective way. I&#8217;m writing a note about what I&#8217;m learning and I&#8217;ll probably post it here.</p>
<p>To finish the news about work, I&#8217;m currently preparing two JFFs (JFFs are my personal technical notes). The first one deals with the very known and simple problem that consists in swapping the value of two variables without using another temporary one. The second shows how to construct a very famous algorithm. I promise that I will post the notes here, as soon as they are available!</p>
<p>Besides work, I guess that the only relevant thing to talk about is that we went on holidays to Halkidiki in Greece in the last week of May. It was excellent and Alexandra and me will post a somewhat detailed description on our <a href="http://www.furiousmind.org" title="Furiousmind: Cinema, Places and Mathematics">joint blog Furiousmind.org</a>.</p>
<p><center><!--adsense#middleblock--></center>Other thing I did that I consider important enough to be mentioned, was to install Linux in my Powerbook G4. I was unhappy with Mac OS for quite a long time and decided to stop complaining and do something about it. The installation process was simple and the wireless connection worked with no further configuration (I was really surprised)! I&#8217;m now a much happier guy: I can still do what I need to do and I&#8217;m not using any proprietary software at all!To conclude the post, let me just tell you my plans for the next month:</p>
<ol>
<li>Post JFF0, JFF1 and JFF2 (these are the notes on distributivity and the greatest common divisor, how to swap values of variables without using another temporary one and the construction of an algorithm that is well-known, respectively);</li>
<li>Prepare a note I have written together with my supervisor about Number Theory to be distributed;</li>
<li>Prepare things to the <a href="http://asimod.in.tum.de/" title="Summer School in Marktoberdorf for Formal Logic Methods for System Security and Correctness">Summer School in Marktoberdorf</a> (Formal Logical Methods for System Security and Correctness). It&#8217;s true! I&#8217;ve been accepted to participate in the school and I already got the plane tickets. This means that I&#8217;ll be in Germany from the 31st July to the 12th August. Then I fly directly to Portugal and I return to Nottingham on the 29th August. So, if you want something from Germany or Portugal, let me know <img src='http://www.joaoff.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Since I&#8217;m talking about trips, Alexandra and me are going to Amsterdam this next weekend. We&#8217;re really looking forward for it! And if you want something from there, please let us know.</li>
</ol>
<p>Thanks for reading and see you in the next post!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joaoff.com/2007/06/15/i-am-still-alive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Programming and Mathematical Methodology</title>
		<link>http://www.joaoff.com/2006/12/28/on-programming-and-mathematical-methodology/</link>
		<comments>http://www.joaoff.com/2006/12/28/on-programming-and-mathematical-methodology/#comments</comments>
		<pubDate>Thu, 28 Dec 2006 23:00:16 +0000</pubDate>
		<dc:creator>jff</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://www.joaoferreira.org/2006/12/26/on-programming-and-mathematical-methodology/</guid>
		<description><![CDATA[First of all, welcome to my new blog. Being this my first post, I will present myself, give you some background on what I am doing and explain what are my intentions about this blog. My name is João Fernando Ferreira and I am a research student at the Foundations of Programming research group at [...]]]></description>
			<content:encoded><![CDATA[<p>First of all, welcome to my new blog. Being this my first post, I will present myself, give you some background on what I am doing and explain what are my intentions about this blog. My name is João Fernando Ferreira and I am a research student at the <a href="http://www.cs.nott.ac.uk/Research/fop/" title="Foundations of Programming research group">Foundations of Programming</a> research group at the <a href="http://www.nottingham.ac.uk" title="University of Nottingham">University of Nottingham</a> (visit the <a href="http://www.joaoferreira.org/about" title="About João Ferreira">About</a> page to find out more).</p>
<p>My research is on algorithmic problem solving and its main goal is to develop calculational problem-solving techniques resulting in educational material supporting the use of a calculational     approach to algorithmic problem solving. The focus of the project will be on the dynamics of     problem solving &#8211; the processes of mathematical modelling and effective calculation in the     formulation of concise and precise algorithmic methods.</p>
<p>As any other researcher, I spend most of my time reading and writing. That is one of the reasons I have created this blog: to organise my written notes. Using a blog system brings me some advantages like:</p>
<ul>
<li>I can tag my notes and use the system search capabilities to find them;</li>
<li>I can access and change them from any place in the world, as long as I have Internet access;</li>
<li>I can add new content from any place in the world, as well;</li>
<li>I can share my notes and get feedback from my colleagues, supervisors, friends or anyone who is just interested in the same topics.</li>
</ul>
<p>Other important reason to share my notes and thoughts is that I think they may be of interest for programmers. Since this is my first post, and (probably) most of you don&#8217;t really understand what I am doing, I will start by presenting some historical facts (mixed with personal opinions) and motivations. It is my hope that these facts will help you understand the relation and importance of mathematical methodology to programming. Please note that to read the entire post, you may need to click the &#8220;<em>Read more</em>&#8221; link.</p>
<h4>Historical context</h4>
<p>In the 1960s, programmers started recognising that there were serious problems in the programming  field and that it was necessary to prove the correctness of programs. At the time, software engineering was facing a software crisis and programming was not very well understood. Many software projects ran over budget and schedule and some of them even caused property damage and loss of life (see the <a href="http://catless.ncl.ac.uk/Risks" title="RISKS-FORUM Digest">RISKS-FORUM Digest</a> for some examples).</p>
<p>To solve these problems, computer scientists focused on programming methodology and on ways to build programs in a systematic way. A common consensus was that programs should be proved correct, and in the late 1960s, some important articles had an important impact on the  field. In 1968, Edsger W. Dijkstra published an <a href="http://www.acm.org/classics/oct95/" title="Go To Statement Considered Harmful">article</a> on the harmfulness of the Go To statement, where he claims that its use makes it impossible to determine the progress of a program. Also, one year later, Tony Hoare published a seminal <a href="http://portal.acm.org/citation.cfm?id=363259" title="An Axiomatic Basis for Computer Programming">article</a> where he introduces the Hoare triples and an axiomatic approach to language definition.<br />
<span id="more-1"></span></p>
<p><!--adsense#pubmiddle-->Although Hoare&#8217;s theory had a great impact, it was quite difficult to use it to prove existing programs correct, since one was forced to  find an invariant for each loop. Programmers started studying alternatives, and the most plausible one was to develop the program together with its proof. Some years later, in 1975, Edsger W. Dijkstra published a <a href="http://doi.acm.org/10.1145/360933.360975" title="Guarded commands, nondeterminacy and formal derivation of programs">paper</a> where he introduced weakest preconditions. One year later he published the book &#8220;<a href="http://www.amazon.co.uk/Discipline-Programming-Automatic-Computation/dp/013215871X/sr=8-9/qid=1167330453/ref=sr_1_9/026-5905523-7560424?ie=UTF8&amp;s=books" title="A Discipline of Programming"><em>A Discipline of Programming</em></a>&#8221; and showed how to use weakest preconditions as a &#8220;calculus for the derivation of programs&#8221;. Programmers were now able to build programs in a more reliable and systematic way, and the <em>art</em> of programming became more and more a <em>discipline</em> of programming.</p>
<p>From here, Dijkstra and others, dedicated themselves to the &#8220;mathematization&#8221; of programming and they learned to derive programs from their specifications:  first simple ones, then more complicated programs. As the programs were becoming more and more complicated, the solutions were becoming less and less simple and beautiful. The reason was the &#8220;standard mathematical reasoning patterns&#8221; (see this <a href="http://www.mathmeth.com/wf/files/wf0xx/wf088.pdf" title="On Programming and Mathematical Reasoning">note</a>, page 9), which were not suitable for the task at hands. The conclusion was that computer scientists would have to learn how to construct proofs more effectively, in order to solve more ambitious problems. This was the beginning of a new period: computer scientists started to investigate ways of streamlining the mathematical argument. Mathematics and mathematicians were now faced with this new side of Computer Science.</p>
<p>During this new period, several problems were identified with traditional mathematics. One of the  first problems was that mathematicians hardly manipulate their formulas: they interpret them; and one of the reasons is that the notation they use is not adequate for manipulation. This and other conclusions were also presented in the <a href="http://www.springer.com/uk/home/generic/search/results?SGWID=3-40109-22-1353672-0" title="On the Shape of Mathematical Arguments">PhD thesis</a> of Netty van Gasteren &#8220;<em>On the shape of mathematical arguments</em>&#8220;, where she presents a very interesting study about proofs (proofs of correctness of programs included).</p>
<p>My project is basically a continuation of Netty&#8217;s study, but while she did a breadth study, I am concerned specifically with algorithmic problems: construction of new algorithms and usage of algorithmic techniques to simplify mathematical invention.</p>
<h4>Final notes</h4>
<p>Algorithms have been studied and developed since the beginning of civilisation, but, over the last decades, the unprecedented scale of programming problems and the consequent demands on precision and concision have made computer scientists hone their algorithmic problem-solving skills to a very fine degree.</p>
<p>Even so, and although much of mathematics is algorithmic in nature, the skills needed to formulate and solve algorithmic problems do not form an integral part of mathematics education; also, the teaching of computer-related topics at pre-university level focuses on enabling the student to be an effective user of information technology, rather than equip them with the skills to develop new applications or to solve new problems.</p>
<p>I believe that making clear the algorithmic nature of problems can help students understand what&#8217;s going on, and more importantly, they will be able to solve new problems more effectively. And since tomorrow&#8217;s programmers are today&#8217;s students, it is important that we learn how to streamline the mathematical argument, how to demystify the process of mathematical invention and how to turn the design of crisp arguments into a <strong>teachable</strong> discipline.</p>
<p>Thank you very much for reading my first post. It is already too long, so I will leave concrete examples and more detailed explanations &#8212; including derivation of programs from their specification &#8212; for later. I intend to write similar articles in the future, so if you like this one, consider subscribing this blog.</p>
<p style="margin-top: 10px;"><strong>Related Articles:</strong></p><ul><li><a href="http://www.joaoff.com/2007/01/15/on-programming-and-mathematical-methodology-part-ii/" rel="bookmark">On Programming and Mathematical Methodology -- Part II</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.joaoff.com/2006/12/28/on-programming-and-mathematical-methodology/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
