Saturday, July 09, 2005

 

Problem# 14

This one is for the programmers!

You are given an array of integers of size=1001. Each element has exactly one duplicate (that's, every number occurs exactly twice), except one. Find the odd number out, making only one pass through all the 1001 elements of the array and without corrupting the contents of the array. You can use atmost two variables to store temporary evaluations.

 

Problem# 13

This one is adapted from one in the "Puzzles" community of the Orkut (http://www.orkut.com).

You are given a balance that can be used to compare the weight of two objects.

(a) You have a pack of 8 identical balls, 7 of gold and one of iron. It's impossible to identify the iron ball just looking at the balls. You are asked to find out the odd ball using the balance. In how many (minimum) turns can you do it? You may use the fact the iron ball is heavier than the gold ball.

(b) You are given a different pack of 8 balls, 7 of gold and one of unknown material. Using three weighings only, how can you find out the odd ball? Given that, all the balls are visually identical.

Friday, July 08, 2005

 
Problems yet to be solved correctly, so far:
3 5 9 10 11

This page is powered by Blogger. Isn't yours?