Easy Probability
Easy Probability
Puzzles (Easy)
1. Problem: Gold Links Puzzle
Lenox R. Lohr, president of the Museum of Science and Industry in Chicago, was kind enough to pass along the
following deceptively simple version of a type of combinatorial problem that turns up in many fields of applied
mathematics. A traveler finds himself in a strange town without funds; he expects a large check to arrive in a few
weeks. His most valuable possession is a gold watch chain of 23 links. To pay for a room he arranges with a landlady
to give her as collateral one link a day for 23 days. Naturally, the traveler wants to damage his watch chain as little as
possible. Instead of giving the landlady a separate link each day he can give her one link the first day, then on the
second day take back the link and give her a chain of two links. On the third day he can give her the single link again
and on the fourth take back all she has and give her a chain of four links. All that matters is that each day she must be
in possession of a number of links that corresponds to the number of days.
The traveler soon realizes that this can be accomplished by cutting the chain in many different ways. The problem is:
What is the smallest number of links the traveler needs to cut to carry out his agreement for the full 23 days?
Prove that for any positive K and a natural number n, every (n*K)th number in the Fibonacci sequence is a multiple of
the Kth number in the Fibonacci sequence.
More formally, for any natural number n, let F(n) denote Fibonacci number n. That is, F(0) = 0, F(1) = 1, and F(n+2)
= F(n+1) + F(n). Prove that for any positive K and natural n, F(n*K) is a multiple of F(K).
5. Problem: Gold Silver Numbers Puzzle
Given only this information, for each of the following decide whether it is a gold number, a silver number, or could be
either:
What is the maximum number of pebbles Peggy can place on the chessboard?
7. Problem: Pebble Placement Puzzle 1
There are several pebbles placed on an n x n chessboard, such that each pebble is inside a square and no two pebbles
share the same square.
Perry decides to play the following game. At each turn, he moves one of the pebbles to an empty neighboring square.
After a while, Perry notices that every pebble has passed through every square of the chessboard exactly once and has
come back to its original position.
Prove that there was a moment when no pebble was on its original position.
A mad robot sets off towards the North East on a journey from the point (0,0) in a coordinate system. It travels in
stages by moving forward and then rotating on the spot. It follows these pseudo-code instructions:
SUB JOURNEY
DISTANCE = 1000
WHILE (DISTANCE > 0.001)
MOVE DISTANCE
STOP
ROTATE(90, DEGREES, CLOCKWISE)
DISTANCE = DISTANCE / 2
END WHILE
EXPLODE
END SUB
What is the optimal algorithm to find the minimum element given a rotated sorted array of integers?
A rotated sorted array of integers is the output array of a rotation operation performed on a sorted array.
Eg: 3 5 6 1 2
Your goal is to zero all the bits once you reach the end of a scan (i.e. at the left most bit), whilst you adversary wishes
to prolong the game indefinitely.
We continually re-scan until we reach the aforementioned goal state.
Can you prove that the game will eventually terminate?
15. Problem: Candy Game - Math Puzzle
A group of students are sitting in a circle with the teacher in the center. They all have an even number of candies (not
necessarily equal). When the teacher blows a whistle, each student passes half his candies to the student on his left.
Then the students who have an odd number of candies obtain an extra candy from the teacher.
Show that after a finite number of whistles, all students have the same number of candies.
Roll a penny around another fixed penny in the center with edges in close contact. After moving half circle around the
center penny, you will find the penny in motion has rotated 360 degrees.
Why?
17. Problem: Broken Clock Puzzle
My fancy new digital alarm clock is broken! The time 'jumps' around.
When I reset it, it reads 12:00:00. Then it runs as it should, but after 12:04:15 it resets back to 12:00:00. It counts up
to 12:04:15 again and then it jumps to ... 12:08:32 ! Weird stuff.
Someone hands you a deck of cards which you thoroughly shuffle. Next, you start to deal them, face-up, counting the
cards as you go. "One, Two, Three ..."
The aim is to predict what the count will be when you encounter the second black Ace in the deck.
If you had to select one position before you started to deal, what number would you select that maximizes your chance
of guessing the location of the second black Ace?
19. Problem: Fermat Theorem Puzzle
A computer scientist claims that he proved somehow that the Fermat theorem is correct for the following 3 numbers:
x=2233445566,
y=7788990011,
z=9988776655
He announces these 3 numbers and calls for a press conference where he is going to present the value of N (to show
that
and that the guy from Princeton was wrong). As the press conference starts, a 10-years old boy raises his hand and
says that the respectable scientist has made a mistake and the Fermat theorem cannot hold for those 3 numbers. The
scientist checks his computer calculations and finds a bug.
How did the boy figure out that the scientist was wrong?
20. Problem: Pizza Distribution Puzzle
The king of the universe has decided to play a game. To start, he selects 1 person. He then flips two fair coins - if they
both come up heads, the person gets a free pizza and the game is over. For any other result, he sends the person home
and selects 2 new people, where he does the same 2-coin flip to decide if they each get a pizza. If they don't, he picks
4 people at random, then 8, and so on, doubling each round. If you are selected but don't win, you can't be selected
again, and you can assume the population is extremely large so there's no chance of running out of contestants.
You are sitting at home when you get a call, you have been selected to play the game. What is the chance that you
will get a free pizza?
You don't know which round number it is, but if you ask, the king will tell you. Does it matter?
2) A deck of pokers. Three choices: A: 26 black, 26 Red; B: 13 black, 13 Red; C: random 26 card from the deck. Take
the first two cards, if same color, the win $1, otherwise lose $1. Which deck is best for you if you are playing? Why?
3) What is the probability of a random generator generating 10 consecutive numbers in ascending order (assume it is a
perfect random generator)
What is the probability that two uniform random points (to be precise: i.i.d. with respect to Lebesgue measure) in the
square are such that center of the square lies in the circle formed by taking the points as diameter.
24. Problem: Number of 1s
One of the basics of Computer Science is knowing how numbers are represented in 2's complement. Imagine that you
write down all numbers between A and B inclusive in 2's complement representation using 32 bits. How many 1's will
you write down in all ?
Input:
Two integers A and B
Output:
The number of 1s
Constraints:
-2^31 <= A <= B <= 2^31 - 1
Bonus made-up Question: Can you come up with a generalized solution of the hour glass problem?
Update: (26/12/2012):
Assume that equal amount of sand slipped down measures equal intervals of time, i.e. amount of sand slipped to
measure the first minute is same as the last minute.
26. Problem: Inequality Problem
Prove the following inequality
There is a calculator in which all digits(0-9) and the basic arithmetic operators(+,-,*,/) are disabled. However other
scientific functions are operational like exp, log, sin, cos, arctan, etc. The calculator currently displays a 0. Convert
this first to 2 and then to 3.
28. Problem: Maxima Property Subset
At most, how many subsets can you find of the set A = {1, 2, ..., n} such that any two intersect in exactly one
element?
A lion and a lion tamer are enclosed within a circular cage. If they move at the same speed but are both restricted by
the cage, can the lion catch the lion tamer? (Represent the cage by a circle, and the lion and lion tamer as two point
masses within it.)
30. Problem: Number Board Puzzle: Sum of Colours
Each number is given a colour (red or white) such that each row and each column has exactly the same number of red
number and white numbers (i.e. four). Prove that the sum of 32 red numbers on the board is equal to the sum of the
other 32 white numbers on the board.
You have 55 matches arranged in some number of piles of different sizes. You now do the following operation: pick
one match from each pile, and form a new pile. You repeat this ad infinitum. What is the steady state? Is it unique?
You have a number that consists of 6 different digits. This number multiplied by 2, 3, 4, 5, and 6 yields, in all cases, a
new 6-digit number, which, in all cases, is a permutation of the original 6 different digits. What's the number?
33. Problem: Number of digits in 125^100
How many digits does the number 125^100 have?
Note that since the problem is not very well specified, make reasonable assumptions to solve it. It would be fun if
before solving mathematically, you try and guess a time estimate. :-)
35. Problem: Matrix Saddle Points
An entry aij in a matrix is called a saddle point if it is strictly greater than all the entries in the ith row and strictly
lesser than all entries in the jth column or vice-versa.
39. Problems:
Football tables have been the basis of many a brainteaser over the years. These two puzzles ask you to work out what
the scores were in all matches played so far this season.
Puzzle 1: Each team played the others once, what were the scores in each match (2 points for a win, 1 for a draw)?
Puzzle 2: The league table below got smudged in the rain, and is only partly legible. Eventually each team will play
the others once, but the tournament isn't over yet. Can you find all the results?
40. Problem: Wrong Solution
I found this cute problem in the Russian book Sharygin Geometry Olympiad by Zaslavsky, Protasov and Sharygin.
Follow up questions:
Draw N perfect circles on a plane, of any size, anywhere you want. Into how many regions can you divide the plane?
Next, draw N perfect ellipses on another plane. Into how many regions can you divide the plane?
How can you find the grouping of the jugs into pairs of red and blue jugs that hold the same amount of water, in the
minimum number of comparisons.
The only operations allowed is compare between a red and a blue jar (no two reds, no two blues)
46. Problem: Stick Broken Into Three Pieces
Assume a stick is broken at random into three pieces. What is the probability that the pieces can form a triangle?
Assumption:
Note that the dealer is just an employee of the casino. You can take him in your group and make an offer he cannot
refuse.
You like all flavors equally, so you want to randomly select a cone with each flavor having an equal chance of being
chosen. Unfortunately, you don't know the total number of flavors, but being the little hipster that you are, you are
carrying a pocket calculator which can generate random numbers from 1 to X, where X is a value you punch in. How
can you decide which flavor to keep?
(a) Two players alternatively erase some 9 numbers from the sequence 1,2,...,101 until only two remain. The player
that starts wins x-54 dollars from the player that plays second. Here x is the difference between the remaining two
numbers. Would you rather be the first or the second player?
(b) Two players alternatively erase one number from the sequence 1,2,...,27 until only two numbers remain. The first
player wins if the sum of these numbers is divisible by 5; otherwise the second player wins. Who has a winning
strategy?
54. Problem: Equal numbers in a circle
A circle is divided into 6 sectors. The numbers 1, 0, 1, 0, 0, 0 are written into the sectors in the counter clock-wise
direction. You may increase any two neighboring numbers by 1. Is it possible to make all of the numbers equal?
Ever played housie/tambola? I played housie once every month for 6 good years of my life. Won some prizes. Each
coupon (a ticket with 15 numbers) cost Rs. 10 then. Full Housie was nearly 150 Rs, exact number depending upon the
number of tickets sold.
I played one such game once again after a lapse of 6 years I think. At the end of the game I saw that 76 numbers out of
90 had been cut on the board. I couldn't help but to think what is the expected number of numbers I expect to be
crossed if N (say 100) tickets have been sold. Also, I wanted to find out what is a good number of people who should
be there to play housie. Of course if there are zillions of people, the game would be over in approximately 15 calls. If
there is one person, we expect the game to go on very close to 90 calls. What is the number of people playing the
game so that the expected number of calls would be say 70.
Of course, I played the game in a homely environment where the "dealer" did not keep any money. So, all the money
collected was given back as prizes. Since every person has equal expectation to win, I should expect to get back my
investment.
Unfortunately the pipes and cables must not cross each other. How would you connect connect each of the 3 houses to
each of the gas, water and electricityic supplies?
59. Paradox:
The paradox imagines that Sleeping Beauty volunteers to undergo the following experiment. On Sunday she is given a
drug that sends her to sleep. A fair coin is then tossed just once in the course of the experiment to determine which
experimental procedure is undertaken. If the coin comes up heads, Beauty is awakened and interviewed on Monday,
and then the experiment ends. If the coin comes up tails, she is awakened and interviewed on Monday, given a second
dose of the sleeping drug, and awakened and interviewed again on Tuesday. The experiment then ends on Tuesday,
without flipping the coin again. The sleeping drug induces a mild amnesia, so that she cannot remember any previous
awakenings during the course of the experiment (if any). During the experiment, she has no access to anything that
would give a clue as to the day of the week. However, she knows all the details of the experiment.
Each interview consists of one question, "What is your credence now for the proposition that our coin landed heads?"
This problem is considered paradoxical because the answer is often given as either 1/3 or 1/2.
60. Unexpectedly Great Expectations
WARNING: THESE ARE THEORETICAL GAMES. Try not to bias yourself by how much YOU value 1000$
compared to how a millionaire values 1000$ (the utility function of money is a constant for all people). Also, we
assume God has infinite amount of money with him, and does not lie when he says he will pay you, so please dont
give arguments like put the money on the table and I will play (replace 1$ by 0.001$ or any such figure if you want
to satisfy yourself practically).
God offer you the option of playing a game, exactly once, against me. This is how the game works. God will toss a
fair coin until a T turns up. The sequence of coins HnT will earn you 2n dollars. More explicitly, a T on the first toss
gives you 1 dollar, a Head followed by a Tail gives you 2, HHT gives you 4, HHHT gives you 8. As soon as the T
turns up, we settle accounts, and leave, never to see each other again. However, there is a constant pre-agreed charge
P you must pay to play this game against me (say 10000 $). Upto what price P are you willing to play this game?
Analysis: The probability of the T is 1/2, of HT is 1/4, of HHT is 1/8 and so on (1/2 * 1/2 * 1/2 as they are
independent events).
E(earnings)
However the 2000th term of this series of halves is highly improbable (1/2^1000). If you believe expected values, you
should be willing to pay any finite amount of money to play this game.
But if you think over it, the probability that you will get at least 1000$ is 0.0005 which is too small. So, you should
not be willing to pay infinite amount of money. Your intuition will not allow you to play with infinite money. Can you
explain the paradox?
Update(26/03/10):
This is not an exact question. I need to see various approaches to solve this problem. I see this as a real problem: I saw
some locomotives and then someone asks me - Guess the number of locomotives.
Since I have not provided enough data, all "creative" answers are correct.
You can launch a torpedo each minute at any integer on the number line. If the the submarine is there, you hit it and it
sinks. You have all the time and torpedoes you want. You must sink this enemy sub - devise a strategy that is
guaranteed to eventually hit the enemy sub.
63. Problem:
You have Some Terminal Condition, which necessitates taking two pills a day:
one Pill A and one Pill B. If you neglect to take either pill, you die; if you take more than one A or more than one B,
you die. If you don't take them at exactly the same time, you die.
This morning you are going through your usual routine. You pick up your bottle of A Pills and gently tap one into
your palm. Then you pick up your bottle of B Pills and tap it, but two pills accidentally fall into your hand. You now
hold three pills (one pill of A and two pills of B), you don't know which are which, and they are completely
indistinguishable from each other. The A Pills are the same color as the B Pills, they are the same shape, same size -
they are identical in every respect. Your doctor is charging you $10,000,000 a pill! So you dare not throw any away.
Thus, the puzzle: what can you do to ensure that you take only one A Pill and only one B Pill today, without wasting
any pills (either today or in the future)?
Write an O(n^2*2^n) algorithm for Pratik that will determine a song order which maximizes the total transition
goodness of the mix tape. (If the maximum is not achieved, Pratik will be dumped. :()
65. Problem: Drunk Guests
A very large number, N, of people arrive at a convention. There are exactly N single rooms in the hotel where the
convention takes place. Each guest is given a numbered key for a specific room. Before they even go upstairs, they are
all invited to a large party in the banquet hall. To gain admittance to the hall, they have to give up their keys to a
doorman. At the end of the evening, the guests are not sober enough to recall their room numbers, so the doorman
simply hands out the keys randomly. Each guest ends up spending the night in a random room.
What is the probability that at least one guest ends up in a room he or she was originally assigned?
What is the expected number of guests who end up in a room in which they were originally assigned?
Is there a sequence of operations that would result in 105 piles with one pebble each?
67. Problem: IBM Ponder This January 2010 Puzzle
Present a computation whose result is 5, being a composition of commonly used mathematical functions and field
operators (anything from simple addition to hyperbolic arc-tangent functions will do), but using only two constants,
both of them 2.
It is too easy to do it using round, floor, or ceiling functions, so we do not allow them.
71. Problem:
Suppose N mothers live in a city. Half of them have one child and half of them have two children. That means that an
average mother has 1.5 children.
Suppose we pick the sexual orientation of every child by rolling dice. Let's assume that a child has a 10% probability
of being homosexual.
The number of mothers with one child who is homosexual is 0.05N. The number of mothers with two children both of
them homosexual is 0.005N. The number of mothers with two children with only the first child homosexual is
0.045N, which is the same as the number of mothers of two children with only the second child homosexual. The total
number of mothers who have two children with at least one of them homosexual is 0.095N.
Let's calculate the average fertility of a mother with at least one homosexual child. It is (1*0.05N + 2*0.095N)/(0.05N
+ 0.095N) = 0.24/0.145 = 1.66. The resulting number , 1.66 , is much bigger than 1.5, the average number of children
for a mother.
This means there is a correlation between homosexuality and the fertility of mothers. This suggests that there is a gay
gene which at the same time is responsible for female fertility.
But the model is completely random , there can't be any correlation.
Where is the mistake?
72. Problem: Chessboard Circle
A chessboard has squares that are two inches on the side. What is the radius of the largest circle that can be drawn on
the board in such a way that the circle's circumference is entirely on black squares?
75. Problem:
You have hired a worker to clean your garage. The wage is a gold bar (which has 7 parts like a chocolate bar) for a
weeks work. However, you don't want to give the complete bar in the start. You want to pay the person 1 part for each
day of his work. So at the end of first day he should have 1 part, at the end of second day 1 part more (a total of 2
parts), third day 1 part more (3 parts total)...at the end of the week all 7 parts. What is the minimum number of pieces
that you should break the gold bar in to pay the worker?
Update: As pointed by Ramdas, this question is not very well framed. There are a few assumptions that you need to
make. :)
76. Problem:
Suppose you have a hotel which has one floor with infinite number of rooms in a row and all of them are occupied. A
new customer wants to check in, how will you accommodate her? What if infinite number of people want to check in,
how will you accommodate them then?
Example: In 3 tosses
HHH (2 HH)
HHT (1 HH)
HTH (0 HH)
HTT (0 HH)
THH (1 HH)
THT (0 HH)
TTH (0 HH)
TTT (0 HH)
Expected number of HH in 3 tosses = 2/8 + 1/8 + 1/8 = 0.5
1) The stick drops and breaks at a random point distributed uniformly across the length. What is the expected length
of the smaller part?
2) In the above experiment, what is the expected length of the larger part?
3) In the third experiment, the stick is dropped and breaks at two points. What is the probability that the three pieces
could form a triangle?
80. Problem:
We have a cube. An ant is on one of the corners. It moves randomly with equal probability in all the three directions.
What is the expected number of steps to reach the opposite corner.
Note that the probability of the ant reaching the opposite corner in 2 steps is 0, in 3 steps is 6/27, in 4 steps is 0 and so
on..
81. Problem:
Suppose two players are playing a game where we call integers. The first person who calls 50 wins. The rules are that
the first person calls a number between 1 and 10. After that any new number that is called must exceed the last
number by at least one and no more than by 10. For example: If the last number called is 15, then the next number that
is called must be between 16-25.
I give you the first mover advantage, devise a strategy to win.
82. Problem:
Given an array of n numbers. Finding minimum takes n-1 comparisons. Finding maximum takes n-1 comparisons. If
you had to simultaneously find both minimum and maximum, can you do it in less than 2n-2 comparisons?
83. Problem:
I write two different numbers in the range [a,b], one on each hand. You choose one of my hands at random, I show
you the number on that hand. You now guess whether the number you've seen is larger than the number you haven't
seen.
Find a strategy for guessing such that, no matter what two numbers I write, you have GREATER THAN a 50%
chance of being correct.
84. HC Verma Problem:
Four bugs are on the corners of a 1 meter square. Each bug always faces the next bug (on the next clockwise corner).
If they all walk forward at the same speed until they meet, how far does each bug travel?
85. Problem:
You can go to a fast food restaurant to buy chicken nuggets in 6-pack, 9-pack or 20-packs. is there such a number N,
such that for all numbers bigger than or equal to N, you can buy that number of chicken nuggets?
86. Google interview question:
There is an array A[N] of N integers. You have to compose an array B[N] such that B[i] will be equal to the product
of all the elements of A[] except A[i].
Example:
Input:[4, 3, 2, 1, 2]
Output:[12, 16, 24, 48, 24]
87. Problem:
There are 100 coins on the table out of which 50 are tail-face up and 50 are head face up. You are blind folded and
there is no way to determine which side is up by rubbing, etc. You have to divide the 100 coins in two equal halves
such that both have equal number of coins with tails face up. (This obviously implies that the two have equal number
of coins with heads face up)
Second part: There are 100 coins on the table out of which 10 are tail-face up and 90 are head face up. You are blind
folded and there is no way to determine which side is up by rubbing, etc. You have to divide the 100 coins in two
halves (not necessarily equal) such that both have equal number of coins with tails face up.
88. IBM puzzle:
Complete the following sequence:
1, 13, 2, 1, 5, 3, 2, 1, 4, 4, 7, 3, 1, 5, 3, 5, ?, ?
89. Problem:
You are the ruler of a medieval empire and you are about to have a celebration tomorrow. The celebration is the most
important party you have ever hosted. You've got 1024 bottles of wine you were planning to open for the celebration,
but you find out that one of them is poisoned.
The poison exhibits no symptoms until death. Death occurs within ten to twenty hours after consuming even the
minutest amount of poison.
You have over a thousand slaves at your disposal and just under 24 hours to determine which single bottle is
poisoned.
You have a handful of prisoners about to be executed, and it would mar your celebration to have anyone else killed.
What is the smallest number of prisoners you must have to drink from the bottles to be absolutely sure to find the
poisoned bottle within 24 hours?
90. Another hat puzzle:
A teacher puts on 10 hats of either red or blue on 10 students. Each one can see the hats on all other 9 students, but not
his own. The teacher tells them that at least one of the hat is blue. The teacher asks each one to write down the color
of his hat if he's sure about it, or he can write down "don't know" if he can't deduce its color. Everyone reveals their
answer at the same time and all of them write "don't know". The second day, they gather again and the teacher puts on
the same hats. Each one has to think about the color of his hat again. This time, still no one can figure out his hat color
(i.e. everyone writes down "don't know"). This game repeats in the same way on third day, fourth day, ..., until the
ninth day. Still no one figures out. However, on the tenth day, everyone writes down the correct color of his hat. So
explain what happened? And what's the color they wrote down? Assume throughout the 10 days, those students do not
communicate with each other. And also assume everyone is smart and knows everyone else is smart, and so on.
93. Problem:
When six dice are rolled, the number of different numbers which can appear range from 1 to 6. Suppose that once
every minute, the croupier rolls six dice and you bet $1, at even odds, that the number of different numbers which
appear will be exactly 4.
If you start with $10, roughly how long will it be, on average before you are wiped out?
94. Puzzle:
An evil troll once captured a bunch of gnomes and told them, "Tomorrow, I will make you stand in a file, one behind
the other, ordered by height such that the tallest gnome can see everybody in front of him. I will place either a white
cap or a black cap on each head. Then, starting from the tallest, each gnome has to declare aloud what he thinks the
color of his own cap is. In the end, those who were correct will be spared; others will be eaten, silently." The gnomes
set thinking and came up with a strategy. How many of them survived?
95. Problem:
In a country, where people only want boys, every family continues to have children until they have a boy. If they have
a girl, they have another child. If they have a boy, they stop. Who will be more in the country (boys or girls)?
Intuitively, I and many of my friends thought it to be boys. Which seems fine as the society favours boys. But
calculation shows that they would be equal. How? Suppose there are N couples. Note that each couple would have
exactly one boy. So, no. of boys born is equal to N. Counting the no. of girls. N/2 parents would have no girl child.
N/4 would have exactly 1 girl child, N/8 would have exactly two girl children, N/16 would have exactly 3 girl
children and so on... So, Expected no. of girls from N couples would be S: S = 1*N/4 + 2*N/8 + 3*N/16 + 4*N/32 +
..........
S = N So, Expected no. of boys = Expected no. of girls. Equal sex ratio.:)