Você está na página 1de 22

# Gurmeet.

## Net Delightful Puzzles Tw eet 136 129

Delightful Puzzles
1. Chameleons On an island live 13 purple, 15 yellow and 39. Working Computer A room has n computers, less
17 maroon chameleons. When two chameleons of different than half of which are damaged, others are good. It is possible
colors meet, they both change into the third color. Is there a to query a computer about the status of any computer. A
sequence of pairwise meetings after which all chameleons damaged computer could give wrong answers. The goal is to
have the same color? discover a good computer in as few queries as possible.

2. Pebble Piles You are given three piles with 5, 49 and 40. Tiling With Calissons A large regular hexagon is cut
51 pebbles respectively. Two operations are allowed: (a) out of a triangular grid and
merge two piles together or (b) divide a pile with an even tiled with diamonds (pairs of
number of pebbles into two equal piles. Is there a sequence of triangles glued together
operations that would result in 105 piles with one pebble along an edge). Diamonds
each? come in three varieties,
depending on orientation;
prove that precisely the same number of each variety must
3. Rope Escape Rajeev is trapped atop a building 200m appear in the tiling.
high. He has with him a rope 150m long. There is a hook at
the top where he stands. Looking down, he notices that
midway between him and the ground, at a height of 100m, 41. Loop in a Linked List Given the head of a linked list,
there is a ledge with another hook. In his pocket lies a Swiss find if it contains a loop or not, in linear time. Can you
knife. Hmm... how might he be able to come down using the accomplish it with only O(1) extra space? Can you do it
rope, the two hooks and the Swiss knife? without modifying the list in any way?

4. Cake Cutting Mary baked a rectangular cake. Merlin 42. Perplexing Polynomial Alice is allowed to choose an
secretly carved out a small rectangular piece, ate it and arbitrary polynomial p(x) of any degree with nonnegative
vanished! The remaining cake has to be split evenly between integer coefficients. Bob can infer the coefficients of p(x) by
Mary's two kids. How could this be done with only one cut only two evaluations as follows. He chooses a real number a
through the cake? and Alice communicates p(a) to him. He then chooses a real
number b and Alice communicates p(b) to him. What values of
a and b helped Bob succeed and how?
5. Fox in a Hole Consider five holes in a line. One of them
is occupied by a fox. Each night, the fox moves to a
neighboring hole, either to the left or to the right. Each 43. Poisoned Wine Barrels An enemy spy has poisoned
morning, you get to inspect a hole of your choice. What one out of 1000 barrels of wine in a king's cellar. Even a sip of
strategy would ensure that the fox is eventually caught? the poisoned wine has potency to kill. However, the effects of
the poison show only in 30 days. The king asks the royal jailor
to identify the poisoned barrel within 30 days. What is the
6. Cube Cutting Imagine a 3x3x3 wooden cube. How least number of prisoners the jailor must employ to identify the
many cuts do we need to break it into twenty-seven 1x1x1 poisoned barrel?
cubes? A cut may go through multiple wooden pieces.

## 44. Two Eggs and a Building With two eggs and a

7. Ant Collisions Peter and Cynthia stand at each end of a building with 100 floors, what is the optimal strategy for finding
straight line segment. Peter sends 50 ants towards Cynthia, the lowest floor at which an egg will break when dropped?
one after another. Cynthia sends 20 ants towards Peter. All Followup: What if the number of floors of the building is
ants travel along the straight line segment. Whenever two ants unknown?
collide, they simply bounce back and start traveling in the
opposite direction. How many ants reach Peter and how many
reach Cynthia? How many ant collisions take place? 45. Number Guessing Game Shankar chooses a number
between 1 and 10,000. Geeta has to guess the chosen
number as quickly as possible. Shankar will let Geeta know
8. Ant in a Room An ant crawls from one corner of a room whether her guess is smaller than, larger than or equal to the
to the diametrically opposite corner along the shortest number. The caveat is that Geeta loses the game if her guess
possible path. If the dimensions of the room are 3 x 4 x 5, is larger than Shankar's chosen number two or more times.
what distance does the ant cover? (A) How many guesses are necessary? (B) What if Shankar is
allowed to pick an arbitrarily large positive number?
9. Cube Problems Imagine a cube on a flat table,
tantalizingly balanced on one of its vertices such that the 46. Cutting a Cake with Icing One day, grandma baked a
vertex most distant from it is vertically above it. (a) What is the cake with a square top and dimensions 30cm x 30cm x 10cm.
length of the shortest path an ant could take to go from the What is a simple strategy for cutting the cake into 9 equal
topmost vertex to the bottommost vertex? (b) What will be the pieces? The next day, grandma baked another cake with the
projection on the table if there is a light source right above the same dimensions. This time, she put a thin layer of icing on
cube? (c) What would be the cross-section obtained if we top and on all four sides but not on the bottom. What is a
slice the cube along a plane parallel to the table, passing simple strategy for cutting such a cake into 9 pieces such
through the midpoint of the topmost and the bottommost
points of the cube? (d) Split a large 333 cube into 27 small that all pieces have the same amount of cake by volume and
111 cubes. An ant can burrow through one small cube to the same amount of icing by surface area?
an adjacent small cube if these two cubes share a face. Can
the ant burrow through all of the 27 small cubes, visiting each
small cube exactly once? Can such a sequence have the 47. Number Guessing Game II Shankar chooses a
additional property that the first and the last small cube share number uniformly at random between 1 and 1000. Geeta has
a face? to guess the chosen number as quickly as possible. Shankar
will let Geeta know whether her guess is smaller than, larger
than or equal to the number. If Geeta's guess is larger than
10. Truchet Tilings An 8x8 square grid has to be covered the number, Shankar replaces the number with another
with isosceles triangular tiles with two tiles per square. Tiles number chosen uniformly at random [1, 1000]. What should
come in two colors: black and white. Such tilings are called Geeta's strategy be?
Truchet tilings. A tiling is said to be "fine" if no two tiles
sharing an edge have the same color. How many "fine"
Truchet tilings are there? 48. Cube Cutting with Stacking How many cuts are
necessary to cut an n x n x n cube into 1 x 1 x 1 cubes?
Existing cuboids may be stacked together for cutting. So one
11. Treasure Island An old parchment has directions to a cut may go through multiple existing cuboids.
treasure chest buried in an island:

