Simon
Simon

Reputation: 2733

Finding an algorithm/strategy for a hotel riddle

I have a problem that i'm currenty trying to solve. Let's say we drive a road and we know there are 10 hotels on the way. Each hotel has from 0 to 6 stars. My problem is: find a best solution of choosing the most-starred hotel. The only catch is: you cannot turn back and visit hotels you already decided not to visit. Is there any way of finding a hotel with a "good" ammount of stars?

I realise there is no way of staying in the hotel with the most stars, what I'm looking for is a strategy for getting a "good or best" hotel.

Thanks in advance!

Upvotes: 2

Views: 204

Answers (1)

Falk Hüffner
Falk Hüffner

Reputation: 5040

This is the Secretary problem. Under the assumption that the hotels show up in a random order, the optimal strategy is to drive past 37% of the hotels and then take the next one that is better than all seen so far (or take the last one).

Upvotes: 6

Related Questions