Showing posts with label optimization. Show all posts
Showing posts with label optimization. Show all posts

Wednesday, May 21, 2008

The Return of The Da Vinci Puzzle

Oh well, I was not inclined to publish the solution. However, as Spielberg said to Harrison Ford, or as Sly Stallone thought to himself, never say never.

The Original Da Vinci Puzzle is here:
http://randomjunkyramblings.blogspot.com/2008/03/da-vinci-puzzle-with-apologies-to.html
Sure beats calling it The Vulcan Mind Meld, doesn't it? Beats Einstein's Puzzle hands down? I suspect you will find clues in the puzzle once you see the solution.

Anyhow, I got some awesome, and some crazy, solutions. Below are two approaches I thought of. In the first one, we take liberties with the puzzle/ twist the puzzle rules a bit. In the second one, we incorporate optimization ideas to fit the rules of the game.

Approach 1:
1> Cut the sets of balls, so that each set of balls has a prime number numerator in a ratio that makes up its weight.

2> Identify the duplicate set of balls on weighing the balls once by using properties of prime numbers.

Approach 2:
1> There is no unique solution.

2> Avoid using the scale. Solve this on paper or write a program.

3> You would like to minimize the error in the solution. The error here is the possibilities of jars holding the duplicate set of balls. E.g. You could come up with a solution where you weigh set 1,2,3,4,5 and the weight indicates that the duplicate set could be 1,2 or 5,6. You could also come up with a set 3,4,5,6,7 where the duplicate set could be 3,4 or 5,6 or 8,9. You minimize error with the first solution, i.e. the first solution would be *more* correct.

4> As pointed out by a Mensan, you have to try out all the possibilities before you can identify the optimal solution set. Yep, welcome to the weary world of The Traveling Salesman. This is literally a "hard" problem.
Pick any solution string from the optimal set as your solution. At this point, if you haven't lost your cool already, you are welcome to also weigh this solution string on the scale. Once.

5> The same bright Mensan suggested a book for this kind of funky thinking:
Numerical Recipes in C: The Art of Scientific Computing
http://www.amazon.com/Numerical-Recipes-C-Scientific-Computing/dp/0521431085/ref=sr_1_4?ie=UTF8&s=books&qid=1211417740&sr=1-4
I don't have my copy of this book anymore. Its been a while since I was in engineering, however, I might borrow it if you have a copy.

6> Don't shoot me, I'm just the messenger for the crazy ideas running about in my attic. :-D

So, what do you think?

Tuesday, March 18, 2008

The Da Vinci Puzzle: With apologies to Leonardo Da Vinci and Dan Brown

Ladies and Gentlemen,

Admit it! You loved the book! Now, fasten your seatbelts! The Da Vinci Puzzle is here!

Before we dive into the puzzle, I'll confess:
1> I am not a fan of puzzles.
2> I am more a physics guy than a math guy.

Without going into the gory details, I find that puzzle solving is usually about picking a solution that fits. The one with the most puzzle solutions in the bag, and the optimal algorithm to access those solutions, is usually the first one to crack the problem.

However, being around bright folks interested in puzzles got me going, although only for a brief period of time. Consequently, here's my stab at constructing a puzzle.

The original puzzle is as follows:
I have ten bottles, and there are ten balls in each bottle.
Nine of the ten bottles have balls that all weigh the same.
One of the ten bottles has balls that each weigh 20% more than each of the balls in the other nine bottles.
You have a scale, which is very accurate, but you can only use it ONE TIME (you have to weigh the balls all at once, not one at a time).
How can you tell which bottle is the one that has balls that are 20% more in weight?

Now, when you figure this out, here's the next construct. I call it The Da Vinci Puzzle (pun alert!):
Extending the puzzle above (that may be your clue), what if there are 2 bottles with balls that are each heavier by 20%?
Can you tell which two bottles weigh more?
How?

I believe there is a feasible solution.
I also know a bright guy who believes there isn't.
What do you think?

I buy a beer to the first few who take a stand on the feasibility of the puzzle and can prove it.

Also, I will not be publishing the solution- the assumption is that word-of-mouth will carry the puzzle and its solution to the seekers/ faithful/ die hard/ hardcore/ whatever the latest buzzword is.
To add to its word-of-mouth appeal, and without giving away the answer to the puzzle, I will add that you can answer the Da Vinci Puzzle in one word. Could that one word either be "feasible" or be "infeasible"? You tell me.

P.S. Why is this post so long? Its got heavily veiled red herrings and clues to distract you from solving the Da Vinci Puzzle.

P.P.S. Why am I calling this the Da Vinci Puzzle? What's the pun? Have you heard of Einstein's Puzzle?

P.P.P.S. The balls could well be nanoparticles. Also, Son of Da Vinci Puzzle Coming Soon!! Thank you, Robyn, for the questions!