There is an unmarked grave and two tall oak trees. 49. What's the Number on My Hat? A goblin forewarns N
Walk from the grave to the left tree, counting the gnomes as follows: "Tomorrow morning, I shall place one hat
number of steps. Upon reaching the left tree, turn on each of you. Each hat shall be labeled with some number
left by 90 degrees and walk the same number of drawn from the range [0, N-1]. Duplicates are allowed, so two
steps. Mark the point with a flag. Return to the different hats might have the same label. Any gnome shall be
grave. Now, walk towards the right tree, counting able to see numbers on other hats but not his own! When a
the number of steps. Upon reaching the right tree, bell rings, all gnomes shall simultaneously announce one
turn right by 90 degrees and walk the same number number each. If any gnome succeeds in announcing the
of steps. Mark this point with another flag. The number on his own hat, all gnomes shall be set free." The
treasure lies at the midpoint of the two flags. gnomes have assembled in the evening to discuss their
predicament. Can you help them devise a strategy?
A party of sailors reached the island. They find a pair of tall
oak trees merrily swaying in the wind. However, the unmarked
grave is nowhere to be found. They are planning to dig up the 50. Tiling a Chessboard with Dominoes (A) An 8x8
entire island. It'll take a month. Can they do any better? chessboard has had two of its diagonally opposite squares
removed, leaving it with sixty-two squares. Can we tile it with
31 non-overlapping 2x1 rectangles (dominoes) such that all
12. Six Colored Balls We have two red, two green and
squares are covered? (B) Under what circumstances would
two yellow balls. For each color, one ball is heavy and the
other is light. All heavy balls weigh the same. All light balls removal of two squares from an 8x8
weigh the same. How many weighings on a beam balance are chessboard allow such a tiling? For
necessary to identify the three heavy balls? example, if we remove an arbitrary white
square and an arbitrary black square, can
the remaining board be tiled?
13. Josephus Problem There are n persons in a circle,
numbered 1 thru n. Going around the circle, every second
person is removed from the circle, starting with person number
2, 4, and so on. Show that the number of the last person 51. Tiling a Chessboard with Trominoes Show that a
remaining in the circle can be obtained by writing n in binary, chessboard of size 2^n by 2^n can be tiled with L-shaped
then moving the leftmost 1 to the right. So for example, with n figures of 3 squares, such that only one square remains
= 13 persons (1101 in binary), the last person is number 11 uncovered. In fact, the uncovered square may be any square
(1011 in binary). for every choice, there exists a tiling. In fact, the puzzle
may be extended to 3D: Eight unit cubes make a cube with
edge length two. We will call such a cube with one unit cube
14. Forty-Five Minutes How do we measure forty-five
removed a "piece". A cube with edge length 2^n consists of
minutes using two identical wires, each of which takes an
hour to burn. We have matchsticks with us. The wires burn (2^n)3 unit cubes. Prove that if one unit cube is removed from
non-uniformly. So, for example, the two halves of a wire might T, then the remaining solid can be decomposed into pieces.
burn in 10 minute and 50 minutes respectively.
52. Fuel Dumps on a Circular Racetrack A set of fuel
15. Thousand Prisoners A prison has 1000 cells. Initially, dumps on a circular racetrack have just enough gasoline for
all cells are marked with - signs. From days 1 thru 1000, the one car to make one round trip. Prove that there exists a fuel
jailor toggles marks on some of the cells: from + to - and from dump from which one car, starting with an empty gas tank,
- to +. On the i-th day, the signs on cells that are multiples of i can complete the round trip.
get toggled. On the 1001-th day, all cells marked with + signs
are opened. Which cells are these? 53. Red Card Alice repeatedly draws a card randomly,
without replacement, from a pack of fifty-two cards. Bob has a
16. Non-Transitive Dice You and your opponent shall play one-time privilege to raise his hand just before a card is about
a game with three dice: First, your opponent chooses one of to be drawn. Bob must execute his privilege before the last
the three dice. Next, you choose one of the remaining two card is drawn. If the card drawn is Red just after Bob raises
dice. The player who throws the higher number with their his hand, Bob wins; otherwise he loses. Is there any way for
chosen dice wins. Now, each dice has three distinct numbers Bob to be correct more than half the times he plays this game
between 1 and 9, with pairs of opposite faces being identical. with Alice?
Design the three dice such that you always win! In other
words, no matter which dice your opponent chooses, one of 54. My Cap Color At the Secret Convention of Logicians,
the two remaining dice throws a number larger than your the Master Logician placed a band on each attendee's head,
opponent, on average. such that everyone else could see it but the person
themselves could not. There were many, many different
colours of band. The Logicians all sat in a circle, and the
17. Blind Man and Cards A blind man is handed a deck Master instructed them that a bell was to be rung in the forest
of 52 cards and told that exactly 10 of these cards are facing at regular intervals: at the moment when a Logician knew the
up. How can he divide the cards into two piles, not necessarily colour on his own forehead, he was to leave at the next bell.
of equal size, with each pile having the same number of cards Anyone who left at the wrong bell was clearly not a true
facing up? Logician but an evil infiltrator and would be thrown out of the
Convention post haste; but the Master reassures the group by
18. Breaking a Chocolate How many steps are required stating that the puzzle would not be impossible for anybody
to break an m x n bar of chocolate into 1 x 1 pieces? We may present. How did they do it?
break an existing piece of chocolate horizontally or vertically.
Stacking of two or more pieces is not allowed. 55. Twelve Coins One of twelve coins is counterfeit: it is
either heavier or lighter than the rest. Is it possible to identify
19. Two Dice = Nine Cards Alice has two standard dice the counterfeit coin in three weighings on a beam balance?
with labels 1 thru 6. When she rolls them and adds their
labels, she gets a distribution over integers in [2, 12]. Bob has 56. Grid Infection In an n by n grid of squares, two
nine cards, each labeled with some real number. When Bob squares are neighbors if they share an edge. Initially, some
chooses two cards (without replacement) and adds their squares are "infected". At successive clock ticks, an
labels, he gets exactly the same distribution over integers in uninfected square gets infected if at least two of its neighbors
[2, 12] as Alice gets by rolling her dice. What are the labels are infected. How many squares must initially be infected so
on Bob's nine cards? that all squares eventually get infected?

