<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: How to be more confident about your own programs: an example using Perl</title>
	<atom:link href="http://www.joaoff.com/2007/07/26/how-to-be-more-confident-about-your-own-programs-an-example-using-perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joaoff.com/2007/07/26/how-to-be-more-confident-about-your-own-programs-an-example-using-perl/</link>
	<description>Programming, Algorithms, and Mathematics</description>
	<pubDate>Sat, 22 Nov 2008 05:28:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: jff</title>
		<link>http://www.joaoff.com/2007/07/26/how-to-be-more-confident-about-your-own-programs-an-example-using-perl/#comment-61</link>
		<dc:creator>jff</dc:creator>
		<pubDate>Thu, 26 Jul 2007 08:25:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.joaoferreira.org/2007/07/26/how-to-be-more-confident-about-your-own-programs-an-example-using-perl/#comment-61</guid>
		<description>Thanks Rob! I've added the proof for your solution to the post. I don't understand something in your argument, though. In equation 3, you say that n = y. But n is a natural and y is a real. And then you use this for equation 4. I believe the solution is correct, but I don't understand your proof.

Regarding the less-than in comments, I'll try to fix it. Sorry about that!</description>
		<content:encoded><![CDATA[<p>Thanks Rob! I&#8217;ve added the proof for your solution to the post. I don&#8217;t understand something in your argument, though. In equation 3, you say that n = y. But n is a natural and y is a real. And then you use this for equation 4. I believe the solution is correct, but I don&#8217;t understand your proof.</p>
<p>Regarding the less-than in comments, I&#8217;ll try to fix it. Sorry about that!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Mayoff</title>
		<link>http://www.joaoff.com/2007/07/26/how-to-be-more-confident-about-your-own-programs-an-example-using-perl/#comment-60</link>
		<dc:creator>Rob Mayoff</dc:creator>
		<pubDate>Thu, 26 Jul 2007 02:48:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.joaoferreira.org/2007/07/26/how-to-be-more-confident-about-your-own-programs-an-example-using-perl/#comment-60</guid>
		<description>My previous comment got completely hosed because the blog software threw away every less-than-symbol and all following characters until the next greater-than symbol.  Oh well.  The point is that ceil(x) = -floor(-x).</description>
		<content:encoded><![CDATA[<p>My previous comment got completely hosed because the blog software threw away every less-than-symbol and all following characters until the next greater-than symbol.  Oh well.  The point is that ceil(x) = -floor(-x).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Mayoff</title>
		<link>http://www.joaoff.com/2007/07/26/how-to-be-more-confident-about-your-own-programs-an-example-using-perl/#comment-59</link>
		<dc:creator>Rob Mayoff</dc:creator>
		<pubDate>Thu, 26 Jul 2007 02:44:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.joaoferreira.org/2007/07/26/how-to-be-more-confident-about-your-own-programs-an-example-using-perl/#comment-59</guid>
		<description>There's a simpler (IMHO) definition of ceil(x) in terms of floor(x):

For every integer n, n = -floor(-y). (eq. 2)
By algebra, n = y. (eq. 3)
Substitute eqs. 2 and 3 into eq. 1: for every integer n, -n &#62;= -floor(-y) iff -n &#62;= y. (eq. 4)
If predicate p(-n) is true for all integers n, then p(n) is also true for all integers n since both n and -n are integers.  So replace -n with n in eq. 4.
For every integer n, n &#62;= -floor(-y) iff n &#62;= y.
For every integer n, n &#62;= ceil(y) iff n &#62;= y. (def'n of ceil)
Therefore ceil(y) = -floor(-y).

In perl:

sub ceil {
  return ($_[0] </description>
		<content:encoded><![CDATA[<p>There&#8217;s a simpler (IMHO) definition of ceil(x) in terms of floor(x):</p>
<p>For every integer n, n = -floor(-y). (eq. 2)<br />
By algebra, n = y. (eq. 3)<br />
Substitute eqs. 2 and 3 into eq. 1: for every integer n, -n &gt;= -floor(-y) iff -n &gt;= y. (eq. 4)<br />
If predicate p(-n) is true for all integers n, then p(n) is also true for all integers n since both n and -n are integers.  So replace -n with n in eq. 4.<br />
For every integer n, n &gt;= -floor(-y) iff n &gt;= y.<br />
For every integer n, n &gt;= ceil(y) iff n &gt;= y. (def&#8217;n of ceil)<br />
Therefore ceil(y) = -floor(-y).</p>
<p>In perl:</p>
<p>sub ceil {<br />
  return ($_[0]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
