Puzzle puzzle every where

Past few weeks have been puzzle/problem solving weeks, which includes 4 google treasure hunt problems. (Robot in a Maze, Puzzle 2 (getting lines from specific files in zip archive), Network routing table and last one:Prime numbers ). Solving these was fun.
puzzle
Two days back my friend shared this (Galton’s Paradox) on Google reader (My Google reader shared Items). Try explaining it :) not that difficult though.

In search of a new car, the player picks door 1. The game host then opens door 3 to reveal a goat and offers to let the player pick door 2 instead of door 1.

But what drew my attention again? Yesterday I was watching 21 movie, Its based on real story of six MIT students cashed in millions in Vegas Casinos by counting cards. Here comes the puzzle, In a classroom scene Prof Micky asks one of the student (Jim, our hero)

Suppose you’re on a game show, and you’re given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what’s behind the doors, opens another door, say No. 3, which has a goat. He then says to you, “Do you want to pick door No. 2?” Is it to your advantage to switch your choice?

I’m sure you will be left puzzled for a moment, when you hear the solution by Jim, at least I was. Its a tricky one, But you can get through it ;) . So what choice would you have made, I’ll update the post with answer after few days.

Update:

This is famous puzzle known as Monty Hall Problem. Wikipedia has very good explanation for this.

Because there is no way for the player to know which of the two unopened doors is the winning door, most people assume that each door has an equal probability and conclude that switching does not matter. In fact, in the usual interpretation of the problem the player should switch—doing so doubles the probability of winning the car, from 1/3 to 2/3.

Also Read: Classic Computer Science Puzzles

Related Post:

Orio’s Riddle Completed
Twisty Puzzles

Google treasure hunt: last puzzle

Few days back google announced about last leg of google treasure hunt journey. This time they provided unix epoch time 1212448500, time when puzzle was supposed to get released.
You can use http://www.epochconverter.com/ to convert it to human readable format. This side also provides list of available methods to get epoch time, convert it to human readable format and vice-versa.

PHP date(output format, epoch); Output format example: ‘r’ = RFC 2822 date
Python import time first, then time.gmtime(epoch)
MySQL from_unixtime(epoch, optional output format)

So the puzzle was supposed to release at
Mon, 02 Jun 2008 23:15:00 GMT, for India: Tuesday, June 03, 2008 4:45:00 AM (middle of the night).

Forth Puzzle is available here. Its a bit tricky, but i wrote a c program to calculate the number using brute force method…and it worked.(Share how you did it or is there some shortcut which works without any programming). Problem is to find a prime number which in turn can be expressed as sum of of n consecutive prime numbers. Your answer should satisfy 4 such list of prime numbers of given length.

So its over for now and soon they are going to contest winners and rewards. Hope i could have been one :) . But I have submitted this puzzle after long delay.(Was sleeping when it was released)

Google Treasure Hunt puzzle 3

Two days back google posted that they will be posting 3 puzzle for google treasure hunt soon.

This week’s puzzle is set to be released on Tuesday, May 27 at 10 a.m. PDT.

PDT is 7 hours behind UTC, so its around 10 PM, 27th May in India.
So the 3rd puzzle is live now. I have given it a try and submitted my answer, I think (!) it should be correct.
This time question is related to networking. You have to find the path followed by a packet given its destination and routing table for the network.

The nodes are hosts on the network, and the lines between them are links. A packet is sent out from host O with a destination of 46.44.187.63. Which nodes does the packet pass through on its way to the destination?

To refresh your concepts read (Routing tables, On wikipedia). If you got the idea, then it shouldn’t be difficult. Intuitively also you should be able to find your way through routing table. Give It a try..and but you will only get to know your answer status after 23hrs from now.
Previous Puzzles:

Google treasure hunt (Second puzzle)

Its about time (936266827 seconds before Y2K38) i.e 19may2008 17:07:58 (UTC) and the second puzzle is live (Check it out). You can still try the first question here. Second puzzle from google treasure hunt is to calculate