20. Three Boxes and a Ruby Alice places three identical 57. Duplicate Integer An array of length n+1 is populated
boxes on a table. She has concealed a precious ruby in one with integers in the range [1, n]. Find a duplicate integer (just
of them. The other two boxes are empty. Bob is allowed to one, not all) in linear time with O(1) space. The array is read-
pick one of the boxes. Among the two boxes remaining on the only and may not be modified. Variation: what if the array may
table, at least one is empty. Alice must then remove one be written into but must be left unmodified by the algorithm?
empty box from the table. Finally, Bob is allowed to open
either the box he picked, or the box lying on the table. If he
opens the box with the ruby, he gets a kiss from Alice (which 58. Find the Angle Find the measure of angle "a" in the
he values more than the ruby, of course). What should Bob diagram.
do?
21. Absent-Minded Professor N women stand in a queue
to take seats in an auditorium. Seating is pre-assigned.
However, the first woman is an absent-minded professor who
chooses any of the N seats at random. Subsequent women in
the queue behave as follows: if the seat assigned to her is
available, she takes it. Otherwise, she chooses an
unoccupied seat at random. What are the chances that the
last woman in the queue shall get the seat assigned to her?

## 22. Color of My Probabilistic Hat Three wizards are

seated at a circular room. A magician shall make hats appear
on their heads, one hat per wizard. Hats are either black or
white, chosen uniformly at random. A wizard cannot see his
own hat. At the sound of a bell, all wizards react 59. Five Card Trick A mathemagician asks a volunteer to
simultaneously. A wizard reacts by either announcing a color give him five cards drawn from a pack of fifty-two. He hands
or keeping quiet. If at least one wizard makes an one card back to the volunteer and arranges the remaining four
announcement and if all the announcements are correct, the in some sequence he chooses. He then hands the sequence
wizards have collectively won the game! Wizards are allowed to a second volunteer and leaves the room. His assistant
to confer beforehand to devise a strategy. On average, can enters. The assistant asks the second volunteer to read out
they win more than half the times the game is played? aloud the sequence handed to him. The assistant ponders a
little and correctly announces the identity of the card held by
the first volunteer. How could this be done? In general, how
23. Kirkman's Schoolgirl Problem Nine schoolgirls are large a deck of cards can be handled if n cards are drawn
to be arranged in three rows and three columns on four initially?
different days so that any pair of schoolgirls is in the same
row on exactly one of the four days.
60. Sum and Product P is told the product of two integers
chosen from [2, 99] and S is told the sum. The following
24. Three Boxes with Two Balls Each The first box has dialogue ensues: (1) P says, "I do not know the two integers."
two white balls. The second box has two black balls. The third (2) S replies, "I knew that already." (3) P exclaims, "Ah! I now
box has one white and one black ball. Boxes are labeled but know the two numbers.", (4) S smugly replies, "Now I know
all labels are wrong! You are allowed to open one box, pick them too." What are the two numbers?
one of its balls at random, see its color and put it back into
the box (you do not get to know the color of the other ball).
How many such operations are necessary to correctly label 61. Fast Bit Counting Devise a fast algorithm for
the boxes? computing the number of 1-bits in an unsigned integer. If the
machine supports n-bit integers, can we compute the number
of 1-bits in O(log n) machine instructions? Can we compute
25. Divide 100 Marbles into Two Piles How would you
the number of 1-bits in O(b) machine instructions where b is
divide 50 black and 50 white marbles into two piles, not
the number of 1-bits in the integer?
necessarily of same size, so that the probability of picking a
white marble as follows is maximized: we first pick one of the
piles uniformly at random, then we pick a marble in that pile 62. Empty the Bucket Three buckets have marbles. You
uniformly at random? are allowed to double the number of marbles in a bucket by
borrowing from one of the other two buckets. Prove that it is
possible to produce an empty bucket with a series of such
26. Three Heavy and Three Light Balls Three out of six
operations.
lookalike balls are heavy. The other three are light. How many
weighings on a beam balance are necessary to identify the
heavy balls? 63. Balanced Coloring Given k arbitrary points in a grid of
size m by n, is it always possible to color them either red or
black such that each row and each column is balanced? A
27. Tossing with One-Third Probability At a restaurant,
row or column is said to be balanced if the difference in the
how can Veronica choose one out of three desserts with equal
number of red and black points in it is at most one.
probability with the help of a coin? What if the coin is biased
and the bias is unknown?
64. Horses on Auction You are the chief guest at an
auction, where an unknown number of horses will be revealed
28. Coins in a Row 30 coins of arbitrary denominations
and auctioned, one after the other, randomly permuted. You
are laid out in a row. Simran and Tavleen alternately pick one
are a connoiseur of horses, and can judge whether one horse
of the two coins at the ends of the row so as to pick up as
is 'better' than another. Being the chief guest, you have a one-
much money as possible. If Simran makes the first move,
time privilege of selecting a horse, after it is revealed, but
could Tavleen ever collect more money than Simran, if Simran
before it gets auctioned off. You get to keep this horse for
makes the optimal choices?
yourself. Your objective is to maximize the probability of
selecting the best horse. One strategy is to pick the first
29. Ants in a Circle Suppose n ants are placed on a circle horse. Can you do any better?
with a diameter of one meter. Each ant location is chosen
independently, uniformly at random. An ant chooses between
65. Polya's Urn Process There are two urns with one ball
clockwise or anti-clockwise direction, uniformly at random,
each. Each of subsequent n-2 balls is placed into one of these
and starts scampering along the circle. All ants move at the
urns, with probability proportional to the number of balls
same speed: one meter per second. When two ants bump
already in that urn. What is the expected number of balls in
into each other, they reverse their direction of travel. One of
the urn with fewer balls?
the ants is named Alice. What is the probability that Alice
returns to the same point as she started, one minute after the
ants start their scampering? 66. Flipping Bits in a Matrix An 88 matrix contains
zeros and ones. You may repeatedly choose any 33 or 44
block and flip all bits in the block (that is, convert zeros to
30. Fifteen Sum Alice and Bob take turns to pick numbers
ones, and ones to zeros). Can you remove all the ones in the
from 1 thru 9, without replacement. The first to possess three
matrix?
distinct numbers that sum to 15 wins. Does Alice have a
winning strategy?
67. Rectangle with Integer Side A big rectangle is
composed of smaller non-overlapping rectangles, each having
31. Four Ships Four ships are sailing on a 2D planet.
integer width or integer height or both. Prove that the big
Each ships traverses a straight line at constant speed. No two
rectangle enjoys the same property.
ships are traveling parallel to each other. Their journeys
started at some time in the distant past. Sometimes, a pair of
ships collides. A ship continues its journey even after a 68. 100 Prisoners and 100 Boxes A room has 100 boxes
collision. However, it is strong enough only to survive two labeled 1 thru 100. The names of 100 prisoners have been
collisions; it dies when it collides a third time. The situation is placed in these boxes by the warden. The prisoners shall visit
grim. Five of six possible collisions have already taken place the room one by one. Each prisoner is allowed to inspect the
(no collision involved more than 2 ships) and two ships are out contents of at most 50 boxes, one after the other and leave
of commission. What fate awaits the remaining two? the room with no communication with other prisoners. If the
prisoner discovers his own name in the boxes he inspects, he
is released. The prisoners are allowed to collude before hand
32. Cap Colors An evil troll once captured a bunch of
and devise a strategy to maximize the chances of releasing
gnomes and told them, "Tomorrow, I will make you stand in a
each and every prisoner. What is their strategy?
file, ordered by height such that a gnome can see exactly
those gnomes that are shorter than him. I will place either a
white cap or a black cap on each head. Then, starting from 69. 100 Prisoners and a Light Bulb There are 100
the tallest, each gnome has to declare aloud what he thinks prisoners in solitary cells. There's a central living room with
the color of his own cap is. In the end, those who were correct one light bulb; this bulb is initially off. No prisoner can see the
will be spared; others will be eaten, silently." The gnomes set light bulb from his or her own cell. Everyday, the warden picks
thinking and came up with a strategy. How many of them a prisoner equally at random, and that prisoner visits the living
survived? room. While there, the prisoner can toggle the bulb if he or
she wishes. Also, the prisoner has the option of asserting that
all 100 prisoners have been to the living room by now. If this
33. f(f(x)) = -x Is it possible to write a function int f(int x) in
assertion is false, all 100 prisoners are shot. However, if it is
C that satisfies f(f(x)) == -x? Without globals and static
indeed true, all prisoners are set free and inducted into
variables, of course.
MENSA, since the world could always use more smart
people. Thus, the assertion should only be made if the
34. Card Shuffling A perfect in-shuffle of a deck of 52 prisoner is 100% certain of its validity. The prisoners are
cards is defined as follows. The deck is cut in half followed by allowed to get together one night in the courtyard, to discuss
interleaving of the two piles. So if the a plan. What plan should they agree on, so that eventually,
cards were labeled 0, 1, 2, ..., 51, the someone will make a correct assertion?
new sequence is 0, 26, 1, 27, 2, 28, ...
With repeated in-shuffles, shall we ever
get back the original order? In how many iterations? 70. Firing Squad Synchronization Consider a finite but
arbitrary number of identical finite state machines (soldiers)
arranged in a line. At time t = 0, each soldier is initialized to
35. Average Salary Four honest and hard-working the quiescent (idle) state, except for the soldier on the far left
computer engineers are sipping coffee at Starbucks. They (the general). The state of each soldier at each discrete time-
wish to compute their average salary. However, nobody is step t > 0 is dependent on its state and the state of its two
willing to reveal an iota of information about his/her own salary neighbors at time t - 1 (except for the two soldiers at either
to anybody else. How do they do it? end, each of whose state depends only on itself and its sole
neighbor). In addition, if a soldier and its neighbors are in the
quiescent state, then the soldier will remain quiescent at the
36. Forks in a Road A traveler has to pass tests of next time-step. The problem is to define a finite set of states
increasing difficulty to meet an Eastern mystical master. For and state transition rules for the soldiers such that all soldiers
the first test, he meets a pair of twins at a fork in the road: one enter a distinguished state (fire) at the same time and for the
path leads to the jungle, the other to the mystic. One of the very first time.
twins always says the truth, the other always lies. What
yes/no question should you ask one of the twins to determine
the path that goes to the mystic? For the second test, the 71. Four Points, Two Distinct Distances Find all
traveler encounters a second fork in the road. Again, one path configurations of 4 points in a plane with only 2 distinct values
leads to the jungle, the other to the mystic. This time, there for distances between pairs of points.
are three look-alike brothers: one always tells the truth, the
second always lies but the third sometimes tells the truth and
sometimes lies. What two Yes/No questions should the 72. Tumblers on a Rotating Table A blind gnome and an
traveler ask two of the brothers to determine the path to the evil goblin take turns to play a game. Four tumblers are placed
mystic? Each question is answered by only the brother it is at the corners of a square table. The initial configuration of the
posed to. For the second question, the traveler may choose tumblers (facing up or facing down) is chosen by the evil
the brother and the question depending upon the answer to goblin. When the blind gnome gets his turn, he is allowed to
the first question. specify a subset of the four tumblers and flip them
simultaneously. To be precise, he may choose "one tumbler",
"two diagonally opposites", "two adjacent", "three tumblers" or
37. Bigger or Smaller Alice writes two distinct real "four tumblers" lying in front of him, and flip them
numbers between 0 and 1 on two chits of paper. Bob selects simultaneously. After flipping, if all four tumblers are upright,
one of the chits randomly to inspect it. He then has to declare he wins the game! Otherwise, the game continues and the evil
whether the number he sees is the bigger or smaller of the goblin is allowed to rotate the table by an amount of his
two. Is there any way he can expect to be correct more than choice. Can the blind gnome win the game with a
half the times Alice plays this game with him? deterministic strategy?

