wu :: forums
« wu :: forums - find the exit »

Welcome, Guest. Please Login or Register.
Nov 28th, 2024, 11:54am

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   hard
(Moderators: Grimbal, Eigenray, SMQ, Icarus, towr, william wu, ThudnBlunder)
   find the exit
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: find the exit  (Read 2895 times)
almost dead
Newbie
*





   


Posts: 17
find the exit  
« on: Jun 30th, 2007, 7:40am »
Quote Quote Modify Modify

You have an infinitely long (both sides) wall in front of you. You have to find the door(only one door) in least number of steps.design an algorithm for this.i found this question in a forum.please help
IP Logged
alien2
Uberpuzzler
*****






   


Gender: male
Posts: 6991
Re: find the exit  
« Reply #1 on: Jun 30th, 2007, 10:30am »
Quote Quote Modify Modify

Well, if the door is pretty close to you and it glows in the dark, just walk away from the wall, instead of walking so that your hand always touches the wall.   Undecided  Wink
IP Logged


alien2
Uberpuzzler
*****






   


Gender: male
Posts: 6991
Re: find the exit  
« Reply #2 on: Jun 30th, 2007, 10:31am »
Quote Quote Modify Modify

Oh and my suggestion is even better if you have binoculars or telescope.  Tongue
IP Logged


alien2
Uberpuzzler
*****






   


Gender: male
Posts: 6991
Re: find the exit  
« Reply #3 on: Jun 30th, 2007, 2:06pm »
Quote Quote Modify Modify

Or walk on your hands.  Roll Eyes
IP Logged


alien2
Uberpuzzler
*****






   


Gender: male
Posts: 6991
Re: find the exit  
« Reply #4 on: Jun 30th, 2007, 2:07pm »
Quote Quote Modify Modify

Or drive in the car.  Shocked
IP Logged


Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7527
Re: find the exit  
« Reply #5 on: Jul 2nd, 2007, 12:44am »
Quote Quote Modify Modify

It helps if you are in fact at the dead end of an infinitely long corridor.
 
Anyway, I think you cannot determine an optimal algorithm unless you know the probability distribution of the position of the door.
IP Logged
Hippo
Uberpuzzler
*****





   


Gender: male
Posts: 919
Re: find the exit  
« Reply #6 on: Jul 4th, 2007, 1:19am »
Quote Quote Modify Modify

This is an example of on-line algorithms ... you cannot optimize complexity of your algorithm, but you can optimize the worst possible ratio of your algorithm and the optimal algorithm.
 
In this example you can obtain algorithm with complexity small constant + K times optimal algorithm. What is the best K, what is the algorithm?
 
(complexity is length of your path in this case)
IP Logged
alien2
Uberpuzzler
*****






   


Gender: male
Posts: 6991
Re: find the exit  
« Reply #7 on: Jul 9th, 2007, 2:41pm »
Quote Quote Modify Modify

If exit has a neon sign then the exit finds you. Shut me up..  Embarassed
IP Logged


Hippo
Uberpuzzler
*****





   


Gender: male
Posts: 919
Re: find the exit  
« Reply #8 on: Jul 11th, 2007, 7:54am »
Quote Quote Modify Modify

OK, My algorithm would be to mark 0 on the wall and go to position (-q)i on i-th walk. Optimization of q gives the best result for q being the golden ratio (1+sqrt(5))/2. The ratio of the path len to the optimal len (absolute value of the exit coordinate) is less than (q+1)q2/(q-1)<11.1.
 
(The unit should be choosen such that it is small enough not to stop during first two iterations ... 1 corresponds to "exit visibility").
« Last Edit: Jul 11th, 2007, 7:59am by Hippo » IP Logged
Hippo
Uberpuzzler
*****





   


Gender: male
Posts: 919
Re: find the exit  
« Reply #9 on: Jul 12th, 2007, 1:44am »
Quote Quote Modify Modify

