<?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; goal-oriented</title>
	<atom:link href="http://www.joaoff.com/tag/goal-oriented/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>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>
	</channel>
</rss>