38. Measuring Weights (a) Customers at a grocer's shop 73. Geometry With Only a Compass Using only a
always want an integral number pounds of wheat, between 1 compass (and without a straight edge or a ruler), is it possible
pound and 40 pounds. The grocer prefers to measure wheat in to identify (a) the midpoint of two points? (b) the center of a
exactly one weighing with a beam balance. What is the least circle? (c) all four corners of a square, given two of them?
number of weights he needs? (b) Customers come to a pawn
shop with antiques. An antique always weighs an integral
number of pounds, somewhere between 1 pound and 80 74. Dijkstra's Self-Stabilization Protocol There are n+1
pounds. The owner of the pawn shop is free to do as many processors named 0, 1, ..., n. Processor i has a counter C(i)
weighings as necessary to ascertain the unknown integral that takes values in the range [0, n]. Its initial value is
weight by using a beam balance. What is the least number of arbitrarily chosen from [0, n]. Processor 0 is said to be
weights he needs? privileged if C(0) = C(n). Processor i, where i > 0, is said to be
privileged if C(i) C(i-1). At successive clock ticks, exactly
one out of possibly several privileged processors is arbitrarily
chosen and its counter is updated as follows: If processor 0 is
chosen, we set C(0) (C(0) + 1) mod (n+1). Otherwise, we
set C(i) C(i-1). Prove that after a bounded number of clock
ticks, exactly one processor will be privileged. And that this
will continue to hold forever.