The previous algorithm was not optimised well.
the worst ratio is less than (2q2+q-1)/(q-1). In that case better q would be 1+sqrt(3/2) with ratio < 9.09.
 
Oops ... actualy the minimum is for q=2 ... ratio = 9. So again natural geometric series are 2^n and golden ratio ^n.
 
(the traveled len for the worst case is 2q+2q2+2q3+...+2qd+1+qd + eps where the best len is qd+eps, in the previous post I have considered full last term qd+2)
« Last Edit: Jul 12th, 2007, 7:54am by Hippo » IP Logged
srn437
Newbie
*



the dark lord rises again....

   


Posts: 1
Re: find the exit  
« Reply #10 on: Aug 28th, 2007, 12:05pm »
Quote Quote Modify Modify

Algorithms cannot be infinite. The question is nonsensical.
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: find the exit  
« Reply #11 on: Aug 28th, 2007, 12:27pm »
Quote Quote Modify Modify

on Aug 28th, 2007, 12:05pm, srn347 wrote:
Algorithms cannot be infinite. The question is nonsensical.
An algorithm can, theoretically, be infinite, but the question doesn't ask for an infinite algorithm.
 
Also, considering how many people made sense of the puzzle, it is rather presumptuous to claim it is nonsensical. If you don't understand it, just say it.
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
srn437
Newbie
*



the dark lord rises again....

   


Posts: 1
Re: find the exit  
« Reply #12 on: Aug 28th, 2007, 12:56pm »
Quote Quote Modify Modify

Wikipedia mensions in the definition of algorithm that it is finite and terminates.
IP Logged
pex
Uberpuzzler
*****





   


Gender: male
Posts: 880
Re: find the exit  
« Reply #13 on: Aug 28th, 2007, 1:00pm »
Quote Quote Modify Modify

on Aug 28th, 2007, 12:56pm, srn347 wrote:
Wikipedia mensions in the definition of algorithm that it is finite and terminates.

Quoting from Wikipedia:
Quote:
Some writers restrict the definition of algorithm to procedures that eventually finish. (...) Others, including Kleene, include procedures that could run forever without stopping
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: find the exit  
« Reply #14 on: Aug 28th, 2007, 1:12pm »
Quote Quote Modify Modify

on Aug 28th, 2007, 12:56pm, srn347 wrote:
Wikipedia mensions in the definition of algorithm that it is finite and terminates.
Really? Then wikipedia would be wrong; there is no reason an algorithm needs to terminate; and it can extend itself to grow infinitely in size (and theoretically you can defy it infinitely from the start).
 
Here's an algorithm that doesn't terminate:
#include <unistd.h>
int main()
{
while (true)
   fork();
}
« Last Edit: Aug 28th, 2007, 1:14pm by towr » IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
srn437
Newbie
*



the dark lord rises again....

   


Posts: 1
Re: find the exit  
« Reply #15 on: Aug 28th, 2007, 8:36pm »
Quote Quote Modify Modify

If it is infinite you don't have any use for it.
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: find the exit  
« Reply #16 on: Aug 29th, 2007, 1:02am »
Quote Quote Modify Modify

on Aug 28th, 2007, 8:36pm, srn347 wrote:
If it is infinite you don't have any use for it.
You OS should in principle be able to run without termination. Is it useless? If it is, you may have installed windows. *zing*
 
If you're going to question everything people say, you might consider also questioning what you say yourself.
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
Sameer
Uberpuzzler
*****



Pie = pi * e

   


Gender: male
Posts: 1261
Re: find the exit  
« Reply #17 on: Aug 29th, 2007, 7:43pm »
Quote Quote Modify Modify

on Aug 28th, 2007, 8:36pm, srn347 wrote:
If it is infinite you don't have any use for it.

 
So is the algorithm for finding primes useless?
IP Logged

"Obvious" is the most dangerous word in mathematics.
--Bell, Eric Temple

Proof is an idol before which the mathematician tortures himself.
Sir Arthur Eddington, quoted in Bridges to Infinity
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board