Here is a description from Wikipedia on Bulls and cows: "Bulls and Cows (also known as Cows and Bulls or Pigs and Bulls or Bulls and Cleots) is an old code-breaking paper and pencil game for two players, predating the similar commercially marketed board game Mastermind. It is a game with numbers that may date back a century or more. It is played by two opponents. … Continue reading the story "Bulls and Cows"
Monthly Archives for October, 2013
A Delaunay triangulation of a set of points P in a plane is a partition of the convex hull of P into triangles such that the vertices of each triangle are in P and no point in P lies inside the circumcircle of any triangle of the partition. An example is given below. If the set of points P are such that … Continue reading the story "An algorithmic puzzle"
In the image below, all shapes are exactly the same. How will you explain the missing piece in the bottom figure? - via Gpuzzles
A, B and C are playing a shooting game. Each person takes a turn to shoot at one of the others until there's only one standing. A has a probability 1/3 of hitting the mark. B has a probability 2/3 of hitting the mark. C is accurate and will definitely hit the mark. The shooting order is A,B,C,A,B,C,.... indefinitely until only 1 person is left alive. If … Continue reading the story "Who should you shoot first?"
Count the number of integer pairs (x,y) such that 0<=x<=1 billion, 0<=y<=1 billion and 0<=XOR(x,y)<=500 million. XOR(x,y) denotes the bitwise XOR of the bits of x with those of y in binary (base 2) representation. You are free to use a computer. What's an efficient algorithm? - via Topcoder SRM-595
You want to divide 25 students into 5 groups of 5 students each. On each day, you want to reassign students to groups such that no two students are in the same group twice. What is the maximum number of days for which you can group the students under this constraint? - via CSE blog
ABC is an equilateral triangle. D,E,F are mid-points of BC,CA,AB respectively. We connect 9 resistors: one each between BD,DC,CE,EA,AF,FB,DE,EF,FD. Each resistance is 1 Ohm. Find the equivalent resistance between A and B. - via IIT JEE Physics
You have a rectangular n by n chessboard with a square removed. Assume n is a power of 2. You want to tile it with dominoes such that the dominoes do not overlap, and they tile the board completely. Each domino is L-shaped and covers 3 squares. Give an algorithm to tile the chessboard with these dominoes.