## 75. Three NOT Gates from Two NOT Gates Design a 3-

input 3-output logic circuit that negates the 3 signals. You
have an infinite supply of AND and OR gates but only two NOT
gates.

The Puzzle Toad at CMU has challenging puzzles. William Wu's Puzzles Page at Berkeley has myriad puzzles with a discussion
board. Cut the Knot has dozens of high quality articles on mathematics, puzzles and games. Puzzles by Erich Friedman has
cute puzzles; he also maintains Math Magic, Erich's Packing Center and Ambigrams. Archives of Ed Pegg Jr's Math Games in
MAA make interesting reading. Age of Puzzles is a nicely done website with classic puzzles, diagrams and references. Sam
Lloyd website: A few of his puzzles have tastefully been compiled at this website. SOMA cube has dozens of SOMA cube
configurations. List of books by Martin Gardner. Select puzzles for high school students: SNAP Math Fair. Another small
collection. A nice collection of problems at mathproblems.info. Another collection of puzzles. Yet another collection by Tanya
Khovanova. Some problems by Mihai Patrascu. Several ingenious puzzles at MathOveflow.Net. Prisoner and Hat Puzzles.
Surprises! Surprises! Surprises!. MSRI Archives (puzzles in each newsletter). Nice C Puzzles by Gowri Kumar. Interesting articles
on various problems.

