Friday, October 29, 2010

Magic Number - One puzzle a day - Puzzle Buddies

Puzzle: 
1. A number has n digits where n is greater than 1.
2. When multiplied by 1 through 6 the result contains the same digits arranged in different order.
3. When multiplied by 7 the result contains a single digit but n times.


What is the magic number?


Answer:
142857 is the correct answer!


142857 x 2 = 285714
142857 x 3 = 428571
142857 x 4 = 571428
142857 x 5 = 714285
142857 x 6 = 857142
142857 x 7 = 999999 


Winner:
Gaurave Sehgal

Thursday, October 28, 2010

Eight Eights puzzle - One puzzle a day - Puzzle Buddies

Puzzle:Using 8 exactly eight times make a 1000.

You can use any mathematical symbols

Note: Don't forget to visit us again. Answer to the puzzle will be posted tomorrow.
Solution:
888+88+8+8+8 = 1000
Winner: Vinay

Wednesday, October 27, 2010

Winner Winner Chicken Dinner - One puzzle a day - Puzzle Buddies

Puzzle: Your friend suggests a betting game. The rules are:

  1. Each person has to call a number after each another until someone calls 50. 
  2. Person who calls 50 wins.
  3. The player who starts has to call a number between 1 and 10 (inclusive).
  4. The new number must be at least 1 greater than the previous number. 
  5. It should not be more than 10 to the previous number.

You have bet 100 dollars on this game. You got the first turn. Which number would you call and why?

Note: Don't forget to visit us again. Answer to the puzzle will be posted tomorrow.
Solution:
This is a good example of backtracking algorithms
Winner says 50.
Looser has to say a number between: 40-49
Winner says 39
Looser has to say a number between: 29-38
Winner says 28
Looser has to say a number between 18-27
Winner says 17
Looser has to say a number between 7 and 16
Winner has to say 6 to start this.
So the answer is 6.
Winner: Kasturi is the Winner

Tuesday, October 26, 2010

The Burning Rope - One puzzle a day - Puzzle Buddies

Puzzle:There are two lengths of rope.Each one can burn in exactly one hour.They are not necessarily of the same length or width as each other.They also are not of uniform width (may be wider in middle than on the end), thus burning half of the rope is not necessarily 1/2 hour.
By burning the ropes, how do you measure exactly 45 minutes worth of time?

Note: Don't forget to visit us again. Answer to the puzzle will be posted tomorrow.
Solution:

If you light both ends of one rope, it will burn in exactly a 1/2 hour. Thus, burn one rope from both ends and the other rope from only one end. Once the one rope (which is burning from both ends) finally burns out (and you know a 1/2 hour has elapsed), you also know that the other rope (which is buring from only one end) has exactly 1/2 hour left to burn. Since you only want 45 minutes, light the second end of the rope. This remaining piece will burn in 15 minutes. Thus, totaling 45 minutes.
Winner: Gaurave Sehgal

Monday, October 25, 2010

Two Primes - One puzzle a day - Puzzle Buddies

Puzzle: Two prime numbers p1 and p2 differ by 11111. What are their sum and product?

Solution: Since p1 and p2 differ by an odd number, one of them must be even. Since 2 is the only even prime number,
p1 = 2 and p2 = 11113
Sum = 11115
Product = 22226




Thursday, October 21, 2010

Division - One puzzle a day - Puzzle Buddies

Puzzle:Find the number of factors of 264,600 that are not divisible by 6.
Note: Don't forget to visit us again. Answer to the puzzle will be posted tomorrow.
Solution:
264,600 = 2^3*3^3*5^2*7^2 (broken into prime numbers)
There are 4 powers of 2: 2^0,2^1,2^2 and 2^3
There are 4 powers of 3: 3^0,3^1,3^2 and 3^3
There are 3 powers of 5: 5^0,5^1, and 5^2
There are 3 powers of 7: 7^0,7^1, and 7^2
There are 4*4*3*3=144 different ways to combine the prime factors of 264,600.

Now, eliminate the factors of 6. A factor of 6 must have at least one 2 and one 3.
So it must either have either 2^1,2^2, or 2^3 AND 3^1,3^2, or 3^3. So, there are 3*3=9 different ways the powers of 2 and 3 can combine to generate distinct numbers divisible by 6.

Also, there are 3*3 = 9 different numbers that can be created from the powers of 5 and 7. Any of these 9 numbers can combine with any of of the 9 multiples of 6 to form 9*9 = 81 distinct multiples of 6.

Hence, the number of factors of 264,600 that are no divisible by 6 is 144-81 = 63.
Winner:
Noone

Wednesday, October 20, 2010

100 Lockers - One puzzle a day - Puzzle Buddies

Puzzle: You are in a locker room with 100 lockers in  a row. You have keys to all the lockers. All the lockers are initially closed. You make 100 passes, you toggle ( if the door is closed you open it, if its open you close it) all the locker doors in the first pass, second time you only visit every second door and toggle it, third time you only visit every third door and toggle it and so on.

How many doors will be open after 100th pass.

Solution: There are three ways to solve this puzzle
1. Brute force
 Keep running it for all 100 passes and then count. The solution will be correct but not elegant.
2. If you try to run brute force for first few you can infer that

  • 1st locker will be toggled 1 time
  • 2nd locker will be toggled 2 times
  • 3rd locker will be toggled 2 times
  • and so on ........

This shows us that each locker will be toggled by its own factors only.
The locker can be in open state if the factors are odd.
Now we can count factors of each number from 1 to 100 and which ever are odd will result in open lockers
3. The easiest way is that only perfect squares can have odd factors. So all perfect squares can be counted and that is the answer.

So the answer is 10 and locker numbers are 1,4,9,16,25,36,49,64,81,100.

Winner: Today's winner is Kasturi