Sum of line n for all files with path or name containing pattern and ending in particular extension. Similarly Sum of line m for all files with some pattern.
Hint: If the requested line does not exist, do not increment the sum.
Multiply all the above sums together and enter the product below.

for a given set of files contained in a zip archive. I have already submitted my answer :) , but this time I will have to wait for 24hrs to check the status of my answer :( . I thinks its a good puzzle to test your quick shell script abilities. (Can also be done easily in perl/python).

For the solution part, I wont give the actual solution (As dont want it to spoil for others who are actually trying) but you can use shell commands [grep, find ,sed and pipe (|)] to get to solution. You can get all the required numbers in 2 lines on shell.

Related Post:
Google Treasure Hunt
Orio’s Riddle Completed
Twisty Puzzles

Google treaure hunt

The Google Engineering team is launching its first ever Treasure Hunt, a contest designed to challenge your problem-solving skills.

Find more details at Google Australia blog here
They will be releasing first four puzzles in the next consecutive four weeks, one is alread released.
To get the URL of the contest you have to decode:

aHR0cDovL3RyZWFzdXJlaHVudC5hcHBzcG90LmNvbS8=

And yeah, :) I was able to that do that. I’ll tell you the answer its http://treasurehunt.appspot.com/, as its already on Google Blog
Actually its the base64 decode of the given code.

You can find the first puzzle here.

A robot is located at the top-left corner of a 34 x 49 grid.
The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid. How many possible unique paths are there?

I have solved this one. Give it a try, its not that difficult. Any way I’m there to help :)
Here is the solution to the problem :
The number of paths for n x m grid (n-1 down blocks and m-1 right blocks) is equal to number of ways of arranging n-1 D’s (Down move) and m-1 R’s (Right move). So it’s

(n-1+m-1)! / ((n-1)! * (m-1)!)

You can calculate it using calculator in Windows/Linux.
I’m waiting for the next to come.

The second puzzle will be appearing soon — to be exact, 936266827 seconds before Y2K38,

Update:

Unix internal time is commonly stored in a data structure using a long int containing the number of seconds since 1970. This time is used in all time-related processes such as scheduling, file timestamps, etc. In a 32-bit machine, this value is sufficient to store time up to 18-jan-2038. After this date, 32-bit clocks will overflow and return erroneous values such as 32-dec-1969 or 13-dec-1901. Read More about Y2K38.

According to wikipedia The latest time that can be represented in this format, following the POSIX standard, is 03:14:07 UTC on Tuesday, January 19, 2038. So when you calculate specified 936266827 seconds before that next puzzle should come around 19may2008 17:07:58 (The puzzle is alread there)(UTC) .

I have removed exact timing for you to get it on your own.(or is it still there ..haha ). And still if you need it, you can request in comments.
I calculated it using stata. You can easily calculate this in two lines in python:

>>> import time
>>> print time.ctime(2**31 – 1 – 936266827)

Related Post:
Orio’s Riddle Completed
Twisty Puzzles

Rubiks Cube with flashy lights and voice

from Engadget

New “Rubik’s Revolution,” a supposed “sequel” to the original Rubik’s Cube. The new cube keeps that 3 x 3 configuration and the iconic colored sides, but adds in electronic games including Light Speed, Rapid Recharge, Pattern Panic, Cube Catcher, Code Cracker and Multiplayer Madness.

Read More>>

Related Posts:

Twisty Puzzles

I’m a fan of Rubik’s Cube…though i’m not very fast but i can solve it in around 90 sec or so..
i stumbledupon this page having collection(pics) of wide variety of derivatives of rubik cube and similar puzzles.Then i searched for more such links..and i found this Huge Rubik’s Cube Collection.

Visit:
Magic Polyhedra and Other Sequential Movement Puzzles,
Knuttz.net: Rubik’s Cube Collection

Related Links:
Solving Rubiks Cube
Timer Designed By me