## Gsx 3 years ago

There are 1000 persons in a circle, numbered 1 thru 1000. Going around the circle, every second
person is removed from the circle, starting with person number 2, 4, and so on. this is done repeatedly
until one person is left. Which number person out of 1000 will that be?

## Pratik Poddar Gsx 2 years ago

This is a standard problem from Knuth (Josephus Problem):
http://pratikpoddarcse.blogspo...

## Guest1000 Gsx 3 years ago

Person 1.
"Every second person is removed ..." indicating that person #1 will never be chosen for
removal.

## Mahipal28 Guest1000 2 years ago

I thinks its 49.....person 1 will be chosen when there are odd people remaining in a
circle.

## Sss Gsx 2 years ago

suppose there r 2^n ppl... so the first person will remain in the end...(u can check for any small
n)
so ans to this is that person before whom 512 ppl have been removed.
i.e 488 * 2=976 the person aftr this one i.e 977
ans is 977

person no 977

## Rahul Gupta 2 years ago

All the puzzles are available in editable form at google doc at the following link.

## Tranfamily139876 2 years ago

omg i had an extra credit one just like that riddle one and i got it right infact i was the only one that
got it right

## Clar1127 2 years ago

17 green marbles and 14 white marbles what is the probability of choosing a white marble first chosen
without replacement was a green marble help please

## how to cut a christmas cake in 8 pieces in 3 attempts????????????

how to cut a christmas cake in 8 pieces in 3 attempts????????????

## Ranjithlalpp Sagarsanyal 2 years ago

first make a cross cut(2 cuts) from top, later cut it from side(1 cut). coz cake is three
dimensional....

.
.

Ranjith lal

## rajini Sagarsanyal 6 months ago

ofcourse it is possible and it is very simple.
first cut the cake along its crosssection,then it will be made into 2
now cut along its 2 diameters.

## AJIT Surathkal 3 months ago

