<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN"
"http://p.moreover.com/xml_dtds/rss-0_91.dtd">
<rss version="0.91">

<channel>
<title>TechInterview</title> 
<link>http://www.techinterview.org</link> 
<description>Puzzles and more</description> 
<language>en-us</language> 
<copyright>Copyright 2001 Michael Pryor.</copyright>
<managingEditor>mhp@fogcreek.com</managingEditor> 
<webMaster>webmaster@fogcreek.com</webMaster> 




<item>
<link>http://www.techinterview.org/../Puzzles/twoswitches.html</link>
<description>
<![CDATA[
This one was recently given on Car Talk, and it's been making the rounds right now also... 
<BLOCKQUOTE>
<P>The warden meets with 23 new prisoners when they arrive. He tells them, "You may meet today and plan a strategy. But after today, you will be in isolated cells and will have no communication with one another. 
<P>"In the prison is a switch room, which contains two light switches labeled A and B, each of which can be in either the 'on' or the 'off' position. I am not telling you their present positions. The switches are not connected to anything. 
<P>"After today, from time to time whenever I feel so inclined, I will select one prisoner at random and escort him to the switch room. This prisoner will select one of the two switches and reverse its position. He must move one, but only one of the switches. He can't move both but he can't move none either. Then he'll be led back to his cell. 
<P>"No one else will enter the switch room until I lead the next prisoner there, and he'll be instructed to do the same thing. I'm going to choose prisoners at random. I may choose the same guy three times in a row, or I may jump around and come back. 
<P>"But, given enough time, everyone will eventually visit the switch room as many times as everyone else. At any time anyone of you may declare to me, 'We have all visited the switch room.' and be 100% sure. 
<P>"If it is true, then you will all be set free. If it is false, and somebody has not yet visited the switch room, you will be fed to the alligators." </P>
<P>What is the strategy they come up with so that they can be free?</P></BLOCKQUOTE>
]]>
</description>
</item>



<item>
<link>http://www.techinterview.org/../Puzzles/carsontheroad.html</link>
<description>
<![CDATA[
<P>if the probability of observing a car in 20 minutes on a highway is 609/625, what is the probability of observing a car in 5 minutes (assuming constant default probability)?</P>
<P>thanks to joel w. for this one</P>
]]>
</description>
</item>



<item>
<link>http://www.techinterview.org/../Puzzles/railroadbridge.html</link>
<description>
<![CDATA[
<P>i&nbsp;got some new brain teasers and more classic programming puzzles for everyone!</P>
<P>a man needs to go through a train tunnel.&nbsp; he starts through the tunnel and when he gets 1/4 the way through the tunnel, he hears the train whistle behind him. you don't know how far away the train is, or how fast it is going, (or how fast he is going).&nbsp; all you know is that </P>
<OL>
<LI>if the man turns around and runs back the way he came, he will just barely make it out of the tunnel alive before the train hits&nbsp;him. 
<LI>if the man keeps running through the tunnel, he will also just barely make it out of the tunnel alive before the train hits him.</LI></OL>
<P>assume the man runs the same speed whether he goes back to the start or continues on through&nbsp;the tunnel.&nbsp; also assume that he accelerates to his top speed instantaneously.&nbsp; assume the train misses him by an infintisimal amount and all those other reasonable assumptions that go along with puzzles like this so that some wanker doesn't say the problem isn't well defined.</P>
<P>how fast is the train going compared to the man?</P>
]]>
</description>
</item>



<item>
<link>http://www.techinterview.org/../Puzzles/chameleons.html</link>
<description>
<![CDATA[
"at one point, a remote island's population of chameleons was divided as follows: 
<UL>
<LI><B>13</B> red chameleons 
<LI><B>15</B> green chameleons 
<LI><B>17</B> blue chameleons </LI></UL>
<P>each time two different colored chameleons would meet, they would change their color to the third one. (<I>i.e.. If green meets red, they both change their color to blue.</I>) is it ever possible for all chameleons to become the same color? why or why not?"</P>
<P><small>another one from levik</small></P>
]]>
</description>
</item>



<item>
<link>http://www.techinterview.org/../Puzzles/crazyguyontheairplane.html</link>
<description>
<![CDATA[
<P>"a&nbsp;line of 100 airline passengers is waiting to board a plane. they each hold a ticket to one of the 100 seats on that flight. (for convenience, let's say that the nth passenger in line has a ticket for the seat number n.) </P>
<P>unfortunately, the first person in line is crazy, and will ignore the seat number on their ticket, picking a random seat to occupy. all of the other passengers are quite normal, and will go to their proper seat unless it is already occupied. if it is occupied, they will then find a free seat to sit in, at random. 
<P>what is the probability that the last (100th) person to board the plane will sit in their proper seat (#100)?"</P>
<P><SMALL>thanks to levik for the latest puzzle</SMALL></P>
]]>
</description>
</item>



</channel>
</rss>

