A Solution Manual and Notes for: Puzzles to Puzzle You: by Devi

A Solution Manual and Notes for:
Puzzles to Puzzle You:
by Devi Shakuntala
John L. Weatherwaxв€—
January 26, 2014
в€—
[email protected]
1
Text copyright c 2013 John L. Weatherwax
All Rights Reserved
2
To all the future problem solvers.
3
Introduction
This is a great little puzzle book to develop the skills for problem solving. It was written
by the genius Shakuntala in 1979. When the book was published computers were not as
common as they are now and (in my opinion) it would be very difficult to solve some of
these problems “by hand”. This was apparently not a problem for Shakuntala, who has
been described as a human calculator. This description shows in these problems. In fact
many of the problems have a feel like “Project Euler” problems1 in that some of them can be
solved (without as much tedium) by using a programming language to enumerate the very
large number of possible candidates. In fact I would estimate that for these problems most
people would simply give up before being able to find a solution. This is a shame since in
my view solving problems should be an enterprise where we “use everything we’ve got” in
an attempt at a solution. By introducing a modern computer we are able to offload some
of the work to a machine and get back to the fun part of problem solving. Working on the
“computational” problems in this book are so much like the Project Euler problems that
studying this book can give you some techniques to be used there.
In this book I provide up-to date detailed solutions to many of the problems posed by
Shakuntala. In addition, in the case where it is prudent to do so I implement python (and
sometimes R) codes to help in the enumeration of the choices and facilitate finding solutions.
Reading these notes and solutions is a good way to learn a bit about the very popular and
powerful programming language python. I hope that this book will help you become a
stronger problem solver and open your eyes to the possibility of using python as a language
to help solve your own problems. These code snippets can be found here:
http://waxworksmath.com/Authors/N_Z/Shakuntala/shakuntala.html
As a final comment, I’ve worked hard to make these notes as good as I can, but I have no
illusions that they are perfect. If you feel that that there is a better way to accomplish
or explain an exercise or derivation presented in these notes; or that one or more of the
explanations is unclear, incomplete, or misleading, please tell me. If you find an error of
any kind – technical, grammatical, typographical, whatever – please tell me that, too. I’ll
gladly add to the acknowledgments in later printings the name of the first person to bring
each problem to my attention.
1
http://projecteuler.net
4
Contents
Tall Men Next Door . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
Brothers and Sisters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
Over the Golden Gate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
The Digits and Square Numbers . . . . . . . . . . . . . . . . . . . . . . . . .
12
Bicycle Thieves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12
The Bus Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12
The Hour Hand and the Minute Hand . . . . . . . . . . . . . . . . . . . . .
13
To Catch a Thief . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14
The Gong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14
Something for the Marmalade . . . . . . . . . . . . . . . . . . . . . . . . . .
15
The Counterfeit Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
Nuts for the Nuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
The Wedding Anniversary . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17
I’ll Get it for you Wholesale . . . . . . . . . . . . . . . . . . . . . . . . . . .
17
The Broken Glasses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18
The Peculiar Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18
Make a Century . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18
The Perplexed Postal Clerk . . . . . . . . . . . . . . . . . . . . . . . . . . .
19
The Mystery of the Missing Paisa . . . . . . . . . . . . . . . . . . . . . . . .
19
Walking back to Happiness . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19
On the Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19
The Legacy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20
5
The Round Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20
Down the Escalator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20
The Chess Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20
A Game of Cats and Mice . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
The Wheels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
Blow How Blow Cold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
The Llama Race
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22
The Shattered Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22
The Painted Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22
Animals on the Farm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
23
Which is the Better Bargain? . . . . . . . . . . . . . . . . . . . . . . . . . .
24
Walking all the Way . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
24
The Train and the Cyclist . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25
Something for Profit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25
The Digital Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25
The Faulty Machine
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
26
The Number and the Square . . . . . . . . . . . . . . . . . . . . . . . . . . .
26
Squares and Right Angles . . . . . . . . . . . . . . . . . . . . . . . . . . . .
26
The Dishonest Merchant . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
26
For the Charities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
27
The Number Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
27
The Sari and the Blouse . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
28
When was he Born? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
28
6
The Weight of the Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
28
Lucrative Business . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
28
The Old Ship . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
28
The Three Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
28
On the Way to Market . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
29
A Matter of Denomination . . . . . . . . . . . . . . . . . . . . . . . . . . . .
29
Right Foot Foward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
29
A Problem of Socks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
29
A Fair Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
29
Mathematics and Literature . . . . . . . . . . . . . . . . . . . . . . . . . . .
30
Heads I Win Tails I Loose . . . . . . . . . . . . . . . . . . . . . . . . . . . .
31
A Problem from Lilavati . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
31
Up the Ladder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
31
Pigs and Ducks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
32
The Faulty Watch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
32
The Egg Vendor and His Eggs . . . . . . . . . . . . . . . . . . . . . . . . . .
32
Some Luck! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
32
The Trains and the Falcon . . . . . . . . . . . . . . . . . . . . . . . . . . . .
32
Which is more Lucrative? . . . . . . . . . . . . . . . . . . . . . . . . . . . .
33
Little Mammu and the Marbles . . . . . . . . . . . . . . . . . . . . . . . . .
33
The Curious License Plate . . . . . . . . . . . . . . . . . . . . . . . . . . . .
33
Lose or Gain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
34
A Problem of Combination . . . . . . . . . . . . . . . . . . . . . . . . . . . .
34
7
The Special Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
34
Sawing the Tree Trunk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
34
The Bigamist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
34
The Split
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
35
At the Fete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
35
At the Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
35
The Counterfeit Coins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
35
Multiplying Bacteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
36
A Puzzling Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
36
What a Coincidence! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
36
The Idler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
37
Numbers Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
37
A Bargain in Guavas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
37
The Mathematical Shepherd . . . . . . . . . . . . . . . . . . . . . . . . . . .
37
Father and Son . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
The Six Matches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
No Change Please! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
A Date to Reckon With . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
Gold for All Occasions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
The Ink-Spot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
Spade for a Heart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
The Number Puzzle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
A Problem of Coins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
8
The Squirrel and the Post . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
Hearts Apart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
The Curfew . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
A Problem of Age . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
39
The Passenger Train and the Goods Train . . . . . . . . . . . . . . . . . . .
39
The Circular Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
40
Rice for the Festival . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
40
Threes to Make Thirty-one . . . . . . . . . . . . . . . . . . . . . . . . . . . .
41
Swarm of Bees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
41
Story of the Three Farmers . . . . . . . . . . . . . . . . . . . . . . . . . . . .
41
What Were You Doing When the Lights Went Out? . . . . . . . . . . . . . .
42
Staff and the Steeple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
42
The Dotted Square . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
42
Up the Stream – Down the Stream . . . . . . . . . . . . . . . . . . . . . . .
43
Wine and Water
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
43
The Long Tunnel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
44
The Horse, the Cow and the Sheep . . . . . . . . . . . . . . . . . . . . . . .
44
The Two Mathematical Men . . . . . . . . . . . . . . . . . . . . . . . . . . .
45
A Question of Mileage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
45
How Much? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
45
The Bargain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
46
Sections of a Necklace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
46
Age of Demochares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
46
9
The Painted Cube
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
46
Smoking Not Prohibited . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
47
Mathematical Taxi Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . .
47
The Tennis Tournament . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
47
Dividing the Load Equally . . . . . . . . . . . . . . . . . . . . . . . . . . . .
48
Longfellow and His Bees . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
48
Mr. Portchester’s Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . .
48
Driving Through the Country . . . . . . . . . . . . . . . . . . . . . . . . . .
49
Dots and Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
49
The Triangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
49
The Puzzled Artist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
50
The Mystery of Number Eleven . . . . . . . . . . . . . . . . . . . . . . . . .
50
The Rose Garden . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
50
Squares Within Square . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
51
The Farmer and the Animals
. . . . . . . . . . . . . . . . . . . . . . . . . .
51
The House Where She Lives . . . . . . . . . . . . . . . . . . . . . . . . . . .
51
The Mango Thieves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
51
A Matter of Rupees and Paise . . . . . . . . . . . . . . . . . . . . . . . . . .
52
Sawing the Cube . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
53
The Two Trains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
53
The Arithmetical Landlady . . . . . . . . . . . . . . . . . . . . . . . . . . .
54
10
Tall Men Next Door
Let the heights of the men be given by a, b, c, and d, where a ≤ b ≤ c ≤ d. Then the
statement about the average is expressed as
1
(a + b + c + d) = 74 .
4
(1)
The statements about the differences in height are expressed as
bв€’a= 2
cв€’b=2
dв€’c = 6.
From these we see that
b= 2+a
c = 2+b=4+a
d = 6 + c = 10 + a .
Putting each of these expressions into Equation 1 gives one equation for a of
1
(a + 2 + a + 4 + a + 10 + a) = 74 .
4
This gives a = 70. From that we compute that b = 72, c = 74, and d = 80.
Brothers and Sisters
Let b be the number of boys and g the number of girls in the family. Then a given boy will
have g sisters and b в€’ 1 brothers. A given girl will have b brothers and g в€’ 1 sisters. We are
told that for boys
g = b в€’1,
and for girls
b = 2(g в€’ 1) .
Putting the first equation into the second we get
b = 2(b в€’ 1 в€’ 1) .
Solving this for b gives b = 4, so that g = 3, giving a total of g + b = 7 children.
Over the Golden Gate
Recall that the average speed is defined as the distance traveled over the time to travel that
distance. If we let L be the length of the Golden Gate bridge (in miles) then the total
11
distance traveled is 2L. The time (in hours) it took to travel this distance is the time it took
to travel each leg (across and back) and is given by
L
13
L
+
=
L.
40 25
200
The average speed is then
2L
13
L
200
=
400
= 30.76923 ,
13
in miles per hour.
The Digits and Square Numbers
In the python code digits and square numbers.py we explicitly enumerate all of the possible integers using the digits 1-9 (in any order that are perfect squares). We get 30 possible
choices. Some sample values are given by
..., 597362481, 615387249, 627953481, 653927184, ...
The smallest of all possible choices is 139854276 and the largest is 923187456.
Bicycle Thieves
We can think of how to solve this problem by considering the various transactions. When
the bicycle owner gives the cheques to his neighbor he gets +400 to which he has to pay 50 to
the tourist leaving him with 350. When the cheques are found to be bad he has to payback
the neighbor all 400 so using the 350 profit from the bicycle sale he has to come up with an
additional 50 and thus he is at a loss of 50. This has to be coupled with the fact that the
bicycle shop owner now no longer has the bike valued at 300 bringing his total losses to 350.
The Bus Number
To start we note that no single digit number is both a perfect square and a square when
flipped and thus we need to consider two and three digit bus numbers. In the python code
bus number.py we explicitly enumerate all of the possible two and three digit numbers that
include the integers {0, 1, 6, 8, 9} (which become valid integers when “flipped”). From these
we look for the ones that are a perfect squares both directly and when flipped. Note the
problem states that the bus number is a perfect square when the plate was “turned upside
down”. A better description of that procedure would be when the license plate is rotated
180 degrees. Thus the digits after flipping up-down must be followed by reversing the order
of the digits. Running this code gives the following
12
Looking
Looking
Was the
Was the
for
for
bus
bus
a bus number
a bus number
number= 196
number= 961
with
with
961
196
2 digits...
3 digits...
This indicates that now two digit numbers had the required property while only one three
digit number did 196.
The Hour Hand and the Minute Hand
At midnight both hands of the clock point upwards (towards the 12). The minute hand
rotates at one cycle per hour or 2ПЂ radians per hour. Thus the angular location of the
minute hand as a function of time is given by
Оёminute hand = 2ПЂThours .
Here Thours is the time from midnight measured in hours. The hour hand rotates one cycle
in 12 hours so its angular location is given by
Оёhour hand = 2ПЂ
Thours
12
.
We want to know when the two hands are pointing in opposite directions. This will happen
when
Оёminute hand в€’ Оёhour hand = ПЂ(2k в€’ 1) for k = 1, 2, . . . , 11, 12 .
Here
• k = 1 means that the hour hand is between midnight (hour 0) and 1 A.M.
• k = 2 means that the hour hand is between and 1 A.M. and 2 A.M.
• etc.
• k = 11 means that the hour hand is between 10 A.M. and 11 A.M.
• k = 12 means that the hour hand is between 11 A.M. and 12 P.M.
Putting in the expressions for Оёminute hand and Оёhour hand we get
2ПЂThours в€’ 2ПЂ
Thours
12
We can simplify this to get
Thours =
= ПЂ(2k в€’ 1) .
6
(2k в€’ 1) ,
11
13
the times in hours from midnight when the two hands point in opposite directions. Using
this the location of the minute hand and hour hand (in radians) is then given by
Оёminute hand = 2ПЂ
6
11
(2k в€’ 1) =
12
ПЂ(2k в€’ 1)
11
1
ПЂ(2k в€’ 1) .
11
To convert these to the units of minute from the units of radians we recall that there are 60
minutes in 2ПЂ radians thus
30
Оёhour hand = (2k в€’ 1) .
11
Оёhour hand =
To Catch a Thief
The statement “he takes eight steps to every five of mine” means that in one unit of time
the thief takes eight steps while the police officer takes five steps. If we let st and sp be the
step length (distance traveled in one step) for the thief and the police officer respectively
then in one unit of time they have traveled 8st and 5sp . The statement “two steps of mine
are equal to his five” means that
2sp = 5st .
As the thief started 27 steps ahead of the officer his position as a function of time T is given
by
27st + 8st T .
The position of the police officer as a function of units of time is given by
5sp T .
The officer will be at the same location (and thus catch the thief) when these two expressions
are equal or
27st + 8st T = 5sp T .
Since we know that sp = 25 st we can put this into the above to get
25
st T .
2
Dividing by st and solving for T gives T = 6 units of time which is 5 Г— 6 = 30 steps of the
officer and the thief took 8 Г— 6 = 48 steps.
27st + 8st T =
The Gong
The problem statement means that the chime of the clock has its first strike when the minute
hand hits 12 and then rings six more times (for a total of seven chimes) in seven seconds.
This means that the time between each gong chime is 67 seconds. The time needed to chime
ten times total would be nine times this number or 9(7)
= 21
seconds. This is because the
6
2
first chime starts when the minute hand is at the 12 and we need nine more chimes to make
ten total chimes each one taking 67 seconds.
14
Something for the Marmalade
Assume that we start with x oranges then we sell half this amount plus half an orange to
the first customer or
1
1
c1 = x + ,
2
2
leaving us with
1
1
x в€’ c1 = x в€’ ,
2
2
for the next customer. We sell
c2 =
1
2
1
1
xв€’
2
2
+
1
1
1
= x+ ,
2
4
4
to the second customer leaving us with
1
1
3
1
x в€’ в€’ c2 = x в€’ .
2
2
4
4
To the third customer we sell half of this amount plus half an orange or
c3 =
1
2
1
3
xв€’
4
4
+
1
,
2
leaving us with none. This means that what we are left with after this sale equals zero or
3
1
x в€’ в€’ c3 = 0 or
4
4
1
3
1
x в€’ = c3 =
4
4
2
1
3
xв€’
4
4
+
1
.
2
This last equation can be solved for x to give x = 7. Thus we started with seven oranges.
The Counterfeit Note
As the note turns out to be invalid all transactions would be “canceled”, i.e. when the
narrator finds that the note is counterfeit he would still demand payment from the woman,
who would then demand payment from the tailor and so on up the chain until we get to the
plumber who would demand another payment from the narrator. This is the same situation
as we started with (before the note was found) and thus there is no value created or lost by
its presence.
Nuts for the Nuts
Removing the 230 peanuts leaves 1000в€’230 = 770 peanuts to split among the three children.
Let the ages of the children be denoted T , R, and J to symbolize their names. Then we are
told that
35
T + R + J = 17.5 =
.
2
15
according to how the nuts are to be distributed we have that Tinku should get
T
T
=
,
T +R+J
17.5
of the 770 and Rinku should get
R
R
=
,
T +R+J
17.5
of the 770 and Jojo should get
J
J
=
,
T +R+J
17.5
of the 770. If we take the number of nuts that Tinku should get and divide it by four this
must equal the number of nuts that Rinku should get divided by three or
T
1
(770)
=
17.5
4
R
(770)
17.5
1
.
3
If we take the number of nuts that Tinku should get and divide it by six this must equal the
number of nuts that Jojo should get divided by seven or
T
1
(770)
=
17.5
6
J
(770)
17.5
1
.
7
These two equations simplify to
T
R
=
4
3
and
T
J
= .
6
7
Since the sum of the ages is 17.5 if we write all ages in terms of Tinku’s age we get
7
3
T + T + T = 17.5 .
4
6
Solving this for T we find T = 6. Then we have
18
9
3
= ,
R= T =
4
4
2
and
7
J = T = 7.
6
We can now answer the question about how many nuts did each child get. We compute
For Tinku:
For Rinku:
For Jojo:
T
(770) =
17.5
R
(770) =
17.5
J
(770) =
17.5
16
6
(770) = 264
17.5
9/2
(770) = 198
17.5
7
(770) = 308 .
17.5
The Wedding Anniversary
Let M and J be the ages of Mohini and Jayant on their wedding. From the problem we
know that on their wedding M = 43 J. Now 12 years later we have that
5
M + 12 = (J + 12) .
6
Solving these two equations for M and J gives J = 24 and M = 18.
I’ll Get it for you Wholesale
This problem has the flavor of a problem from “Project Euler”. While there maybe ways
to solve this problem “by hand” it is also helpful to be able to automate a solution using a
computer. The approach I took is to greedily add a single coin at a time until all the coins
we have can represent all of the coin values from 1 to 120. At each step, we add the coin that
gives the greatest increase in number of coin sums that we can obtain with the set of coins.
I implemented this in the python code get it wholesale.py. When we run that code we
get the following output
1:
1:
1:
1:
1:
1:
1:
1
1
1
1
1
1
1
; 1
2: 1
2: 1
2: 1
2: 1
2: 1
2: 1
; 3
4: 1
4: 1
4: 1
4: 1
4: 1
; 7
8: 1
8: 1
8: 1
8: 1
; 15
16: 1 ; 31
16: 1 32: 1 ; 63
16: 1 32: 1 57: 1 ; 120
The output is in the form of “X: Y” where X is the coin denomination and Y then the
number of coins to have of that denomination at each iteration. This output shows that we
should first add a coin with value 1 (which can form only one sum), next we add the coin
value of 2 (and then can form sums of 1, 2, 3), next we add the coin value of four (and can
get sums of seven numbers), next we add the coin with a value of 8 (and can get sums of 15
numbers), etc until we end up with the set of coins (one each)
1, 2, 3, 4, 16, 32, 57 .
This is seven coins. These coins will enable us to make change for every amount from 1в€’120.
This is a different result than in the back of the book. From numbers in the back of the
book I don’t see how one could get a weight of 6 along with other weights. A careful reading
of the problem statement might allow the sum to be within one from the target value (the
statement “to the nearest pound”) but I still don’t see how to get a sum of six. Changes
could be made to the program to incorporate logic like “to the nearest pound” if desired.
17
The Broken Glasses
Let g be the number of glasses unbroken and b be the number of glasses broken. Then we
know that since we started with 100 glasses that we must have
100 = g + b ,
and that from how much was paid that
3g в€’ 9b = 240 .
Solving these two equations gives b = 5 and g = 95.
The Peculiar Number
Lets start by assuming that our number is one digit say d1 . Then to be our special number
we would have to have d1 = 3d1 which implies that d1 = 0. Thus our number cannot be one
digit. Next assume our number is a two digit number i.e. of the form d1 d2 . Then we must
have
3(d1 + d2 ) = d1 10 + d2 .
This means that
2d2 = 7d1 .
If we take d1 = 2 and d2 = 7 the above is true. Thus one number with this property is 27.
Make a Century
This problem has the flavor of a problem from “Project Euler”. While there maybe ways
to solve this problem “by hand” it is also helpful to be able to automate a solution using
a computer. The approach I took was to simply enumerate all possible fractions of the
suggested type and then see which ones evaluated to 100. This is implemented in the python
code make a century.py. When we run that code we get the following output
1
2
3
4
5
6
7
8
9
10
1
fractions
fractions
fractions
fractions
fractions
fractions
fractions
fractions
fractions
fractions
fractions
found
found
found
found
found
found
found
found
found
found
found
with
with
with
with
with
with
with
with
with
with
with
2
2
2
2
2
2
2
2
2
2
1
initial
initial
initial
initial
initial
initial
initial
initial
initial
initial
initial
digits:
digits:
digits:
digits:
digits:
digits:
digits:
digits:
digits:
digits:
digits:
18
91 5742/638
91 5823/647
91 7524/836
94 1578/263
96 1428/357
96 1752/438
96 2148/537
81 5643/297
81 7524/396
82 3546/197
3 69258/714
The Perplexed Postal Clerk
Let n be the number of 2 paisa stamps we would hand over. Then 6n is the number of 1
paisa stamps we would hand over. Next let m be the number of 5 paisa stamps we would
hand over. Then we must have the total cost of all stamps bought equal to 75 paisa or
75 = 2n + 6n + 5m or 75 = 8n + 5m .
The solution to the above equation with both n and m positive integers where n is as large as
possible will be when n = 5 so that 8n = 40 and to satisfy the above we must have 35 = 5m
or m = 7. Thus in summary we should sell 5 two paisa stamps, 30 one paisa stamps, and 7
five paisa stamps.
The Mystery of the Missing Paisa
The 30 “three for one” marbles should bring 10 Paise when all sold, while the 30 “two for one”
marbles should bring 15 Paise when all sold. Thus the total value of these 60 marbles when
25
5
combined should be 25 Paise, which means that each marble should cost 60
= 12
= 0.416666
of a Paise. If we sell all 60 marbles at this price we will indeed get 25 Paise (as the two
women expected). If in fact we sell them at the price suggested “five marbles for two Paise”
5
they are selling them “too cheap”. The difference in price (per
or 52 = 0.4 since 25 < 12
marble)
5
2
1
в€’ =
,
12 5
60
is where the missing Paise can be found. This is because when we sell 60 marbles the loss
1
= 1.
to selling them too cheaply is given by 60 60
Walking back to Happiness
Since the man walking saved ten minutes from the total trip time, the point at which the
women meets him must have been five minutes from HS. This is because (by the man walking)
she avoided having to go from the meeting point to HS and from HS back to the meeting
point (which would have taken ten minutes to do). Thus she only needed five more minutes
to get to HS where she would have arrived at 6 P.M. like normal and so she meet him at 5:55
P.M. Since the man began walking at 5 P.M. he must have been walking for 55 minutes.
On the Line
At each station a person must be able to buy tickets for travel from that station to any of
the other 24 stations. Since there are 25 total stations there must be 25(24) = 600 total
tickets of different types.
19
The Legacy
Let m be the amount the mother (our Aunt) receives, d be the amount each daughter should
receive, and s the amount that each son should receive. Then from the problem statement
we have that
d = 2m
s = 3d = 6m .
Let nd be the number of daughters and ns be the number of sons that exist in this family.
Then the will states that
1920000 = m + nd (2m) + ns (6m) = m(1 + 2nd + 6ns ) .
As we are not told values for nd and ns there should be multiple solutions. If we assume
that nd and ns must be such that all numbers are integers (i.e. m is an integer) then both
(nd , ns ) = (4, 1) and (nd , ns ) = (1, 4) have m = 128000. If we assume that nd = ns = 1 then
we would find m = 213333.33, which does not match the answer in the back of the book.
Down the Escalator
Let w be the velocity of the escalator in steps per second. Then from the problem statement
we are told that
30w + 26 = L
18w + 34 = L ,
where L is the length of the escalator in steps. Solving the above two equations gives w = 32 .
Putting this back into either of the two equations above gives L = 46 steps for the total
length.
The Chess Board
This is an impossible task. To show that it is impossible we will assume it is possible to
cover the cornerless board with 31 tiles and show that this leads to a contradiction. To do
this first note that whatever color the leftmost corner of the board is the rightmost corner is
the same color. For ease of explanation lets assume that it is black. Since we are assuming
that we can cover the board with 31 tiles consider the state of the board before we place
the last tile. In that case we will have placed 30 tiles and as each individual tile is of length
two it must cover both a black square and a white square. Thus with these 30 tiles we have
covered 30 black squares and 30 white squares total. Since the two corner squares are black
(and we are not covering them) we have yet to cover two white squares with the last tile.
This is impossible since no matter how we place the 31st tile it will cover one black and
one white square and never be able to cover two squares of the same color. Thus it is not
possible to perform the covering suggested.
20
A Game of Cats and Mice
Let c be the number of cats and let mi be the number of mice killed by the ith cat killed.
Then we are told that
c
mi = 999919 .
i=1
Now each mi is the same so the above becomes mc = 99919, thus m and c are factors of
99919, where we are also told that c = 1 and c = 999919. Using the UNIX factor command
to get the prime factors of this number we get
$ factor 999919
999919: 991 1009
Since we are also told that m > c i.e. each cat killed more mice than there were cats we
have m = 1009 and c = 991.
The Wheels
From the problem statement we can conclude that
96
96
в€’4 =
Cf
Ch
96
96
в€’4 = 4
.
3
C
C
f
h
2
3
(2)
(3)
Where Cf and Ch are the circumference of the fore and hind wheel (in feet) respectively. We
can solve Equation 2 for C96f and put this expression into Equation 3 where we get
2
3
96
3
+4 в€’2 =
Ch
4
96
Ch
.
Solving the above for Ch gives Ch = 12. Putting this value into Equation 2 and solving for
Cf gives Cf = 8.
Blow How Blow Cold
From the given two points or by remembering the formula for Fahrenheit to Celsius temperature conversion we have that
9
F = C + 32 .
5
If we look for the value where F = C then we need to solve C = 95 C + 32 for C. We find
C = в€’40.
21
4
3
y
2
1
0
0
1
2
3
4
x
Figure 1: The painted area (in gray) for the painted window problem.
The Llama Race
If we let the time taken to run each of the quarter miles (in minutes) be given by T1 , T2 , T3 ,
and T4 . Then from the problem statement we have that
T1 + T2 + T3 = 6.75
T1 + T2 = T3 + T4
T3 = T4 .
(4)
(5)
(6)
We want to know the value of T1 + T2 + T3 + T4 . Putting Equation 6 into 5 we get
T1 + T2 = T3 + T3 = 2T3 .
If we put this into Equation 4 we get
3T3 = 6.75 so T3 = 2.25 .
Our desired output is then
(T1 + T2 + T3 ) + T4 = 6.75 + 2.25 = 9 ,
minutes to run the whole mile.
The Painted Window
If the window is painted like shown in Figure 1 then the distance between the top and bottom
of the unpainted window is four feet and the distance between the left and right side of the
22
unpainted window is also four feet. Note that the painted area is
4
1
(2)(2)
2
= 8,
which is one-half of the area of the original window of 42 = 16 as required.
Animals on the Farm
To start let n be the number of animals in each of the five droves of animals, and let nd,cow ,
nd,sheep , and nd,pig be the number of cows, sheep, and pigs respectively that each of the eight
dealers d = 1, 2, . . . , 7, 8 bought. Then we are told that we sold all of our animals or
8
8
8
nd,pig ,
nd,sheep +
nd,cow +
5n =
(7)
d=1
d=1
d=1
and how much money we made for the sale
Now we can use Equation 7 to solve for
tion 8. When we do that we get
8
d=1
8
d=1
8
d=1
nd,sheep +
8
nd,cow + 2 5n в€’
(8)
d=1
d=1
d=1
nd,pig .
nd,sheep + 2
nd,cow + 2
285 = 17
285 = 17
8
8
8
nd,pig and put that into Equa8
nd,cow
= 15
d=1
nd,cow + 10n .
(9)
d=1
Thus solving for the sum of the total number of cows we get
8
nd,cow =
d=1
285 в€’ 10n
.
15
(10)
We don’t know the value of n but we know that n ≥ 1 and it must be a number such that the
numerator in the above fraction is divisible by 15. The largest possible value that n could
be would be when 8d=1 nd,cow = 0 since if n were larger then by Equation 9 this sum would
have to be negative. This means we only need to consider n in the range 1 ≤ n ≤ ⌊ 285
вЊ‹ = 28.
10
8
8
8
We can print the values of n, d=1 nd,cow and d=1 nd,sheep + d=1 nd,pig with the simple
python code
for n in range(1,28+1):
if ( 285 - 10*n ) % 15 == 0 :
print "n= %5d, sum_cows= %4d, sum_sheep + sum_pig= %4d" % (n, (285 - 10*n)/15, 5*n - (285 - 10*n)/15)
Which gives us
23
n=
n=
n=
n=
n=
n=
n=
n=
n=
3,
6,
9,
12,
15,
18,
21,
24,
27,
sum_cows=
sum_cows=
sum_cows=
sum_cows=
sum_cows=
sum_cows=
sum_cows=
sum_cows=
sum_cows=
17,
15,
13,
11,
9,
7,
5,
3,
1,
sum_sheep
sum_sheep
sum_sheep
sum_sheep
sum_sheep
sum_sheep
sum_sheep
sum_sheep
sum_sheep
+
+
+
+
+
+
+
+
+
sum_pig=
sum_pig=
sum_pig=
sum_pig=
sum_pig=
sum_pig=
sum_pig=
sum_pig=
sum_pig=
-2
15
32
49
66
83
100
117
134
Each of these (except the first) is a possible solution. To find which one is correct recall that
the number of animal bought by each dealer was the same. We can use this information to
write Equation 7 by summing over the animals bought by each dealer as as
5n =
n1,x +
xв€€{cow,sheep,pig}
xв€€{cow,sheep,pig}
n2,x + В· В· В· +
n8,x
xв€€{cow,sheep,pig}
= 8m ,
where m is the number of animals bought by each dealer. Thus 5n must be divisible by eight.
The only value of n where that is true is when n = 24 so m = 15. Summarizing everything
thus far we have that the total number of animals that we had in all was 5(24) = 120 and
from the python output that the total number of cows was three, and that a constraint on
the total number of sheep and pigs to be that they sum to 117.
Which is the Better Bargain?
From the problem statement the first frock is worth 87 (35) = 40, while the second frock is
worth 76 (30) = 35. The percent gain we make by buying the first and second frock is then
given by
1
40 в€’ 35
= = 0.1428
35
7
35 в€’ 30
1
= = 0.1666 .
30
6
The better buy is the second frock by
1
6
в€’
1
7
= 0.0238 or almost 2.4%.
Walking all the Way
Let the distance I walked from Bangalore be given by Lm (m for “me”) and the distance my
friend walked from Tumkur as Lf . Let the velocity that I and my friend walked be given by
vm and vf . Then at the point we meet each other I have walked four hours and five minutes
and my friend has walked two hours and five minutes (since we meet at 4 : 05 P.M.) and
24
thus we have
5
60
5
.
2
60
Lm = vm 4
(11)
Lf = vf
(12)
Now let T be the remaining amount of time each person walks till they reach their final
destination (we are told that this is the same for each person). Then in that time I have to
walk Lf and my friend has to walk Lm to get to their destinations. This means that we have
Lm = vf T
Lf = vm T .
(13)
(14)
If we equate the Equation groups 11 13 and 12 14 we get
5
1
= vf T so vf =
60
T
5
2
= vm T .
60
Lm = vm 4
Lf = vf
4
5
vm
60
Putting the expression for vf in the top equation into the bottom equation we get
4
5
60
2
5
60
vm = vm T 2
so T =
175
.
60
This is two hours and 55 minutes. As T is measured from the meeting time 4:05 they both
arrive at their destinations at 7 P.M.
Something for Profit
Consider the sequence of dollar amounts in and out during all of the transactions. For
example, when we first buy we are down в€’60, when we first sell we get +70 etc. This
sequence is
в€’60 + 70 в€’ 80 + 90 = 20 ,
i.e. a net profit of 20.
The Digital Game
Let the two digit number have the first digit d1 and the second digit d2 so the number will
be d1 d2 . We are told that d2 = d1 в€’ 4. Thus the possible number to consider must be one
of the following
40, 51, 62, 73, 84, 95 .
When we sum the digits in the numbers above and divide each number by that sum we see
that the number 84 divided by 12 is 7 as required. Thus the number we are looking for is
84.
25
The Faulty Machine
Assume that F is the weight of a correctly manufactured flywheel. As our first measurement
we first take one flywheel from each machine and weight all ten of them together. From this
total we subtract 10F . This difference will give the amount ∆ by which one of the machines
is making the part too heavy (∆ > 0) or too light (∆ < 0). Next we can take one flywheel
from machine one, two from machine two, three from machine three etc. up to ten flywheels
from machine ten. We take all of these flywheels and weight them once. Then all of these
should weight
F + 2F + 3F + В· В· В· + 9F + 10F = 55F .
To the weight we actually get when we weight them we subtract 55F and divide by the ∆
obtained before. The number we get tells us the machine that is making the faulty parts.
The Number and the Square
See the python code the number and the square.py where we explicitly enumerate over all
possible three digit numbers we could have have for the first, second, and third row. When
we run that code we get the values
192
219
273
327
384
438
546
654
576
657
819
981
The first, second, and third columns are the three digit number in the first row, second, and
third rows respectively. All four of these triples of numbers satisfy the requirements of the
problem.
Squares and Right Angles
We can produced the required diagram by drawing a tilted square in a square just as in
Figure 1 where we draw the outer square with four lines and then the inner square in an
additional four lines. These eight lines give the desired number of squares and triangles.
The Dishonest Merchant
Let n32 and n40 be the number of kilos of the coffee that cost 32 and 40 rupee per kilo that
we bought. Then we paid
32n32 + 40n40 ,
26
for the coffee that we sold. Since we bought a total of 100 kilos we have n32 + n40 = 100 and
the profit on selling this 100 kilos was 25% more than we paid or
43(100) = 1.25(32n32 + 40n40 ) .
Thus we have two equations and two unknowns which we can solve to find n32 = 70 and
n40 = 30.
For the Charities
Let p be the amount of money in the purse originally. Then after the boys we have
pв€’
1
p+1
2
1
= pв€’ 1,
2
in our purse. After the women we have
1
1
pв€’1в€’
2
2
1
1
5
pв€’1 +2 = pв€’ ,
2
4
2
in our purse. After the religious group I have
5
1
1
pв€’ в€’
4
2
2
1
5
pв€’
4
2
1
17
+3 = pв€’
,
8
4
in our purse. Since this must be equal to one we can solve for p to find p = 42 rupee when I
started.
The Number Game
If we let x be the first number the the problem statement means that
x(x + 1)(x + 2) x(x + 1)(x + 2) x(x + 1)(x + 2)
+
+
= 74 .
x
x+1
x+2
We can simplify the left-hand-side to get
(x + 1)(x + 2) + x(x + 2) + x(x + 1) = 3x2 + 6x .
Thus we get the quadratic equation
3x2 + 6x в€’ 72 = 0 .
This has two roots x = в€’6 and x = 4, so the three numbers that work are (в€’6, в€’5, в€’4) and
(4, 5, 6).
27
The Sari and the Blouse
Let s and b be the cost of the sari and the blouse respectively. Then we have that
s + b = 110 and s = b + 100 .
Putting this second equation in the first gives 2b + 100 = 110 so b = 5. Using this we have
that s = 105.
The Weight of the Block
From the problem if B is the weight of the block then we must have
B=
3 3
+ B
4 4
or B = 3 .
Lucrative Business
We would compute
(1 + 0.5)18/3 2000 = 22781.25 .
The Three Containers
This is a type of problem that can be formulated as a “search” problem. See [1] for a description of these types of problems and how to solve them. I implemented a graph searching algorithm following the above reference in the python code the three containers.py.
When we run that code we get the following output
state=
state=
state=
state=
state=
state=
state=
state=
state=
state=
state=
state=
state=
state=
(0, 13,
(13, 0,
(19, 0,
(6, 13,
(6, 7,
(13, 7,
(7, 13,
(19, 1,
(12, 1,
(12, 8,
(5, 8,
(5, 13,
(18, 0,
(18, 2,
7);
7);
1);
1);
7);
0);
0);
0);
7);
0);
7);
2);
2);
0);
from
from
from
from
from
from
from
from
from
from
from
from
from
from
1
2
0
1
2
0
1
0
2
0
2
1
2
0
pour
pour
pour
pour
pour
pour
pour
pour
pour
pour
pour
pour
pour
pour
13
6
13
6
7
6
12
7
7
7
5
13
2
7
into
into
into
into
into
into
into
into
into
into
into
into
into
into
28
0
0
1
2
0
1
0
2
1
2
1
0
1
2
to
to
to
to
to
to
to
to
to
to
to
to
to
to
get
get
get
get
get
get
get
get
get
get
get
get
get
get
state=
state=
state=
state=
state=
state=
state=
state=
state=
state=
state=
state=
state=
state=
(13, 0,
(19, 0,
(6, 13,
(6, 7,
(13, 7,
(7, 13,
(19, 1,
(12, 1,
(12, 8,
(5, 8,
(5, 13,
(18, 0,
(18, 2,
(11, 2,
7)
1)
1)
7)
0)
0)
0)
7)
0)
7)
2)
2)
0)
7)
state=
state=
state=
state=
state=
state=
(11, 2,
(11, 9,
(4, 9,
(4, 13,
(17, 0,
(17, 3,
7);
0);
7);
3);
3);
0);
from
from
from
from
from
from
2
0
2
1
2
0
pour 7 into
pour 7 into
pour 4 into
pour 13 into
pour 3 into
pour 7 into
1
2
1
0
1
2
to
to
to
to
to
to
get
get
get
get
get
get
state=
state=
state=
state=
state=
state=
(11, 9,
(4, 9,
(4, 13,
(17, 0,
(17, 3,
(10, 3,
0)
7)
3)
3)
0)
7)
While this solution seems less efficient than the one that Shakuntala produces one could
argue that it would be quite tedious to construct a solution to this problem by hand. The
above code will solve it for you.
On the Way to Market
If the other people were leaving the market then there is only one person going to the market.
A Matter of Denomination
n
. If we add six to the
From the given statements our fraction would have the form n+6
n
1
denominator we would get the fraction n+14 if this is to equal 3 then we have
1
n
= ,
n + 14
3
so solving for n we get n = 7. Thus the original fraction is
7
.
13
A Problem of Socks
If we draw two socks we might find that we have two different colors. In that case, if we
draw a third sock it must match one of the two colors from the ones that we have already
drawn. Thus we must draw three socks to be sure we have a matching pair.
A Fair Division
It will help to understand what to do after Rekha dies to understand what was to be done
in the situation where she does not die. In that case since the fractions given don’t sum to
one we would need to compute
1 1 1
47
+ + =
,
3 4 5
60
29
and so the will would then specify that we give the fraction
1/3
20
=
to Rashmi
47/60
47
15
1/4
=
to Mala
47/60
47
12
1/5
=
to Rekha ,
47/60
47
of the 100 acres to each daughter. If Rekha dies we would then compute
7
1 1
+ =
,
3 4
12
and so the fractions of the 100 acres would now be specified as
1/3
4
=
to Rashmi
7/12
7
1/4
3
=
to Mala .
7/12
7
Mathematics and Literature
This problem can readily be solved by considering properties of sets. If we let M represent
the “event” that a person has some training in mathematics and L the event that a person
has some training in literature then we are told that
N (M ′ ∩ L′ ) = 10 ,
where N represents the operator denoting how many are in the event that follows. Here M ′
and L′ are the events that a person does not have training in mathematics and literature
respectively. We are also told that
N (M) = 70
N (L) = 82 .
Then since by De Morgan’s Laws we can write M ′ ∩ L′ = (M ∪ L)′ we have that
N (M ∪ L) = 100 − N (M ′ ∩ L′ ) = 90 .
Putting what we know into the set identity
N (M ∪ L) = N (M) + N (L) − N (M ∩ L) ,
gives 90 = 70 + 82 − N (M ∩ L) so N (M ∩ L) = 62.
30
Heads I Win Tails I Loose
Assume at the timestep n the gambler has Vn money in his pocket. Then if he looses a bet
the money in his pocket will go to
1
2
Vn+1 =
Vn .
If he wins the bet the money in his pocket goes to
Vn+1 =
1+
1
2
3
2
Vn =
Vn .
Iterating the above difference equations back to the start of the betting (when the gambler
had V0 money in his pocket) since we know that we must play an even number of games (say
2m) and we have an equal number of wins and losses we get
V2m =
m
1
2
m
3
2
V0 .
The first fraction in the product on the right-hand-side of the above represents the gamblers
losses while the second fraction represents his wins. Since the above is equal to
3
4
V2m =
and
3
4
m
V0 ,
< 1 the gambler will suffer a net loss i.e. V2m < V0 .
A Problem from Lilavati
By following the statements given in the problem when operated on the unknown number x
we would arrive at the following equation
1в€’
1
3
1
7
1+
3
4
10
(3x)
2
в€’ 52 + 8
= 2.
Solving the above for x gives x = 28.
Up the Ladder
The description of the ladder is that it is the hypotenuse of a right triangle with legs of
lengths 40 and 9. Thus by the Pythagorean theorem we have that the length of the ladder
L needs to be
в€љ
L = 92 + 402 = 41 ,
feet long.
31
Pigs and Ducks
Let p and d be the number of pigs and ducks respectively. Then we are told that
2p + 2d = 60 for the count of eyes
4p + 2d = 86 for the count of feet .
Solving these two equations gives p = 13 and d = 17.
The Egg Vendor and His Eggs
Let x be the number of eggs that Rasool had. From the problem statement we know that
50 ≤ x ≤ 100 and that
x mod 2 = 0
x mod 3 = 0
x mod 5 = 3 .
From this information we can set up a simple python loop to look for the numbers that
satisfy all the above conditions
for ne in range(50,100+1):
if ( ne % 2 == 0 ) and ( ne % 3 == 0 ) and ( ne % 5 == 3 ) : print ne
This loop gives 78 for the number of eggs. If the eggs are worth 50 paise each then Rasool
would have been paid 78(0.5) = 39 rupee.
Some Luck!
Let x be the value of a sheep. Then the money that Radha makes when she sells her sheep
will be 20x. Since this is “too low” by the amount of 150 we must add this amount to her
20x to get an amount of money worth half of the total sale which is 50x or
20x + 150 =
50
x = 25x .
2
Thus 5x = 150 so x = 30.
The Trains and the Falcon
The falcon will fly back and forth until until the two trains collide. Since the two trains start
50 miles apart and are each traveling at 25 miles per hour they are approaching each other
at 25 + 25 = 50 miles per hour. Thus the trains will collide in exactly one hour. All of this
time the falcon is flying at 100 miles per hour. Thus the falcon will fly for 100 miles.
32
First 1/2 Second 1/2 Year Total Cumulative Total
1000
1000
2000
2000
1150
1150
2300
4300
1300
1300
2600
6900
1450
1450
2900
9800
Table 1: The payments received in the 300 rupee per year case
First 1/2 Second 1/2 Year Total Cumulative Total
1000
1100
2100
2100
1200
1300
2500
4600
1400
1500
2900
7500
1600
1700
3300
10800
Table 2: The payments received in the 200 rupee per year case
Which is more Lucrative?
In the 300 rupee per year case we have to work an entire year and then we get the raise
which is distributed in 150 rupee each half-year. We evaluate the payments received under
this option in Table 1. In the 200 rupee per year case once we have worked half a year we
get the 100 rupee raise applied to the next half-year. We evaluate the payments received
under this option in Table 2. We see that the total payments are larger in the 200 rupee a
year (payed each 1/2 year) case.
Little Mammu and the Marbles
Let m and n be the number of marbles that Mammu and Nawal initially have. Then we are
told that
nв€’1 =m+1
2(m в€’ 1) = n + 1 .
Solving the above we find m = 5 and n = 7.
The Curious License Plate
Rather than perform this search by hand I coded it up in the curious license plate.py.
When we run that script we print our license plate and its “flipped” representation, which
we find to be
10968 89601
33
Lose or Gain
Let x and y be the prices paid for each lathe. Then we know that
0.8x = 600 so x = 750 ,
and
1.2y = 600 so y = 500 .
Then on the total sale of both lathes we made
(в€’750 + 600) + (в€’500 + 600) = в€’150 + 100 = в€’50 ,
for a net loss.
A Problem of Combination
Consider the “worst case” when drawing the marbles. If we draw two marbles then they can
certainly differ in color. If we draw a third we could have drawn three marbles of different
colors. When we draw the fourth marble however there is no way to not draw a marble with
a color equal to that of one of the already drawn marbles. Thus four is the number.
The Special Number
We are told that our number x is such that
1
2x в€’ x = 45 .
2
Solving for x we have that x = 30.
Sawing the Tree Trunk
To make twelve pieces we need eleven cuts. Thus it should take eleven minutes.
The Bigamist
If the trains were running in such a way that they arrived very close together in time say
one after the other by only a few minutes. In that case only in the rare case when he arrived
at the station during a time between the two trains would he take the one that came shortly
after the first one. Most of the time he would take the first train.
34
The Split
Let the two parts be denoted as p1 and p2 . Then we have
p1 + p2 = 34 and
From the second relationship we have p1 =
7
p.
10 2
2
4
p1 = p2 .
7
5
Putting this into to the first equation gives
7
p2 + p2 = 34 .
10
Solving for p2 we get p2 = 20 which then gives p1 = 14.
At the Fete
From the problem statement we have that
5 writer = 4 doctor
12 doctor = 9 dentist
6 dentist = 8 banker .
Where the variables above represent the amount that was spent by an individual in the given
profession. We also know how much was spent in total or
1330 = 25 writer + 20 doctor + 18 dentist + 12 banker .
(15)
This is four equations and four unknowns which can be solved. We find
writer = 14
doctor = 17.5
dentist = 23.3333
banker = 17.5 .
To find out how much each group spend we would multiply each of the numbers above by
the corresponding coefficient in Equation 15 to get
writers
doctors
dentists
bankers
spent = 350
spent = 350
spent = 420
spent = 420 .
35
Multiplying Bacteria
Since the bacteria doubles every day and starts with a single one we have that the number
of bacteria is given by Nn = 2n−1 for n ≥ 1 where n is the day number. We are told that
the container is full on day 10 where
N10 = 29 ,
The container will be half-full when Nn = 28 which happens when n = 9 or the ninth day.
A Puzzling Number
From the description if x is the unknown number then we must have
1
1
1
x в€’ x в€’ x в€’ x = 58 .
3
10
12
Solving for x we get x = 120.
What a Coincidence!
To start we will assume that the amount of money each of the men has initially is given by
the variables
a, b, c, d, e, f, g .
Then according to the problem after the first round where Arun “wins” each of the players
will now have
a в€’ b в€’ c в€’ d в€’ e в€’ f в€’ g, 2b, 2c, 2d, 2e, 2f, 2g .
After the second round where Binoy “wins” we would need to double the amount of money
that each person has (excluding Binoy) and subtract that amount from Binoy to get the
amount each person has at the end of this round. This algorithm would needed to be
repeated as each of the different player wins. This could be done “by hand” or we can use
Mathematica to perform the algebra needed at each step. Once we finish with the seven
steps of the game we will end up with seven expressions for the amount of money in each
persons pocket. Since we are told that this amount of money is equal to 32 rupees we end
up with seven equations to solve for the unknowns a, b, c, d, e, f , and g representing the
amount of money each person has initially. When we do that we get the values
a = 112.35
b = 56.25
c = 28.25
d = 14.25
e = 7.25
f = 3.75
g = 2.
36
See the Mathematica file what a coincidence.nb where steps discussed above are performed.
The Idler
Lets consider how much Ram Rakhan should make if he works each day. Since he gets 240
rupees for 30 days of work we see that he makes
240
= 8,
30
rupees per day. For each day that Ram Rakhan does not work he must pay back 10 rupees
per day (notice that this is larger than what he makes per day). If we assume that Ram
Rakhan works only x days then he will not be working for 30 в€’ x days. Now since no money
changes hands at the end of the month the amount that should be paid to Ram Rakhan by
Gulab Singh must equal the amount that Ram Rakhan should pay Gulab Singh or
8x = 10(30 в€’ x) .
Solving the above for x we get x = 16 32 days.
A Bargain in Guavas
In this problem let n be the number of guavas we initially bought at 1.2. Then since 1.2
is
n
14.4
the price per guava the price per dozen guava is twelve time that or n . When we added
14.4
two more guava the price per dozen now becomes the smaller number n+2
. Since we are told
that the vendor lost 0.1 more with this transaction than in the previous one we must have
14.4
14.4
в€’
= 0.1 .
n
n+2
The above can be simplified to a quadratic equation in n given by
n2 + 2n в€’ 288 = 0 .
Solving this we find n = 16 and n = в€’18. The only acceptable answer is n = 16 as the
number of guavas bought originally.
The Mathematical Shepherd
Let the total number of sheep the shepherd has be denoted as m and we split his sheep up
into two (non equal) parts denoted m1 and m2 where we assume that m2 > m1 ≥ 0. Since
the different of m2 and m1 must equal the difference of its squares we have that
m2 в€’ m1 = m22 в€’ m21 = (m2 в€’ m1 )(m2 + m1 ) ,
37
when we factor. Since m2 = m1 we can divide both sides by m2 в€’ m1 to get
1 = m2 + m1 .
Since the numbers m1 and m2 represent sheep we cannot have a fraction number of we must
have m2 = 1 and m1 = 0 so the shepherd has only one sheep.
Father and Son
If we let f and s be the fathers and sons ages respectively we get
f = 4s and
1
(f + 30) = s + 30 ,
2
for the two statements given. If we put the first equation into the second equation and solve
for s we get s = 15 and f = 60.
A Date to Reckon With
This is a problem where we want to count the number of days in a given year where the
product of the day number and the month number equals the two digit year number. Rather
than do this computation “by hand” we let the computer do the hard work. In the python
script a date to reckon with.py we find that in 1924 and 1960 we have seven such dates.
There are several years with six such dates: 1912, 1930, 1936, 1948, and 1972.
The Number Puzzle
If we let the two numbers be a and b then from the problem statement we are told that
a в€’ b = 3 and a2 в€’ b2 = 51. Factoring this second expression we get
(a в€’ b)(a + b) = 51 ,
But since we know that a в€’ b = 3 the above is equal to a + b =
equations for a and b we get a = 10 and b = 7.
51
3
= 17. Solving these two
Hearts Apart
Let vm and vw be the velocity of the man and women (in miles per hour) respectively. Then
we are told that vm = 4 and vw = 3. They will meet in T hours after they start walking
where
vm T = 63 в€’ vw T or T = 9 .
Thus the man must have traveled 4(9) = 36 miles and the women 3(9) = 27 miles.
38
A Problem of Age
Let the age of the husband be denoted by the two digit number d1 d2 where d1 and d2 are
the first and second digits in his age i.e. 0 ≤ di ≤ 9. Then from the problem d2 d1 is the age
of the woman. As a base ten number we have that the husbands and wife’s ages are
d1 d2 = 10d1 + d2
and d2 d1 = 10d2 + d1 .
The difference in their two ages is then
10d1 + d2 в€’ (10d2 + d1 ) = 10(d1 в€’ d2 ) + (d2 в€’ d1 ) = 9(d1 в€’ d2 ) .
The sum of their two ages is then
10d1 + d2 + 10d2 + d1 = 10(d1 + d2 ) + (d2 + d1 ) = 11(d1 + d2 ) .
Since we are told that the difference in their ages is
9(d1 в€’ d2 ) = d1 + d2
1
11
of the sum of their ages we have
or 4d1 = 5d2 .
Since d1 and d2 are integer digits to make the above true we need to take d1 = 5 and d2 = 4.
The husbands age is then 54 and the wife’s age is then 45.
The Passenger Train and the Goods Train
I took the problem to mean that the passenger train takes three times as long (or 3T ) to
pass the goods train when both trains are running in the same direction. When both are
running in the opposite direction the passenger train will pass the goods train in a time T .
If we let vp and vg be the velocities of the passenger and the goods trains respectively and
Lg be the length of the goods train then since they pass in T when running in the same
direction we must have
(vg + vp )T = 2Lg .
Notice that the right-hand-side is twice the length of the goods train, since only after that
much length have the two trains passed each other). When they are running parallel it takes
longer and we have
(vp в€’ vg )(3T ) = 2Lg .
Setting these two expressions for 2Lg equal to each other we get
(vp + vg )T = 3(vp в€’ vg )T .
Dividing by T and vg we get
vp
vp
+1=3
в€’1
vg
vg
Solving for the fraction
vp
vg
we get
vp
= 2.
vg
39
.
The Circular Numbers
Since in this problem we are simply looking for an ordering of the numbers 1, 2, . . . , 9, 10 that
satisfy the sum requirement we can have a computer do the searching for us. In the python
code the circular numbers.py we enumerate all possible combinations that possess the
desired property. Note that many of these answers would be cyclical permutations of each
other. One would need to remove these duplicates to get just the set of possible number
ordering. When we run that code (and look for solutions that have the first and second
labels “7” and “1”) we get
python ../Code/the_circular_numbers.py | grep "(7, 1"
(7, 1, 8, 4, 10, 2, 6, 3, 9, 5)
(7, 1, 8, 5, 9, 2, 6, 3, 10, 4)
(7, 1, 9, 3, 10, 2, 6, 4, 8, 5)
(7, 1, 9, 5, 8, 2, 6, 4, 10, 3)
(7, 1, 10, 3, 9, 2, 6, 5, 8, 4)
(7, 1, 10, 4, 8, 2, 6, 5, 9, 3)
(7, 10, 1, 4, 5, 8, 9, 2, 3, 6)
(7, 10, 1, 6, 3, 8, 9, 2, 5, 4)
(7, 10, 3, 2, 5, 8, 9, 4, 1, 6)
(7, 10, 3, 6, 1, 8, 9, 4, 5, 2)
(7, 10, 5, 2, 3, 8, 9, 6, 1, 4)
(7, 10, 5, 4, 1, 8, 9, 6, 3, 2)
Notice that the sixth entry is the same as that provided in the back of the book.
Rice for the Festival
We are told that
1
100 = 3nold + 2nyoung + nchild .
2
We want to find integers that make the above equation true. There are many possible values
that will work. In python code rice for the festival.py when we find the first ten strictly
positive solutions look like
1
1
1
1
1
1
1
1
1
2
3
4
5
6
7
8
190
186
182
178
174
170
166
162
40
1 9 158
1 10 154
1 11 150
Many other solutions are possible.
Swarm of Bees
If we let B be the number of bees from the problem statement we would have
B 8
+ B+2=B.
2
9
в€љ
We can write this as a quadratic equation in B as
1 в€љ
1
B в€’ в€љ B в€’2 = 0.
9
2
Solving this for
в€љ
B (and then squaring) we find B = 72.
Story of the Three Farmers
Let m, c, and g be the amount of pasture a mule, cow, and a goat respectively eat per unit
time and let T be the amount of time the first man has grazed his nine mules. Then in the
problem statement we are told that
6c = 4m
10g = 3c .
(16)
(17)
The second man grazed his twelve cows for 2T and the third man grazed his goats (an
unknown number of them) for 2 12 (2T ) = 52 (2T ) = 5T . Since the third man payed 1/2 of the
cost he payed 500 rupees and if ng represents the number of goats he grazed then we must
have
500 = 5T ng g .
The other two farmers must have payed the rest of the cost or
9mT + 12(2T )c = 500 .
(18)
Notice that by multiplying by T in Equations 16 and 17 we can get two equations in the
three unknowns mT , cT , and gT or the product of the rate each animal eats grass and the
length of time T . This gives us three equations and three unknowns
4mT в€’ 6cT = 0
3cT в€’ 10gT = 0
9mT + 24cT = 500 .
41
Solving for these three unknowns gives us
mT = 20
40
cT =
3
gT = 4 .
Thus the first man had to pay 9mT = 180, the second man had to pay 24(cT ) = 320, and the
number of goats that the third man had was such that 500 = 5ng (gT ) = 5(4)ng or ng = 25.
What Were You Doing When the Lights Went Out?
Let L be the initial length of both candles. If we let v1 and v2 be the rates at which each
candle burns then from the problem statement since the first burns in four hours and the
second in five we have that
L
L
= 4 and
= 5,
v1
v2
hours. Since the first candle burns quicker (in four hours vs. five hours) we know that
v1 > v2 . Assume that T is the amount of time the lights were out and let L1 and L2 be the
lengths of the first and second candle after each had been burning for the amount T . Since
the first candle burns quicker we would expect L1 < L2 and in fact are told that
L2 = 4L1 .
(19)
Since each candle started at a length of L and was burning for T time we have
L1 = L в€’ v1 T
and L2 = L в€’ v2 T .
Using the above in Equation 19 and we have that
L в€’ v2 T = 4L в€’ 4v1 T .
We can solve the above for T to get
T =
3L
=
4v1 в€’ v2
4v1
L
3
в€’
v2
L
=
3
4
1
4
в€’
1
5
=
15
= 3.75 ,
4
hours.
Staff and the Steeple
This is a problem involving proportional triangles. If we let h be the height of the steeple
then we should have
5
h
=
so h = 300 .
120
2
42
Up the Stream – Down the Stream
Let vs be the velocity of the stream and let vb be velocity of the crew boat such that if there
was no stream the boat would move forward at a speed vb . We are told that to row upstream
(against the current) takes Tu = 8 74 minutes. Let L be the length of the river. Then since
we are rowing against the steam this means that
(vb в€’ vs )Tu = L .
(20)
If there was no current the problem specifies that
vb (Tdrift в€’ 7) = L .
(21)
Where the time to drift down the stream in terms of vs is Tdrift =
long it would take to row down the stream (with the current) or
L
=
vb + vs
T =
vb
L
1
+
vs
L
L
.
vs
We want to find how
.
To evaluate this we will use Equations 20 and 21 to solve for vLb and vLs and then evaluate
the above for T . To start divide both sides of Equation 20 by L to get
vb vs
1
1
в€’
=
= 4.
L
L
Tu
87
(22)
Next replace Tdrift in Equation 21 and divide by L to get
vb
L
L
в€’7
vs
= 1.
Thus we have two equations and two unknowns to solve for. We can do this as follows. Solve
for vLb as a function of vLs in Equation 22 and put this in the equation above to get
в€’7
vs
L
2
в€’
7
Tu
vs
1
+
= 0.
L
Tu
This has two roots. The positive one gives vLs = 0.08333333 and
value for T is given by T = 3.529412 minutes.
vb
L
= 0.2. Thus the desired
Wine and Water
After the first pour the amount of spirit in the second bottle is 1/4 ounces so that the
10
= 40 as stated in the problem. After the first pouring
proportion of water to wine is then 1/4
the fraction of spirit in the second bottle (by volume) is
0.25
= 0.02439024 .
10.25
43
Step 0
Step 1
Step 2
Bottle 1 (Spirit)
10
9.75
9.75609
Bottle 1 (Water) Bottle 2 (Spirit)
0
0
0
0.25
0.2439
0.2439024
Bottle 2 (Water)
10
10
9.756098
Table 3: The amount of spirit and water in each of the two bottles (in ounces) at each of
the three stages of the problem. See the text for details.
Thus when we extract back 1/4 oz of liquid from the second bottle we are actually getting
0.25
0.25
10.25
= 0.006097561 ,
ounces of spirit and
0.25
10
10.25
= 0.2439024 ,
ounces of water. In Table 3 we keep track of how much spirit and water is in each bottle
at each of the given steps. Given these amounts of spirit and water in the first bottle the
proportion of spirits to water was then
9.75609
= 40. .
0.2439
The Long Tunnel
In the first one minute the train will be inside the tunnel i.e. the front engine car will have
passed through the tunnel and be starting to peak outside. To get the caboose to pass
through the tunnel we will need one more minute of travel time. Thus it takes two minus
total to pass completely through the tunnel.
The Horse, the Cow and the Sheep
The vh , vc , and vs be the rates that the horse, cow, and sheep take to eat one pasture when
eating alone. From the problem we are told the rates that combined groups can eat one
pasture, namely
1
40
1
vh + vs =
60
1
.
vc + vs =
90
vh + vc =
Given the above we want to know the value of vh +vc +vs . To answer this note that the above
is three equations and with three unknowns that can be solved with standard methods. The
44
solutions are given by
vh = 0.01527
vc = 0.0097
vs = 0.00138 .
In terms of in fractions (rather than decimal numbers) we compute
vh + vc + vs =
1
19
1
= 720 =
,
720
37.89
19
or all three animals together can eat one pasture in 37.89 days.
The Two Mathematical Men
Let the two mens ages be denoted a and b. Then we are told that a в€’ b = 30 and ab = 1624.
Putting this second equation into the first gives a в€’ 1624
= 30. This last equation can be
a
written as the quadratic equation
a2 в€’ 30a в€’ 1624 = 0 ,
which has a = 58 as the only positive root. With this value for a we find that b =
as the other mans age.
1624
58
= 28
A Question of Mileage
When four tires run for one mile we accumulate four miles of tire ware. If the car has run for
20,000 miles then we have accumulated 80,000 miles of tire ware. If this total amount of tire
ware is equally distributed among five tires we have that each tire contributes 80000
= 16000
5
miles of tire ware.
How Much?
Let x be the amount I have, so that x = 2(10) = 20 paise and let y be the amount that you
have. We are told that
8
4
x = y.
5
9
Solving for y in the above we get y = 18 paise.
45
The Bargain
Notice that the costs changing at a constant rate as observed by the following calculations
1024 в€’ 640
= 0.6
640
640 в€’ 400
= 0.6
400
400 в€’ 250
= 0.6 ,
250
Thus we would expect the next price x to satisfy
250 в€’ x
= 0.6 .
x
Solving for x in the above we find x = 156.25.
Sections of a Necklace
One method (not optimal) is to lay the segments of chain horizontally and to cut (to open
the link) and then to solder (to close the link) one of the links between each segment to join
the segments together. There are four “internal” locations that would need to be cut and
the soldered and one end to be cut and soldered to join the chains into a necklace. This
gives five cuts and five solders for a cost of ten rupees.
A different strategy is to take one of the five segments (which has four links) and to cut
each of the four links open. Then using each of these (now opened) links we would join the
four remaining segments together into a full chain. This can be done with only four solders
(three internal solders and one final to form the necklace). In this way the entire process
would cost 4 + 4 = 8 rupees.
Age of Demochares
If we let L (for lifetime) be the age we seek to determine. Then from the problem statement
we have that
1
1
1
L + L + L + 13 = L .
4
5
3
Solving this for L we find L = 60.
The Painted Cube
Only the “center” cube will not have paint on it. Thus the other 27 − 1 = 26 will have at
least one painted side.
46
Smoking Not Prohibited
We can take the 36 cigarette butts and create 36
= 6 cigarettes. When we smoke these we
6
will be left with six cigarette butts. Using these six we can build one more cigarette to smoke
which when smoked will leave one butt. Thus we can get a total of seven cigarettes from
these 36 cigarette butts.
Mathematical Taxi Driver
By sequentially considering multiples of 11 we can check which number has the required
remainders and stop when we get to the first one (since it will be the smallest of such
numbers). We can do this with the following python code
num = 11
while True :
remainder_1_when_div_by_2_N_3 = ( num % 2 == 1 ) and ( num % 3 == 1 )
remainder_1_when_div_by_4_N_5 = ( num % 4 == 1 ) and ( num % 5 == 1 )
if remainder_1_when_div_by_2_N_3 and remainder_1_when_div_by_4_N_5 and ( num % 6 == 1 ) :
print num
break
num += 11
where we find that the number is 121.
The Tennis Tournament
We would proceed sequentially as follows
• From the 30 original people we can form 15 matches, eliminating 15 people and leaving
15 people.
• From these 15 people we can form 7 matches, eliminate 7 more people leaving 30 −
15 в€’ 7 = 8 people.
• From these eight people we can form 4 matches, eliminate 4 more people leaving four
people.
• From these four people we can form two matches, eliminate two more people leaving
two people.
• From these two people we can form one match and determine our winner.
Thus in total we have 15 + 7 + 4 + 2 + 1 = 29 matches. Note this is one less than thirty. This
makes sense since for every match played we eliminate one player. As we want to eliminate
all but one player we must play 30 в€’ 1 = 29 matches.
47
Dividing the Load Equally
If there was only one box and three miles to walk in order that each person work the same
amount we could have each person carry the box for one mile. Since we have two boxes
each person should carry a box for two miles. Thus divide the three mile trip into six half
mile segments. Then have each person carry a box for four of these segments. If we let the
porters be denoted as A, B, and C then the following is a schedule that does this
• First half-mile (A, B) carry
• Second half-mile (C, B) carry
• Third half-mile (C, A) carry
• Fourth half-mile (B, A) carry
• Fifth half-mile (C, B) carry
• Sixth half-mile (A, C) carry
In the above schedule each porter walks two miles as needed.
Longfellow and His Bees
If we let B be the total number of bees in the hive. From the problem statement we have
that
1
1
1
1
B+ B+3
Bв€’ B +1=B.
5
3
3
5
The left-hand-side is the sum of the expressions for the way the bees scatter. Since this sum
must be all of the bees it must be equal to B (which is the right-hand-side). We can solve
the above for B to find B = 15.
Mr. Portchester’s Problem
This is another type of problem that can be formulated as a “search” problem see [1] for a description of these types of problems and how to solve them. I implemented a graph searching
algorithm following the above reference in the python code mr portchesters problem.py.
When we run that code we get an output that is somewhat lengthy (64 steps) and will not
be included here. What one can conclude however is that it is possible to obtain three quarts
in the five and the four quart containers. It would seem to be quite a feet to come up with
a solution “by hand”.
48
Driving Through the Country
We can write a simple python program to compute the needed sum. We have
n_days = 1
n_miles_today = 7
n_miles_total = n_miles_today
print "n_days= %5d; n_miles_today= %5d for a total of %5d" % (n_days,n_miles_today,n_miles_total)
while n_miles_today != 51 :
n_days += 1
n_miles_today += 4
n_miles_total += n_miles_today
print "n_days= %5d; n_miles_today= %5d for a total of %5d" % (n_days,n_miles_today,n_miles_total)
When we run that code we get
n_days=
n_days=
n_days=
n_days=
n_days=
n_days=
n_days=
n_days=
n_days=
n_days=
n_days=
n_days=
1;
2;
3;
4;
5;
6;
7;
8;
9;
10;
11;
12;
n_miles_today=
n_miles_today=
n_miles_today=
n_miles_today=
n_miles_today=
n_miles_today=
n_miles_today=
n_miles_today=
n_miles_today=
n_miles_today=
n_miles_today=
n_miles_today=
7
11
15
19
23
27
31
35
39
43
47
51
for
for
for
for
for
for
for
for
for
for
for
for
a
a
a
a
a
a
a
a
a
a
a
a
total
total
total
total
total
total
total
total
total
total
total
total
of
of
of
of
of
of
of
of
of
of
of
of
7
18
33
52
75
102
133
168
207
250
297
348
Thus in twelve days we drove 348 miles.
Dots and Lines
We draw a diagonal line from the upper left to the lower right then up the right hand column
of dots (past the last dot some) and then diagonal from upper right to lower left through the
“middle” dots in the first row and column, and then finally along the bottom row of dots to
connect all dots.
The Triangles
There are 12 triangles with sides of length one, six triangles with sides of length two and
two triangles with sides of length three. This gives twenty triangles.
49
The Puzzled Artist
Let w and h be the width and height of the picture we want to place in a frame of the given
dimensions. To have an area of 72 square inches than we must have wh = 72. If the top and
bottom border are to be four inches each and the right and left border are to be two inches
each then the area of the entire canvas (the picture plus the border) would be given by
(w + 4)(h + 8) .
Expanding the left-hand-side of this and using the fact that wh = 72 we get
8w + 4h + 104 .
It is this expression that we want to minimize subject to the constraint that wh = 72.
Solving this last equation for w and putting it into the above gives
8
72
h
+ 4h + 104 .
Taking the derivative with respect to h and setting the result equal to zero gives
в€’
576
+4 = 0.
h2
Solving this for h gives h = 12 and so w = 72
= 6 for the dimensions of the picture. In
h
addition, we have that the canvas should be w + 4 = 10 inches wide and h + 8 = 20 inches
high.
The Mystery of Number Eleven
Here is a problem for which we can have python do the searching. Running the code
the mystery of number eleven.py we find the number 987652413.
The Rose Garden
For this problem you have to recall the theorem that quadrilaterals with maximal area must
have all four of their vertexes on a circle. In that special case the area of the quadrilateral
can be computed from the lengths of its sides and is given by Brahmagupta’s formula.
This states that if maximal area quadrilateral has edge lengths denoted by a, b, c, and d
then is has an area A given by
A=
(s в€’ a)(s в€’ b)(s в€’ c)(s в€’ d) ,
(23)
where s is the semi-perimeter
a+b+c+d
.
2
We can use Brahmagupta’s formula to find the area of the rose garden.
s=
50
(24)
Squares Within Square
By direct counting, we see that there are 16 small squares of size one by one, 3 + 3 + 3 = 9
squares of size two by two, 2 + 2 = 4 squares of size three by three and one square of size
four by four giving a total of 30 squares.
The Farmer and the Animals
Let m, s, g, and p be the number of mules, sheep, goats, and pigs that farmer Thimmayya
bought. Then given the cost for each type of animal we know he spent
50m + 40s + 25g + 10p ,
for an average cost per head of
50m + 40s + 25g + 10p
= 30 .
m+s+g+p
We can multiply by the denominator on both-sides of the above and simplify to get
20m + 10s = 5g + 20p .
If we assume that we bought at least one of each type of animal then we seek solutions
to the above equation where m ≥ 1, s ≥ 1, g ≥ 1 and p ≥ 1. In the python code
the farmer and the animals.py we iterate over possible values for each of the variables
and print the first ten possible solutions. When we run that code we get
m=
m=
m=
m=
m=
m=
m=
m=
m=
m=
m=
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
s=
s=
s=
s=
s=
s=
s=
s=
s=
s=
s=
1,
2,
3,
3,
4,
4,
5,
5,
5,
6,
6,
g=
g=
g=
g=
g=
g=
g=
g=
g=
g=
g=
2,
4,
2,
6,
4,
8,
2,
6,
10,
4,
8,
p=
p=
p=
p=
p=
p=
p=
p=
p=
p=
p=
1
1
2
1
2
1
3
2
1
3
2
The Mango Thieves
Let M be the number of mangoes initially stolen so that M < 100. Then we are told that
(M в€’ 1) mod 3 = 0 .
51
(25)
When the first boy eats one, removes one third of the remaining, and places the remaining
back in the basket we will find
2
B = (M в€’ 1) ,
3
remaining in the basket for the second boy to find. We are told that if we subtract one this
number is divisible by three or
2
(M в€’ 1) в€’ 1
3
mod 3 = 0 .
(26)
Next, the second boy takes a mango, removes one third of the remaining, and places the rest
back in the basket. When the third boy wakes he will find
B=
2
3
2
(M в€’ 1) в€’ 1
3
4
10
= Mв€’
,
9
9
mangoes in the basket. Next the third boy wakes, eats one and removes one third leaving
the basket with
2 4
10
Mв€’
в€’1 ,
B=
3 9
9
mangoes in the basket. We are told that these remaining numbers of mangoes could be
divided by three or
10
2 4
Mв€’
− 1 = 3n for n ≥ 1 .
3 9
9
If we solve the above for M in terms of n we have
M=
81n + 65
.
8
For possible values of n we get different possible values for M. For each of these values of M
to be a solution of this problem we must have Equations 25 and 26 both hold. We can use
the python code the mango thieves.py to consider values of n = 1, 2, 3, В· В· В· and stop when
we find the first one that satisfies our two requirements. When we do this we find that for
n = 7 we have M = 79.
A Matter of Rupees and Paise
Let n be the number of coins of each type. Converting everything to paise we have that
700(100) = 25n + 50n + 100n ,
where we have recalled that a single rupee is equal to 100 paise. Solving for n we find
n = 400.
52
Sawing the Cube
The procedure suggested, extracts the center cube (of dimensions 1” by 1”) by cutting wood
with the buzz-saw. We can see that it is not possible to extract this center cube using fewer
than six cuts by observing that to produce the center cube we must have to cut at least once
along each of its six faces otherwise at least one of the faces would not have been liberated.
Thus we require at least six cuts.
The Two Trains
First we introduce some notation used in the solution of this problem. Let D be the distance
between the cities Bangalore and Mysore. After a time T from when they started, let the
two trains cross at the distance of xD from Bangalore (where we have 0 < x < 1). Finally,
let vbm be the spreed of the train (in miles per hour) traveling from Bangalore to Mysore and
vmb the speed of the train traveling in the opposite direction (from Mysore to Bangalore).
First, then since they meet at xD after traveling a time T we know that
xD = vbm T
(1 в€’ x)D = vmb T .
(27)
(28)
Next, as both trains arrive at their destination in one hour and four hours after their crossing
at xD. This means that
vbm (1 + T ) = D
vmb (4 + T ) = D ,
(29)
(30)
since they both have traveled a distance D in the respective times. Putting Equation 27 into
Equation 28 we get
D в€’ vbm T = vmb T
so D = (vbm + vmb )T .
Putting the expression for D into Equations 29 and 30 we get
vbm (1 + T ) = (vbm + vmb )T
vmb (4 + T ) = (vbm + vmb )T .
If we solve each of these equations for T we get
T =
vbm
vmb
and T =
4vmb
.
vbm
Setting these two expressions equal to each other gives
vbm
=4
vmb
vmb
vbm
so
Thus one train was twice as fast as the other.
53
vbm
= 2.
vmb
The Arithmetical Landlady
Let T be the amount of time that has passed on the lease. Then from the problem we are
told that
2
4
T = (99 в€’ T ) .
3
5
Solving the above for T gives T = 54 and so there are 99 в€’ T = 99 в€’ 54 = 45 years remaining
on the lease.
References
[1] S. J. Russell and P. Norvig. Artificial Intelligence: A Modern Approach. Pearson Education, 2 edition, 2003.
54