i have a box.the two dimension of the box are 4 m and 3m. compute the third dimension of the box so
that the space diagonal of the box is an integer. solve this problem.

## Rachit Tandon 10 months ago

Alice and Bob are playing a game. The game is played as follows :
- There are N piles of coins on the table. Pile i has A[i] coins.
- In each turn, each player can pick up 1 or more coins from the leftmost non-empty pile.
- If a player picks up a coin from pile i , all coins from piles 0 to i-1 should have been taken.
- The person who picks up the last coin loses the game.
Alice and Bob play the game alternately. Alice plays first. Given the number of piles N and the
number of coins Ai in pile i, you have to determine which player will win the game, assuming
both play optimally.
both play optimally.

## We did a great success in our last puzzle conference!

We received a request from the small local school to do an interactive lection about the riddles in our
life and the puzzles around our daily routines. We accepted the invitation gladly and start the
preparations.

The study materials are now ready in virtual format. I just need to print them and thats why I
telephoned the school principle and asked him how many children signed the course. He said to me
that the participants are exactly 10 and their request is to be arranged in the classroom on 5 rows with
exactly 4 children on each row.

I already printed 10 copies of the study materials. This task was easy! But how to arrange the children
on five rows with exactly four children on each row?

## pantactic a year ago

In Polya's Urn process, surely the urns are the same size. Are you asking for the expected number of
balls in the urn containing the fewest balls?

## Gurmeet Manku Mod pantactic a year ago

Y es, the goal is to identify the expected number of balls in the urn with fewer balls. Changed
the language to make it more precise.

## Maanrana41 2 years ago

hi gurmeet so beautiful
Pankaj Kukkar 2 years ago

you have two ropes, each of which takes one hour to burn completely. both of these ropes are
nonhomogeneous in thickness, meaning that some parts of the ropes are chunkier than other parts of
the rope. using these nonhomogeneous ropes and a lighter, time 45 minutes.
Note: Some clarification on what is meant by nonhomogeneous. For instance, maybe a particular
section of rope that is 1/8 of the total length is really chunky, and takes 50 minutes to burn off. then it
would take 10 minutes to burn off the remaning 7/8, since we know that the whole rope takes an hour
to burn off. that's just an example; we don't know any such ratios beforehand. The point is, if you look
at one of your ropes and cut it into pieces, you have no clue how long any individual piece will take to
burn off.

## Ulysses McGill Pankaj Kukkar 11 months ago

Light one of the ropes from both the ends and the other from one end only. When the rope
that's alight from both ends is completely burnt 30 minutes would have passed. At this point of
time, light the non-burning end of the second rope. When the second rope would have been
completely another 15 minutes would have passed. Thus the total time spent would be 45
minutes.

## Does anyone know the answer to this question?

If I have a balance beam scale and need to weigh objects that weigh 1 to 40 pounds, what 4 weights
would allow you to weight objects from 1 to 40 pounds integers

1 3 9 27

## Phoenix 83 2 years ago

Phoenix 83 2 years ago

To friend #1 I give half the cards plus half a card. To friend #2 I give half of the cards remaining plus
half a card. To friend #3 i give half of the cards I have left plus half of a card. After this I have no
cards left ?

7 cards

## DragonWarrior12 2 years ago

There are 12 L-shapes that need to be inserted into a grid. Each L has one hole in it. There are three
pieces of each of the four kinds shown here and any piece may be turned or flipped over before being
placed on the grid. No pieces of the same L can touch, even at a corner. The pieces fit together so well
that you cannot see any spaces between them; only the holes show. Can you tell where the L's are.

## Choclatecockroaches DragonWarrior12 2 years ago

in the middle of the grid....this is a typical triomino problem....

## I have an 8 x 8 checkerboard puzzle that I just cant solve:

When he died, the farmers will stated that the family property should be divided so that
each of the four sons gets a piece of land of equal size and shape, on which a tree stands.
How should the property be divided so that it meets the terms written in the will?
The shape is as below with the * a tree and the X a blank square in the grid :) I very much appreciate
xxx*xxxx
xxx*xxxx
xxx*xxxx
xxx*xxxx
xxx*xxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx

## Arunkumar 3 years ago

you r on the top of a bus, which means you are definitely not inside the bus. Give me a case which
both of the statements would be true.......

## can any one give the ans for this question

There are two bags with some cricket ballsin each say m and n.The Indian andEngland cricket teams
decide to play a newgame . The Indian team starts playing first,then the English,and they keep
alternating.A move consists of emptying any one bag,and splitting the contents of the other baginto
the two bags ( not necessarily half ineach). The loser is the team which cannotmake a move.
Depending on the number ofballs in each bag initially, can you determineunder what conditions India
will win???

## Mike Earnest Rohitth 6 months ago

I'm going to assume that when you split the bag, you can't leave an empty bag.

If at least one of m and n are even, India wins. Otherwise England does.

