Sei sulla pagina 1di 6

MATH OLYMPIAD LESSONS

COMBINATORICS

Fibonacci Recursion As a tool to counting


In daily life we see so many people around us doing math on fingers something
what this cute girl in the picture is doing. May be such people arent so well
acquainted with modern day electronic gadgets, which can make their task easier.
But this is quite sure that people such as fruit vendors, street hawkers etc can
count on their fingers at a lightening speed. For example, when I asked the price of
brinjal and my fruit vendor replied, Rs16 per kg. I ordered for a kg and he gave
me an option, either buy the brinjal worth Rs10 or Rs20. Before I could even
decide, he was ready with his weights. I randomly said, Give me for Rs10. I was
not even done with my calculations and he handed over my packet. On my way
back home, after finishing with my mental calculator, I was amazed how quick and
accurate he was with numbers.

This made me realize that tough problems may have simpler solutions. We just
need to look around for.

In most of the counting problems we use binomial coefficients and other combinatory tools. But recursion can act
as a wonderful tool to solve tough problems. In the 13th century, the Italian mathematician Leonardo Fibonacci
studied the following (not too realistic) exercise:

Its easy to figure out the answer for smaller n. Farmer has 1 rabbit in the 1st month and 1 rabbit in 2nd month as
rabbit has to be 2 months old before starting to reproduce. In 3rd month farmer has 2 rabbits and in 4th month he
has 3 rabbits as first rabbit has delivered another. After fourth month second rabbit also starts reproducing so
two new rabbits get added. Thus in 5th month, he has 5 rabbits.

We can easily calculate the number of rabbits in nth month now, if we realize that number of new rabbits added in
nth month is same the number of rabbits who are at least 2 months old or who were present there two months
ago. In other words If Fn denotes the number of rabbits in nth month, then w have for n 2,
Fn+1 = Fn + Fn-1
We already know that F1 = 1, F2 = 1, F3 = 2, F4 = 3 and F5 = 5. If we set F0 = 0, then above equation will be
valid for n = 1 also. Now any term of the following sequence can be determined easily:

Regarding solutions to the problems posed in the article and any comments, corrections or suggestion, contact me:
Kamal Lohia (kamallohia@totalgadha.com)

www.totalgadha.com www.totalgadha.com/rmo
MATH OLYMPIAD LESSONS
COMBINATORICS

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987
The numbers in this sequence are called Fibonacci Numbers. And any pattern of integers which follow the above
equation can be termed as Fibonacci Sequence.

Lets see some examples of Fibonacci in daily math life:

A staircase has 10 steps. You walk up taking one or two at a time. How many ways can you go up?
For one step only we see that there is one way. If there are two steps we can go up in two ways i.e. 1 + 1 or 2.
If there are three steps we can go up in three ways i.e. 1 + 1 + 1, 1 + 2 or 2 + 1. Now can you guess the
number of ways for four steps? No it is not four rather five i.e. 1 + 1 + 1 + 1, 1 + 1 + 2, 1 + 2 + 1, 2 + 1 + 1 or
2 + 2.
Now lets think logically and apply reverse count. If there are an+1 number of ways to go up to n + 1 steps, then
these number of ways can be separated in two categories;
one in which first step was single i.e. remaining n steps can be covered in an ways,
second in which first step was double i.e. remaining n 1 steps can be taken in an-1 ways. So we can
safely write now that,
an+1 = an + an-1
If you look closely this is the same equation as we obtained above for Fibonacci Sequence. We know that a1 = 1,
a2 = 2. So the pattern can easily be obtained as
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144
No points for guessing that a10 = 89.

TG Tower has 10 floors each need to be painted with either pink or yellow color. But no two adjacent
floors are to be colored pink. In how many ways the tower can be painted?
Again applying the logical reverse count let an+1 be the number of ways to paint the n + 1 floors. These include
the ways
when first floor was painted pink i.e. next floor has to be yellow and remaining n 1 floors can be painted
in an-1 ways,
and when first floor was painted yellow i.e. remaining n floors can be painted in an ways. So we have got
the recursion as
an+1 = an + an-1
with a1 = 2, a2 = 3. So the pattern can easily be obtained as
2, 3, 5, 8, 13, 21, 34, 55, 89, 144
And the required number of ways of painting is 144.

All 10-digit natural numbers are formed by using digit 1 or 2. How many of these numbers have two
consecutive 1s?
Lets count first that how many ten digit natural numbers dont have two consecutive ones. If I replace the
numeral 1 with pink and 2 with yellow of above question, I have already calculated the number of 10 digit
numbers with no two consecutive 1s which is 144. As total 10 digit numbers formed by using digit 1 or 2 is 210 =
1024, so the required numbers are 1024 144 = 880.

x
A fair coin is tossed 10 times. Let be the probability that no two consecutive tosses show tails
y
where x and y are natural numbers such that HCF(x, y) = 1. Find x + y.

