<?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>Jon Nalewajek &#187; algorithms</title>
	<atom:link href="http://www.jonnale.org/tag/algorithms/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonnale.org</link>
	<description>Science and Philosophy</description>
	<lastBuildDate>Sat, 04 Sep 2010 20:48:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Why I Love Computer Science (and Algorithms)</title>
		<link>http://www.jonnale.org/2009/03/why-i-love-computer-science-and-algorithms/</link>
		<comments>http://www.jonnale.org/2009/03/why-i-love-computer-science-and-algorithms/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 03:11:07 +0000</pubDate>
		<dc:creator>jonnale</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[algorithms]]></category>

		<guid isPermaLink="false">http://www.jonnale.org/?p=122</guid>
		<description><![CDATA[I really like puzzles. Although I do enjoy board game puzzles, my favorite type of puzzles are ones that require extensive thinking and a clever and elegant solution. This is what really drew me to Computer Science. Applying data structures, algorithms, architecture, etc., and coming up with a high performing, elegant solution to a problem [...]]]></description>
			<content:encoded><![CDATA[<p>I really like puzzles. Although I do enjoy board game puzzles, my favorite type of puzzles are ones that require extensive thinking and a clever and elegant solution. This is what really drew me to Computer Science. Applying data structures, algorithms, architecture, etc., and coming up with a high performing, elegant solution to a problem is challenging and exciting to me. Puzzles are also a reason I really like Philosophy.</p>
<p>On my algorithms midterm exam before Spring break, there was a question that I think represents why I truly enjoy studying Computer Science. Never in my life have I read a question on an exam and said to myself, &#8220;This question is awesome.&#8221; I am going to post a modified version of the question, and strongly encourage anyone to post their solution as a comment. I will post one possible solution on Friday.</p>
<blockquote><p>A firm wants to determine the highest floor on its n-story building from which a device can fall with no impact on the device&#8217;s functionality. The firm has two identical gadgets that you can experiment with (each costs $1,000,000). You are allowed to break both gadgets,  but no extra gadgets will be provided. Design a brute force algorithm in the best efficiency class to solve this problem.</p></blockquote>
<p>This is a very technical question, so in order to simplify it, do not worry about what &#8220;brute force&#8221; or &#8220;efficiency class&#8221; means if you have never taken an algorithms course. These are important concepts for solving this problem in a real life situation, but I do not want these topics to discourage discussion amongst non-CS readers. If you wish to leave a comment, simply write what you would do to solve this problem.</p>
<p>Example solution:</p>
<ol>
<li>Drop gadget on first floor</li>
<li>If it breaks, gadget cannot be dropped from hight=current floor</li>
<li>If it does not break, go to next floor and Repeat.</li>
</ol>
<p>Example in pseudocode:<br />
<code><br />
DidItBreak(n)<br />
//where n is the number of floors<br />
for currentFloor&lt;-1 to n do<br />
&nbsp;&nbsp;if result of device drop = broken<br />
&nbsp;&nbsp;&nbsp;&nbsp;return currentFloor-1<br />
&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;currentFloor &lt;- currentFloor + 1<br />
&nbsp;&nbsp;return -1</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonnale.org/2009/03/why-i-love-computer-science-and-algorithms/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