To win, whenever you have a bag which is even, split it into two odd bags. Y our opponent will
have no choice but to leave you with at least one nonempty even bag, allowing you to repeat
this process until no moves remain.

## Bulgakov 3 years ago

I recall a puzzle that isn't shown here but was once proposed by an IMO student. A 50 by 50 by 50
cube is levitating 100 ft into the air. There are two 50 ft ropes in the box, and a single window at the
cube's bottom side. I also vaguely recall the mention of a hook, perhaps on the box's side. How can a
person trapped inside escape, it asked. Like a fool, I had forgotten my hard-won solution. Could you
remind me, if you recognize this problem or if you have an idea of how to achieve escape.
Thanks.

## Kevin 3 years ago

M19 would be a better puzzle if you specify the number of floors rather than leave it arbitrary. As it is
written now, it should really be in the difficult category. Here's a moderate phrasing with a solution
that doesn't require a math degree:

With 100 floor building and 2 eggs, what is the optimal strategy for finding the lowest floor at which
an egg will break when dropped?

Solution:
At any point, if you are left with only 1 egg, the only strategy that will give you the answer is to start at
the lowest unknown floor and work your way up one-by-one until the egg breaks or until you reach
the top floor.

With 2 eggs, you can improve your strategy by starting somewhere between the lowest unknown floor
and the highest unknown floor. If the egg breaks, you can eliminate all upper floors, but then you
have to revert to the 1 egg strategy. If the egg doesn't break, you can eliminate that floor plus all floors
below it, and then choose another starting point among the remaining floors and repeat.

With 100 floors, you can find the correct floor in 14 drops or less by starting at floor 14. If the egg
breaks, you then go to floor 1, work your way up, and will find the correct floor with at most 14 drops.
If the egg doesn't break, then move up 13 floors to 27. Again, if it breaks, you work your way up from
15 and will find the correct floor in at most 14 drops. If it didn't, you move up 12 floors, then 11, etc.
Using this method, you can see that you will always find the correct floor in 14 or fewer drops.
Using this method, you can see that you will always find the correct floor in 14 or fewer drops.

If you attempt to find the floor with 13 or fewer drops, you can see that you must start at the 13th
floor or lower, and after the first drop you can move at most 12 floors, then 11, etc. Y ou will not reach
the top of the building within 13 drops, so you cannot guarantee you will find the correct floor.

## Gurmeet Manku Mod Kevin 3 years ago

Thanks, Mike! Y our solution has been posted at here.

superb

## gavri 3 years ago

Hey,

Some problems don't have a solution.. like M17 and D11. Can u plz upload them

## Pratik Poddar gavri 3 years ago

Posted solutions to both M17 and D11 here

D11: http://pratikpoddarcse.blogspot.com/2010/01/red-vs-black-cards-expected-payoff.html

M17: http://pratikpoddarcse.blogspot.com/2009/11/weighing-problems.html

Cheers!

## Gurmeet Manku Mod gavri 3 years ago

Gurmeet Manku Mod gavri 3 years ago
Hi Gavri! Will post them when I get time -- am drowned in office work these days.. and I
spend my weekends hiking and writing about hikes in and around the bay area :)

## Ruchi 3 years ago

Hi Gurmeet,

Could you post the solution to the firing squad problem. The solution is now linked to the wikipedia
page. It would be nice if you could post the one you had posted before as well as explain why the
speeds are x and 3x. Thanks for your help!

## Gurmeet Manku Mod Ruchi 3 years ago

Hi Ruchi, Will write an article on the firing squad problem when I get some time.. Am busy
hiking and doing office work these days.

## Hari kumar Darimisetty 4 years ago

The Puzzles are nice, trying to solve them , giving me a lot of fun

## Anil Pulakanti 4 years ago

hey,
ur puzzles r cool n ur website totally is vry awesome :)

Thanks, Anil! :)

## Travis 4 years ago

On D5, are the tumblers initially arranged upright, facing down, or randomly?
On D5, are the tumblers initially arranged upright, facing down, or randomly?

## Gurmeet Manku Mod Travis 4 years ago

Hi Travis! The initial configuration is also chosen by the adversary, the "evil goblin". The blind
gnome must have a strateg, no matter what the initial configuration and no matter how the
table is rotated after he moves.

Great list!

## I think the statement of M5 is wrong, you wrote:

'A cube with edge length 2n consists of (2n)^3 unit cubes. Prove that if one unit cube is removed from
T, then the remaining solid can be decomposed into pieces.'

## Gurmeet Manku Mod sobe86 4 years ago

Thanks for pointing out the bug, sobe86. Fixed.

## Kedar 4 years ago

Classic collection. Knew few puzzles before but a lot of these are new and very interesting!! Thanks for
sharing!

Good Collection.

## I especially liked D1.[Flipping BITS...]

Here's one for U...

## Can U make 64 using ONLY Two 4's??...

http://2600hertz.wordpress.com...

super simple..

4^4 = 64!