Regarding solutions to the problems posed in the article and any comments, corrections or suggestion, contact me:
Kamal Lohia (kamallohia@totalgadha.com)

www.totalgadha.com www.totalgadha.com/rmo
MATH OLYMPIAD LESSONS
COMBINATORICS

You must be able to do this one easily now. I am leaving this for my intellectual audiences fun.

There are 10 line segments of different integer lengths increasing from 1 meter to n meter. What is
the smallest value of n such that no three line segments from the ten can be chosen to make a
triangle?
This is a special use of Fibonacci. We know that sum of any two sides of a triangle must be greater than the third
side other wise the three sides cannot form a triangle. So the 10 smallest lengths can easily be obtained as:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89
We have got our answer with n = 89.

A postman delivers letters to the nineteen houses on the west side of Chaurangi lane. The postman
notices that no two consecutive houses ever get letters on the same day. How many different
combinations of letter delivery are possible?
Lets reframe the question as making 19 - digit number formed using digits 1 and 2 only with no two consecutive
1s. Here 19 - digit number represents 19 houses while 1 denotes letter posted and 2 denote letter not posted to
a particular house. We are going to get the same recursion again i.e.
an+1 = an + an-1
with a1 = 2, a2 = 3. So the pattern can easily be obtained as
2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946
And the answer is a19 = 10946.

In how many ways a 2 10 rectangle can be tiled by using 2 1 or 2 2 tiles?


Lets try to solve this one again by reverse count. Let an be the number of ways of tiling a 2 n rectangle. This
include the ways when first tile is 2 1 in vertical orientation (as below) i.e. remaining rectangle can be tiled in
an-1 ways.

And it include the ways when first tile is 2 2 (as shown) i.e. remaining rectangle can be tiled in an-2 ways.

Also it include the ways when first 2 1 tile was in horizontal orientation (see figure) i.e. remaining rectangle can
be tiled in an-2 ways.

Thus the recursion can be obtained as


an = an-1 + 2an-2
with a1 = 1, a2 = 3. Pattern is:
1, 3, 5, 11, 21, 43, 85, 171, 341, 683

Regarding solutions to the problems posed in the article and any comments, corrections or suggestion, contact me:
Kamal Lohia (kamallohia@totalgadha.com)

www.totalgadha.com www.totalgadha.com/rmo
MATH OLYMPIAD LESSONS
COMBINATORICS

Required number of ways is a10 = 683.

By now you must have understood how to create a recursion and use this tool to solve somewhat how to handle
problems.

Coming back to original Fibonacci Sequence, lets study some properties:


To define a Fibonacci Sequence, we need first two terms as all other terms can be obtained in terms of
these two terms with the relation
Fn+1 = Fn + Fn-1

How to find the nth term of the original Fibonacci Sequence i.e. 0, 1, 1, 2, 3, 5?
If we disregard first few terms then any Fibonacci behaves as a geometric progression (GP) with a
5 +1
common ratio close to 1.6 or Golden ratio i.e. . This can be easily checked by taking the terms of
2
n
Fibonacci in GP as Tn = ar
So using the recursion, we have Tn+1 = Tn + Tn-1
1+ 5 1 5
That means, arn+1 = arn + arn-1 => r2 = r + 1 => r = or
2 2
n n
1 + 5 1 5
We have Tn = a
2
or Tn = a
2
both of which will satisfy the above recursion but they do not

give the original Fibonacci. Lets see that difference of these two sequences also satisfy the recursion.
i.e. Tn+1 Tn+1 = (Tn + Tn-1) (Tn + Tn-1) = (Tn Tn) + (Tn-1 Tn-1)
So lets try to equate Tn Tn with Fn so as to find the formula for nth term of Fibonacci.
T0 T0 = 0 = F0 (satisfying)
1
T1 T1 = a 5 = 1 = F1 if a =
5
T2 T2 = 1 = F2 (satisfying)
Eureka! We have got it now.

1 1 + 5 1 5
n n

Fn =
5 2 2

How to find sum of any Fibonacci Sequence?


Sn = F1 + F2 + F3 + F4 + + Fn
Sn = F1 + F2 + F3 + F4 + + Fn
Subtracting the two expressions we get,
0 = F1 + F2 + [F2 + F3 + + Fn-1] Fn-1 - Fn, or
Sn-1 = F1 + F2 + F3 + F4 + + Fn = Fn-1 + Fn F2
Finally we have,
Sn = Fn+2 F2

Regarding solutions to the problems posed in the article and any comments, corrections or suggestion, contact me:
Kamal Lohia (kamallohia@totalgadha.com)

www.totalgadha.com www.totalgadha.com/rmo
MATH OLYMPIAD LESSONS
COMBINATORICS

Sum of squares of n terms of any Fibonacci Sequence:


