<?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; Education</title>
	<atom:link href="http://www.joaoff.com/category/education/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>Probabilities in Proofreading</title>
		<link>http://www.joaoff.com/2009/09/14/probabilities-in-proofreading/</link>
		<comments>http://www.joaoff.com/2009/09/14/probabilities-in-proofreading/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 14:04:36 +0000</pubDate>
		<dc:creator>jff</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, and . Your two friends read the code and when they finish, A errors are detected by , B errors are detected by , and C errors are detected by both. So, in total, A+B-C errors are detected and [...]]]></description>
			<content:encoded><![CDATA[<p>Suppose you write a program and you send the source code to two of your friends, <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/c9f921b61d2fff93afaa651d353c1795.png' title="LaTeX Formula" alt="LaTeX Formula" /> and <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/42cf2846c21109921b17709ef41d2489.png' title="LaTeX Formula" alt="LaTeX Formula" />. Your two friends read the code and when they finish, <em>A</em> errors are detected by <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/c9f921b61d2fff93afaa651d353c1795.png' title="LaTeX Formula" alt="LaTeX Formula" />, <em>B</em> errors are detected by <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/42cf2846c21109921b17709ef41d2489.png' title="LaTeX Formula" alt="LaTeX Formula" />, and <em>C</em> errors are detected by both. So, in total, <em>A+B-C</em> 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>
<h3>Estimating the number of unnoticed errors</h3>
<p>Let <em>E</em> be the number of all errors, noticed and unnoticed, in the source code. Our goal is to estimate the value of <em>E-(A+B-C)</em>. Let <em>p</em> be the probability that friend <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/c9f921b61d2fff93afaa651d353c1795.png' title="LaTeX Formula" alt="LaTeX Formula" /> notices any given error and <em>q</em> the analogous probability for friend <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/42cf2846c21109921b17709ef41d2489.png' title="LaTeX Formula" alt="LaTeX Formula" />. The expected number of errors that may be detected by <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/c9f921b61d2fff93afaa651d353c1795.png' title="LaTeX Formula" alt="LaTeX Formula" /> is <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/8cc3bbe573866e221e7058d5c94f4d29.png' title="LaTeX Formula" alt="LaTeX Formula" /> and by <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/42cf2846c21109921b17709ef41d2489.png' title="LaTeX Formula" alt="LaTeX Formula" /> is <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/7056be452630dd69988efc1014cb132a.png' title="LaTeX Formula" alt="LaTeX Formula" />. Assuming that these probabilities are independent, the expected number of errors that may be mutually detected by both friends is <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/11091e85ba69d9e4f9df5448109fab45.png' title="LaTeX Formula" alt="LaTeX Formula" />.</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, <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/f6b99c84e75877cc3b7a90c154ac13d5.png' title="LaTeX Formula" alt="LaTeX Formula" />, <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/7f97b9bcffe46f8d265985d6c19c88c7.png' title="LaTeX Formula" alt="LaTeX Formula" />, and <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/2c4ca7fc8699851220220bd5da2ff535.png' title="LaTeX Formula" alt="LaTeX Formula" />. (We use the notation <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/39336a2ffd276833bc2af414ed460bfa.png' title="LaTeX Formula" alt="LaTeX Formula" /> 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 <em>E-(A+B-C)</em>. We calculate:</p>
<p><img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/d5bab5f3311a1d1c63abbb8274ac53ac.png' title="LaTeX Formula" alt="LaTeX Formula" /></p>
<p>This is the desired estimate!</p>
<p style="margin-top: 10px;"><strong>Related Articles:</strong></p><ul><li><a href="http://www.joaoff.com/2008/05/09/multiples-in-the-fibonacci-series/" rel="bookmark">Multiples in the Fibonacci series</a></li><li><a href="http://www.joaoff.com/2008/02/11/direct-proofs/" rel="bookmark">Calculational proofs are usually direct</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.joaoff.com/2009/09/14/probabilities-in-proofreading/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Calculational Proof of the Handshaking Lemma</title>
		<link>http://www.joaoff.com/2009/04/07/calculational-proof-handshaking-lemma/</link>
		<comments>http://www.joaoff.com/2009/04/07/calculational-proof-handshaking-lemma/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 21:11:55 +0000</pubDate>
		<dc:creator>jff</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[In graph theory, the degree of a vertex A, d.A, is the number of edges incident with the vertex A, counting loops twice. So, considering graph 0 below, we have d.A=3, d.B=3, d.C=1, d.D=3, and d.E=2. A well-known property is that every undirected graph contains an even number of vertices with odd degree. The result [...]]]></description>
			<content:encoded><![CDATA[<p>In graph theory, the degree of a vertex <em>A</em>, <em>d.A</em>, is the number of edges incident with the vertex A, counting loops twice. So, considering graph 0 below, we have <em>d.A=3</em>, <em>d.B=3</em>, <em>d.C=1</em>, <em>d.D=3</em>, and <em>d.E=2</em>.</p>
<div id="attachment_90" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.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://www.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 (<em>A</em>,<em>B</em>,<em>C</em>, and <em>D</em>), 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-86"></span><br />
Before we start, let me explain the notations that I use. I assume the existence of two predicates, <em>even</em> and <em>odd</em>, that test the parity of numbers. For example, <em>even.8</em> and <em>odd.3</em> are both <em>true</em>, and <em>even.5</em> and <em>odd.6</em> are both <em>false</em>. 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 <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/be3b25ccb6b37e8248904e21294b3ddf.png' title="LaTeX Formula" alt="LaTeX Formula" />, and instead of writing <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/11d37b46677a90b3273eef87d2744aca.png' title="LaTeX Formula" alt="LaTeX Formula" /> , I write <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/d33282de72be9e825fe5b452d1d0a305.png' title="LaTeX Formula" alt="LaTeX Formula" />.</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 <em>V</em> is the set of all vertices, our goal is to determine the value of the following expression:</p>
<div class="latex-margin">
<img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/b3bb6964f72c90aa61c7427867a66568.png' title="LaTeX Formula" alt="LaTeX Formula" />
</div>
<p>Note that we are adding 1 (counting) for each node <em>a</em> in <em>V</em> with an odd degree. We then apply the predicate <em>even</em> to the result. If the result is <em>true</em>, 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 <em>false</em>, 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 <em>even</em> distributes over addition, so we calculate:</p>
<p><img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/4e8aa954abd05c14d92756a7ac227f40.png' title="LaTeX Formula" alt="LaTeX Formula" /></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><img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/d52d70c3553e9e22ee975f34a594f8b6.png' title="LaTeX Formula" alt="LaTeX Formula" /></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://www.joaoff.com/2009/04/07/calculational-proof-handshaking-lemma/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Calculational proofs are usually direct</title>
		<link>http://www.joaoff.com/2008/02/11/direct-proofs/</link>
		<comments>http://www.joaoff.com/2008/02/11/direct-proofs/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 00:02:03 +0000</pubDate>
		<dc:creator>jff</dc:creator>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[calculational]]></category>
		<category><![CDATA[irrationality]]></category>
		<category><![CDATA[proofs]]></category>

		<guid isPermaLink="false">http://www.joaoferreira.org/2008/02/11/direct-proofs/</guid>
		<description><![CDATA[jd2718 asked in his blog if anyone knew a direct proof of the irrationality of &#160;&#160;. In this post I present a proof that, even if some don&#8217;t consider it direct, is a nice example of the effectiveness of calculational proof. But first, there are two concepts that need to be clarified: direct proof and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jd2718.wordpress.com/2008/02/06/is-there-a-direct-proof/" title="Is there a direct proof for the irrationality of sqrt(2)?">jd2718 asked in his blog</a> if anyone knew a direct proof of the irrationality of <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/e3ffc1186774b36e03fbf02a80b794db.png' title="LaTeX Formula" alt="LaTeX Formula" />&nbsp;&nbsp;. In this post I present a proof that, even if some don&#8217;t consider it direct, is a nice example of the effectiveness of calculational proof. But first, there are two concepts that need to be clarified: <em>direct proof</em> and <em>irrational number</em>.</p>
<h2>Direct proofs</h2>
<p>The concept of direct proof can vary slightly from person to person. For instance, <a href="http://en.wikipedia.org/wiki/Direct_proof" title="Definition of Direct Proof in Wikipedia">Wikipedia defines it as</a>:</p>
<blockquote><p>In mathematics and logic, a direct proof is a way of showing the truth or falsehood of a given statement by a straightforward combination of established facts, usually existing lemmas and theorems, without making any further assumptions.</p></blockquote>
<p>Alternatively, in <a href="http://zimmer.csufresno.edu/~larryc/proofs/proofs.direct.html" title="Definition of Direct Proof at Larry Cusick's website">Larry W. Cusick&#8217;s website we can read</a>:</p>
<blockquote><p>
A direct poof [<i>sic</i>] should be thought of as a flow of implications beginning with &#8220;P&#8221; and ending with &#8220;Q&#8221;.</p>
<p>P -> &#8230; -> Q</p>
<p>Most proofs are (and should be) direct proofs. Always try direct proof first, unless you have a good reason not to.
</p></blockquote>
<p>I consider the wording &#8216;<i>without making any further assumptions</i>&#8216; in the first definition ambiguous and I don&#8217;t understand why the second definition only applies to implications. But anyway, with these definitions in mind, a direct proof for the irrationality of <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/71486f265f83bc1e3d2b6f67704bcc23.png' title="LaTeX Formula" alt="LaTeX Formula" /> can be something like:</p>
<div class="latex-margin">
<img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/548fc40d95576c3a28bbccd7978041ec.png' title="LaTeX Formula" alt="LaTeX Formula" />
</div>
<p>Or, alternatively, we can also use a proof of the following shape:</p>
<div class="latex-margin">
<img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/7bea98f144c5cf871381e339a7da2770.png' title="LaTeX Formula" alt="LaTeX Formula" />
</div>
<h2>Irrational numbers</h2>
<p>An irrational number is a real number that can&#8217;t be expressed as a simple fraction. Therefore, the number <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/71486f265f83bc1e3d2b6f67704bcc23.png' title="LaTeX Formula" alt="LaTeX Formula" /> is irrational because for all integers m and n, with n non-negative, we have that:</p>
<div class="latex-margin">
<img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/f7b8eba2e56a090a2b1d238a148123f4.png' title="LaTeX Formula" alt="LaTeX Formula" />
</div>
<h2>A direct proof for the irrationality of <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/71486f265f83bc1e3d2b6f67704bcc23.png' title="LaTeX Formula" alt="LaTeX Formula" /></h2>
<p>Now that we have clarified the concepts above, we prove that <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/71486f265f83bc1e3d2b6f67704bcc23.png' title="LaTeX Formula" alt="LaTeX Formula" /> is irrational. For all integers m and n, with n non-negative, we have:</p>
<div class="latex-margin">
<img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/d18ae2dd07478a1d23daf198f99b64e7.png' title="LaTeX Formula" alt="LaTeX Formula" />
</div>
<p>Note that, unlike traditional proofs, we don&#8217;t assume that m and n are co-prime, nor that <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/71486f265f83bc1e3d2b6f67704bcc23.png' title="LaTeX Formula" alt="LaTeX Formula" /> is a rational. We essentially derive the boolean value of the expression <img class="lateximg" src='http://www.joaoferreira.org/wp-content/plugins/wp-latexrenderer/pictures/f1924c6abc6e88eeb2dc5618df8219b0.png' title="LaTeX Formula" alt="LaTeX Formula" /></p>
<p>If you have any suggestions or corrections, please leave a comment. I&#8217;d be more than happy to hear from you.</p>
<p>Note: I learnt the contrapositive of this proof from Roland Backhouse (page 38, <a href="http://www.amazon.co.uk/Program-Construction-Calculating-Implementations-Specifications/dp/0470848820/ref=pd_bbs_sr_1?ie=UTF8&#038;s=gateway&#038;qid=1202602020&#038;sr=8-1" title="Program Construction -- Calculating Implementations from Specifications">Program Construction &#8212; Calculating Implementations from Specifications</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joaoff.com/2008/02/11/direct-proofs/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>In Defense Of Computer Science</title>
		<link>http://www.joaoff.com/2008/01/30/in-defense-of-computer-science/</link>
		<comments>http://www.joaoff.com/2008/01/30/in-defense-of-computer-science/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 13:10:48 +0000</pubDate>
		<dc:creator>jff</dc:creator>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://www.joaoferreira.org/2008/01/30/in-defense-of-computer-science/</guid>
		<description><![CDATA[Very good post from Paper Trail: So why study computer science? The job prospects at the end are usually pretty good &#8211; because, if nothing else, you can become a pretty good software developer fairly quickly &#8211; but they are unknown. My argument is that the study of computer science is enough of an incentive [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://hnr.dnsalias.net/wp/?p=39" title="In Defense of Computer Science">Very good post</a> from <a href="http://hnr.dnsalias.net/wp" title="Paper Trail">Paper Trail</a>:</p>
<blockquote><p>So why study computer science? The job prospects at the end are usually pretty good &#8211; because, if nothing else, you can become a pretty good software developer fairly quickly &#8211; but they are unknown. My argument is that the study of computer science is enough of an incentive enough to make it worthwhile.</p></blockquote>
<p style="margin-top: 10px;"><strong>Related Articles:</strong></p><ul><li><a href="http://www.joaoff.com/2008/01/22/the-programmers-of-tomorrow/" rel="bookmark">The programmers of tomorrow</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.joaoff.com/2008/01/30/in-defense-of-computer-science/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The programmers of tomorrow</title>
		<link>http://www.joaoff.com/2008/01/22/the-programmers-of-tomorrow/</link>
		<comments>http://www.joaoff.com/2008/01/22/the-programmers-of-tomorrow/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 23:43:00 +0000</pubDate>
		<dc:creator>jff</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[university]]></category>

		<guid isPermaLink="false">http://www.joaoferreira.org/2008/01/22/the-programmers-of-tomorrow/</guid>
		<description><![CDATA[A recent article written by Dr. Robert B.K. Dewar and Dr. Edmond Schonberg (both from AdaCore Inc.) is generating some discussion on the state of Computer Science (CS) education in the United States. In &#8220;Computer Science Education: Where Are the Software Engineers of Tomorrow?&#8220;, Dewar and Schonberg claim that U.S. universities are training unqualified and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.stsc.hill.af.mil/CrossTalk/2008/01/0801DewarSchonberg.html" title="Computer Science Education: Where Are the Software Engineers of Tomorrow?">A recent article written by Dr. Robert B.K. Dewar and Dr. Edmond Schonberg</a> (both from AdaCore Inc.) is generating <a href="http://reddit.com/r/programming/info/665i5/comments/" title="Some comments about Dewar and Schonberg article on reddit.com">some</a> discussion on the state of Computer Science (CS) education in the United States. In &#8220;<a href="http://www.stsc.hill.af.mil/CrossTalk/2008/01/0801DewarSchonberg.html" title="Computer Science Education: Where Are the Software Engineers of Tomorrow?">Computer Science Education: Where Are the Software Engineers of Tomorrow?</a>&#8220;, Dewar and Schonberg claim that U.S. universities are training unqualified and easily replaceable programmers. </p>
<blockquote><p>&#8220;It is our view that Computer Science (CS) education is neglecting basic skills, in particular in the areas of programming and formal methods. We consider that the general adoption of Java as a first programming language is in part responsible for this decline. We examine briefly the set of programming skills that should be part of every software professional’s repertoire.&#8221;</p></blockquote>
<p>The comment about Java&#8217;s adoption annoyed some Java aficionados, but <a href="http://itmanagement.earthweb.com/career/article.php/11067_3722876_1" title="Who Killed the Software Engineer? (Hint: It Happened in College)">in a recent interview</a>, Robert Dewar adds that the problem goes far beyond the choice of Java as the first programming language. The real problem is that CS programs are being dumbed down, so that they become more accessible and popular. In result, they &#8220;are not rigorous enough and don&#8217;t promote in-depth thinking and problem solving&#8221;.</p>
<blockquote><p>“A lot of it is, ‘Let’s make this all more fun.’ You know, ‘Math is not fun, let’s reduce math requirements. Algorithms are not fun, let’s get rid of them. <i>Ewww</i> – graphic libraries, they’re <i>fun</i>. Let’s have people mess with libraries. And [forget] all this business about ‘command line’ – we’ll have people use nice visual interfaces where they can point and click and do fancy graphic stuff and have <i>fun</i>.&#8221;</p></blockquote>
<p>Although the paper is concerned with the American reality, I believe we have the same problem in Europe &mdash; at least, and as far as I know, in the UK and in Portugal. However, in my opinion, the problem starts before university. The maths&#8217;s programs in secondary schools are also being simplified (or dumbed down, if you prefer) and many important concepts, like logic and proofs, are being ignored.</p>
<p>In result, first-year students usually have a poor background on maths and problem solving. In fact, most of them have never seen a proof and don&#8217;t even understand the importance of mathematical reasoning. With poor reasoning abilities, they become intellectually less curious, accepting things as they are presented, and they have tremendous difficulties creating new algorithms, or convincing someone that their own algorithms are correct.</p>
<p>Moreover, once they are in the university, one of two things happens:</p>
<ol>
<li>they are not taught explicitly how to solve problems or how to derive algorithms from their formal specifications (this is the most common case);</li>
<li>or they are taught the above skills but their poor background doesn&#8217;t allow them to fully appreciate these subjects.</li>
</ol>
<p><span id="more-27"></span></p>
<h2>What can be done?</h2>
<p>Dewar and Schonberg suggest some skills to be taught:</p>
<blockquote><p>&#8220;Students need to be exposed to the tools to construct large-scale reliable programs, as we discussed at the start of this article. Topics of relevance are studying formal specification methods and formal proof methodologies, as well as gaining an understanding of how high-reliability code is certified in the real world. When you step into a plane, you are putting your life in the hands of software which had better be totally reliable. As a computer scientist, you should have some knowledge of how this level of reliability is achieved. In this day and age, the fear of terrorist cyber attacks have given a new urgency to the building of software that is not only bug free, but is also immune from malicious attack. Such high-security software relies even more extensively on formal methodologies, and our students need to be prepared for this new world.&#8221;</p></blockquote>
<p>I agree with every word in this paragraph! We really need professionals capable of creating certified software that works under all circumstances.</p>
<h3>Joel Spolsky&#8217;s proposal</h3>
<p>Joel Spolky&#8217;s wrote <a href="http://www.joelonsoftware.com/items/2008/01/08.html" title="Undergraduate programming, by Joel Spolsky">an interesting post</a> where he suggests the following:</p>
<blockquote><p>&#8220;I think the solution would be to create a programming-intensive BFA in Software Development&#8211;a Julliard for programmers. Such a program would consist of a practical studio requirement developing significant works of software on teams with very experienced teachers, with a sprinkling of liberal arts classes for balance. It would be a huge magnet to the talented high school kids who love programming, but can&#8217;t get excited about proving theorums.&#8221;</p></blockquote>
<p>Obviously, this is a much more pragmatic and &#8220;hackish&#8221; approach than what Dewar and Schonberg suggest. He also writes:</p>
<blockquote><p>&#8220;When I said BFA, Bachelor of Fine Arts, I meant it: software development is an art, and the existing Computer Science education, where you&#8217;re expected to learn a few things about NP completeness and Quicksort is singularly inadequate to training students how to develop software.&#8221;</p></blockquote>
<p>I think I understand what Joel means when he writes that programming is an art. However, I prefer to call it a science. You see, art is subjective: it exists in your mind. We can both look to the same photograph or painting, and express different interpretations. A program, however, can&#8217;t be seen subjectively. Given a program, we have to be able to say <em>objectively</em> if it is correct (according to some specification) or if it is efficient. It is not a matter of aesthetic principles.</p>
<h3>Other Comments</h3>
<p><a href="http://www.ekinoderm.com/wordpress/?p=27" title="Who did Kill the Software Engineer?">The author of Ekinoderm caught my attention when he wrote the following:</a></p>
<blockquote><p>&#8220;When I got my B.S. (in 2003), I can remember students in my classes constantly grousing about how topics like Scheme or Finite State Automata were “useless” and we should spend our time doing “useful” things like learning how to use VB to make a database app or something. Or, God forbid, writing web apps in PHP.&#8221;</p></blockquote>
<p>Interestingly, I had a very similar experience during my university degree. Many students in my classes didn&#8217;t like functional programming nor formal methods, because, according to them, these skills were useless to get a job; and they also didn&#8217;t like to encode the usual algorithms for trees or graphs in C, because their favourite language (usually Java or VB) already had libraries with the algorithms implemented.</p>
<p>On the contrary, I was interested in functional programming and formal methods. And I think I have benefited quite a lot from studying them. I also learned a lot implementing data structures and algorithms in C. Even so, and after several programming projects at the university, and a job programming Python for a company that offered <a href="http://www.plone.org" title="Plone website">Plone</a> services, I didn&#8217;t feel ready for delivering certified programs (with proofs of correctness included). That was basically the reason why I have embarked in a PhD: I felt the need of programming by construction.</p>
<h2>Final Notes</h2>
<p>In 1975, Edsger Dijkstra wrote a famous note named &#8220;<a href="http://www.cs.utexas.edu/~EWD/transcriptions/EWD04xx/EWD498.html" title="EWD498: How do we tell truths that might hurt?">How do we tell truths that might hurt?</a>&#8220;, where he enumerated some of the unpleasant truths about Computer Science. In the first paragraph, he basically explains why exposing truths (just like Dewar and Schonberg did) gives rise to so much discussion and discordance:</p>
<blockquote><p>&#8220;Sometimes we discover unpleasant truths. Whenever we do so, we are in difficulties: suppressing them is scientifically dishonest, so we must tell them, but telling them, however, will fire back on us. If the truths are sufficiently impalatable, our audience is psychically incapable of accepting them and we will be written off as totally unrealistic, hopelessly idealistic, dangerously revolutionary, foolishly gullible or what have you. (Besides that, telling such truths is a sure way of making oneself unpopular in many circles, and, as such, it is an act that, in general, is not without personal risks. Vide Galileo Galilei&#8230;..)&#8221;</p></blockquote>
<p>What is really amazing is that, 33 years later, some of the most unpleasant truths he enumerated are still true:</p>
<blockquote>
<ul>
<li>Programming is one of the most difficult branches of applied mathematics; the poorer mathematicians had better remain pure mathematicians.</li>
<li>The easiest machine applications are the technical/scientific computations.</li>
<li>The tools we use have a profound (and devious!) influence on our thinking habits, and, therefore, on our thinking abilities.</li>
<li>The problems of business administration in general and data base management in particular are much too difficult for people that think in IBMerese, compounded with sloppy English.</li>
<li>About the use of language: it is impossible to sharpen a pencil with a blunt axe. It is equally vain to try to do it with ten blunt axes instead.</li>
<li>Besides a mathematical inclination, an exceptionally good mastery of one&#8217;s native tongue is the most vital asset of a competent programmer.</li>
<li>Simplicity is prerequisite for reliability.</li>
<li>By claiming that they can contribute to software engineering, the soft scientists make themselves even more ridiculous. (Not less dangerous, alas!) In spite of its name, software engineering requires (cruelly) hard science for its support.</li>
</ul>
</blockquote>
<p>To conclude the post, allow me to add one to the list:</p>
<blockquote><p>As long as programming is considered a soft science and the formal derivation of algorithms is neglected, there will always be people enumerating unpleasant truths about Computer Science.
</p></blockquote>
<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><li><a href="http://www.joaoff.com/2006/12/28/on-programming-and-mathematical-methodology/" rel="bookmark">On Programming and Mathematical Methodology</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.joaoff.com/2008/01/22/the-programmers-of-tomorrow/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