F12 + F22 + F32 +... + Fn2 = F12 + {F1F2 + F22} + F32 +... + Fn2 - F1F2 = F12 + {F2F3 + F32} + + Fn2 -
F1F2 = F12 + FnFn+1 - F1F2.
If F1 = 0 or F1 = F2, then
F12 + F22 + F32 +... + Fn2 = FnFn+1

Now some experimental results, which can be verified by mere calculations:


Pattern of unit digit in any Fibonacci Sequence of positive integers repeat after maximum of 60 terms.
Pattern of last two digits in any Fibonacci Sequence of positive integers repeat after maximum of 300
terms.
Pattern of last three digits in any Fibonacci Sequence of positive integers repeat after maximum of 1500
terms.
Now do some questions:
1. The increasing sequence of positive integers a1, a2, a3: has the property that
an+2 = an + an+1 for all n 1
If a7 = 120, then a8 is:

2. What is the sum of the series: 22 + 42 + 62 + 102 + 162 +... + 7542 + 12202?

3. Without actually adding, find the sum 3 + 11 +14 + 25 ++ 1851 + 2995.

4. How many 10 digit natural numbers formed by digits 1 and 2 only are there which do not have
221 at any place?

5. In how many ways a 2 10 rectangle can be tiled by using 2 1 or L-shaped dominoes?

6. There are two urns, one is full of water and the other is empty. On the first stage, half of the
content of urn I is passed into urn II. On the second stage 1/3 of the content of urn II is
passed into urn I. On stage three, 1/4 of the content of urn I is passed into urn II. On stage
four 1/5 of the content of urn II is passed into urn I, and so on. What fraction of water remains
in urn I after the 2010th stage?

7. Twelve people are seated around a circular table. In how many ways can six pairs of people
engage in handshakes so that no arms cross? (Nobody is allowed to shake hands with more
than one person at once.)

A special case or use of recursion is derangement. See the below examples:

In how many ways can six couple dance in pairs so that no person dances with his or her spouse?

In how many ways can six letters be delivered to different addresses so that no letter reaches its
desired place?

Regarding solutions to the problems posed in the article and any comments, corrections or suggestion, contact me:
Kamal Lohia (kamallohia@totalgadha.com)

www.totalgadha.com www.totalgadha.com/rmo
MATH OLYMPIAD LESSONS
COMBINATORICS

In how many ways Mr. Black, Mr. White, Mr. Red, Mr. Blue, Mr. Green and Mr. Orange can each wear a
cap from six black, white, red, blue, green and orange colored ones such that no person is wearing
cap of same color as his name?

In how many ways a 2 6 rectangle can be tiled with six different types of 1 1 tiles with two of each
type available? It is given that each of the two 1 6 rectangle contain all the six types of tile and no
two same tile share an edge.
All of the above questions are asking for same thing that a particular item must not be associated with its
partner. Lets take the general case We have a1, a2, , an which are partners of b1, b2, , bn respectively. Now
we are to pair them in such a way that no two partners are in same group. Lets call it derangement and Dn be
the number of derangements of n pairs.
Now it can be easily observed that D1 = 0, D2 = 1, D3 = 2.
Number of derangements for n pairs i.e. Dn includes the ways
when a1 is associated with bi (where i can be selected from 2 to n in (n 1) ways) and ai is associated
with b1 i.e. remaining n 2 pairs can be deranged in Dn-2 ways.
when a1 is associated with bi (where i can be selected from 2 to n in (n 1) ways) and ai is not
associated with b1 i.e. remaining n 1 pairs can be deranged in Dn-1 ways.
So here we go with our recursion as follows:
Dn = (n 1)[Dn-1 + Dn-2]
Now lets try to derive a formula for Dn, we have Dn = (n 1)[Dn-1 + Dn-2]
=> Dn nDn-1 = (-1)[Dn-1 (n 1)Dn-2] = (-1)2[Dn-2 (n 2)Dn-3] = = (-1)n-2[D2 2D1] = (-1)n-2 = (-1)n
So dividing by n!, we have
Dn Dn 1 (1)n
=
n ! (n 1)! n!
Dn 1 Dn 2 (1)n 1
Similarly, =
(n 1)! (n 2)! (n 1)!
Dn 2 Dn 3 (1)n 2
=
(n 2)! (n 3)! (n 2)!
:::::::::::::::::::::::::::
D2 D1 (1)2
=
2! 1! 2!
D D (1) n
(1)n 1 (1)n 2 (1)2
Adding all the above equations we have, n 1 = + + + ... +
n ! 1! n! (n 1)! (n 2)! 2!

I hope all of you can solve above questions easily. Also I am sure you will be having a new perspective to view
abnormal counting problems.
Good luck!

Regarding solutions to the problems posed in the article and any comments, corrections or suggestion, contact me:
Kamal Lohia (kamallohia@totalgadha.com)

www.totalgadha.com www.totalgadha.com/rmo

Potrebbero piacerti anche