Trisection method by
k
Lucas numbers
q
Ali Demir
Department of Mathematics, Kocaeli University, 41380 Umittepe, Izmit – Kocaeli, Turkey
Abstract
In this paper, we study on trisection method with
k
Lucas numbers based on bisection method. We eliminate the disadvantages of bisection method. Moreover, trisection method works faster than bisection method.
2007 Elsevier Inc. All rights reserved.
Keywords:
Bisection method; Fibonacci numbers;
k
Lucas sequences
1. Introduction
In mathematics, the bisection method is an algorithm which ﬁnds a root of a function by dividing an interval in half and selecting the subinterval in which the root exists. Let us explain this algorithm brieﬂy. Supposewe want to solve the equation
f
(
x
) = 0. Given two points
a
and
b
such the following inequality holds:
f
ð
a
Þ
f
ð
b
Þ
<
0
ð
1
Þ
If
f
is continuous function it is obvious that
f
has at least one root in the interval [
a
,
b
] by the intermediatetheorem. At each step, the bisection method divides the interval in half and choose the one which has the rootof the function. In order choose the part of the interval it compares the signs of the function at one of the endpoints and the middle point of the interval. Let us consider the ﬁrst step the algorithm, then the middle pointof the interval is
c
¼
ð
a
þ
b
Þ
2
. There are now two possibilities: either
f
(
a
) and
f
(
c
) have opposite signs, or
f
(
c
) and
f
(
b
) have opposite signs. The bisection algorithm is then applied to the subinterval where the sign changeoccurs, meaning that the bisection algorithm is inherently recursive.To be more precise in our deﬁnition, suppose that we are given an interval [
a
,
b
] satisfying Eq. (1) and anerror tolerance
e
> 0. The bisection method consists of the following steps [1]:Step 1. Deﬁne the middle point:
c
¼
a
þ
b
2
Step 2. Take
c
as root and stop, if
b
c
6
e
Step 3. If sign[
f
(
b
)]sign[
f
(
c
)]
6
0, then set
a
=
c
otherwise, set
b
=
c
. Return to Step 1.
00963003/$  see front matter
2007 Elsevier Inc. All rights reserved.doi:10.1016/j.amc.2007.08.039
q
This research is partially supported by TUBITAK.
Email address:
ademir@kou.edu.tr
Available online at www.sciencedirect.com
Applied Mathematics and Computation 198 (2008) 339–345
www.elsevier.com/locate/amc
The interval [
a
,
b
] is divided in half with each loop through Steps 1–3. The condition in Step 2 will be satisﬁed eventually, and with it the condition
j
a
c
j
6
e
will be satisﬁed where
a
denotes the root. As mentionedabove we take into account the sign of the function at one of the end points and the middle point in Step 3, i.e.compare sign [
f
(
b
)] sign [
f
(
c
)]. Because of underﬂow or overﬂow in the multiplication of
f
(
b
) and
f
(
c
), we compare sign [
f
(
b
)] sign [
f
(
c
)] instead of
f
(
b
)
f
(
c
).Denote
a
n
,
b
n
,
c
n
as the
n
th values of
a
,
b
,
c
, respectively. It is clear that:
b
n
þ
1
a
n
þ
1
¼
12
ð
b
n
a
n
Þ
;
n
P
1and using the previous equation consecutively we get:
b
n
a
n
¼
12
n
1
ð
b
a
Þ
;
n
P
1
:
ð
2
Þ
Here, the length of the srcinal interval is
b
a
. It follows from the algorithm that
a
is in either [
a
n
,
c
n
] or[
c
n
,
b
n
] hence the following inequality holds:
j
a
c
n
j
6
c
n
a
n
¼
b
n
c
n
¼
12
ð
b
n
a
n
Þ ð
3
Þ
Substituting (2) in (3) we get:
j
a
c
n
j
6
12
n
ð
b
a
Þ
This shows that the iterates
c
n
converge to
a
as
n
! 1
[1].If
12
n
ð
b
a
Þ
6
e
satisﬁes, then
j
a

c
n
j
6
e
. Taking logarithms of both sides of inequality
12
n
ð
b
a
Þ
6
e
we conclude the following estimate:
n
P
log
ð
b
a
e
Þ
log2
ð
4
Þ
The bisection method has some advantages and disadvantages. Some of its advantages are: the bisectionmethod is always convergent. Since the method brackets the root, the method is guaranteed to converge.As an iteration is conducted, the interval gets halved. So one can guarantee the error in the solution of theequation. Some of its disadvantages are: The convergence of bisection method is slow as it is simply basedon halving the interval, if one of the initial guesses is closer to the root, it will take larger number of iterationsto reach the root, if a function
f
(
x
) is such that it just touches the
x
axis such as
f
(
x
) =
x
2
it will be unable toﬁnd the lower guess
a
and upper guess
b
, satisfying Eq. (1).It is well known that the Fibonacci sequence has various application areas. One of the most importantapplication of Fibonacci sequence is the number of steps for ﬁnding the root of continuous functions. By using
k
Lucas numbers, we can ﬁnd the root of a continuous function on an interval [
a
,
b
]. We use the
k
Lucas numbers here because it provides an excellent opportunity for discovering new algorithms for mathematical problems. The Fibonacci sequence {
F
n
} is deﬁned as
F
0
= 0,
F
1
= 1 and
F
n
=
F
n
1
+
F
n
2
for
n
P
2. The wellknown Fibonacci sequence is:1
;
1
;
2
;
3
;
5
;
8
;
13
;
21
;
34
;
55
;
. . .
We consider a generalization of the Fibonacci sequence called the
k
Fibonacci sequence for positive integer
k
P
2. The
k
 Fibonacci sequence
f
g
ð
k
Þ
n
g
is deﬁned as:
g
ð
k
Þ
1
¼ ¼
g
k
ð
k
2
Þ
¼
0
;
g
k
ð
k
1
Þ
¼
g
k
ð
k
Þ
¼
1and for
n
>
k
P
2,
g
ð
k
Þ
n
¼
g
ð
k
Þ
n
1
þ
g
ð
k
Þ
n
2
þ þ
g
ð
k
Þ
n
k
:
g
ð
k
Þ
n
is called the
n
th
k
Fibonacci number [2].The
k
Lucas sequence
f
L
ð
k
Þ
n
g
is deﬁned by
L
ð
k
Þ
n
=
f
ð
k
Þ
n
1
þ
f
ð
k
Þ
n
þ
k
1
which is called the
n
th
k
Lucas number. It iswell known that
L
ð
k
Þ
j
¼
2
j
1
, 1
6
j
6
k
1, and
L
ð
k
Þ
k
¼
1
þ
2
k
1
.
340
A. Demir / Applied Mathematics and Computation 198 (2008) 339–345
As mentioned above Fibonacci and Lucas numbers have many applications. Lucas numbers are used in theproblems for which the root of a continuous function. By using
k
Lucas numbers we reduce the interval of uncertainity to ﬁnd the root of a continuous function. This way we reduce the length of the interval, whichcontains the root, faster. We ﬁnd the root of a given continuous function on [
a
,
b
] by evaluating points determined according to
k
Lucas sequences.In this study, we developed an algorithm which determine the root of a continuous function by using
k
Lucas numbers. The bisection algorithm which ﬁnds the root of a continuous function does not work for somecontinuous functions, for example
f
(
x
) =
x
2
deﬁned on the interval which is symmetric with respect to srcin.In this paper, we developed an algorithm which ﬁnd a root of a given continuous function, faster. Based on thebisection method, we develop an algorithm which ﬁnd the root of any continuous function.
2. Trisection algorithm
Let us consider the following problem of determining the root of a continuous function on the interval[
a
,
b
]:
f
ð
x
Þ ¼
0Let
l
k m
denote
m
th
k
Lucas number. The algorithm we developed is as follows:Step 1. Input
xL
,
xR
,
f
(
x
),
.Step 2. Take iternumber = 0,
m
= 0.Step 3. iternumber = iternumber + 1.Step 4. If
f
(
xL
) = 0 then root =
xL
and go to Step 17.Step 5. If
f
(
xR
) = 0 then root =
xR
and go to Step 17.Step 6.
xC
¼
xR
þ
xL
2
.Step 7. If
f
(
xC
) = 0 then root =
xC
and go to Step 17.Step 8.
m
=
m
+ 1.Step 9. Calculate the points:
x
m
¼
xL
þ ð
xR
xL
Þ
l
k n
m
þ
1
l
k n
m
þ
3
,
x
0
m
¼
xL
þ ð
xR
xL
Þ
l
k n
m
þ
2
l
k n
m
þ
3
.Step 10. If
f
(
x
m
) = 0 then root =
x
m
and go to Step 17.Step 11. If
f
ð
x
0
m
Þ ¼
0 then root =
x
0
m
and go to Step 17. Step 12.Case I.
f
(
xL
) f(
x
m
) < 0 then
xR
=
x
m
.Case II.
f
(
x
m
)
f
(
xC
) < 0 then
xL
=
x
m
and
xR
=
xC
.Case III.
f
ð
xC
Þ
f
ð
x
0
m
Þ
<
0 then
xL
=
xC
and
xR
¼
x
0
m
.Case IV.
f
ð
xR
Þ
f
ð
x
0
m
Þ
<
0 then
xL
¼
x
0
m
.Step 13. If (
xR
xL
) >
go to Step 3.Step 14. root =
xL
.Step 15. Find the points where the function takes its maximum and minimum values.Step 16. Check whether these points are roots of the function or not.Step 17. end.
3. Examples
Now let us analyze and compare trisection method with bisection method by examples. We will explain theadvantages and disadvantages of this method against bisection method.
Example 1.
f
(
x
) =
x
2
+
x
6 on the interval [1,10]It is obvious that the root of
f
(
x
) is
x
= 2 on the interval [1,10]. As it seen from Table 1, when the root of thefunction
f
(
x
) is close to the endpoints of the interval, trisection method works faster than bisection method.However, when the root close to the middle point, bisection method works faster than trisection method. Thereason of this result is the intervals on the right and left hand sides are smaller than the interval in the middle(Fig. 1).
A. Demir / Applied Mathematics and Computation 198 (2008) 339–345
341
As it seen from Table 1, on the interval [1,5], the bisection method ﬁnds the root of the function at the second iteration but trisection method reach the result at the 28th step since the root 2 is closed to the middlepoint of the interval [1,3] which is obtained at the second step of the bisection method.
Example 2.
f
(
x
) =
x
2
on the interval [
5,5].As it mentioned above, the bisection is not able to ﬁnd the root of the function
f
(
x
) =
x
2
on the interval[
5,5] since this function is tangent to the
x
axis at the point
x
= 0 which is the root of the function. Onthe other hand, trisection method is able to ﬁnd the root of this function since it takes the maximum and minimum value of the function into account (Table 2; Fig. 2).
On the interval [
5,5] trisection method ﬁnds the root of the function at the ﬁrst step since
x
= 0 is themiddle point of the interval [
5,5] and the root of the function. However, it ﬁnds the root of the functionon the interval [
3,10] at 43rd since
x
= 0 is not the middle point of the interval and we check the pointsat which
f
(
x
) takes its maximum and the minimum value, whether it is root or not at the last part of thealgorithm.
Table 1The table of iteration number of trisection method and bisection method
k
= 5 Iteration number for trisection Iteration number for bisection[1,5] 28 2[1,10] 27 44[1,20] 28 45[
2,3] 30 43[
2,10] 28 44
1 2 3 4 5 6 7 8 9 10–20020406080100120
Fig. 1.
f
(
x
) =
x
2
+
x
6.Table 2The table of iteration number of trisection method and bisection method
k
= 5 Iteration number for trisection[
5,5] 1[
3,10] 43[
10,2] 43342
A. Demir / Applied Mathematics and Computation 198 (2008) 339–345
Appendix A. A matlab code to ﬁnd the root of a given continuous function by using trisection method
xL
= input(‘Enter the left end point of the interval=’);
xR
= input(‘Enter the right end point of the interval=’);
k
= 5;
n
= 70;
a
=
xL
;
b
=
xR
;for
j
= 1:
k
1,
l
(
j
) = 2
j
1
;end;
l
(
k
) = 2
k
1
+ 1;for
j
=
k
+ 1:250,toplam = 0;for
i
=
j
5:
j
1,toplam = toplam +
l
(
i
);end;
l
(
j
) = toplam;endeps = 0.000000000001;iternumber = 0;
m
= 0;while (
xR
xL
) > epsiternumber = iternumber + 1;if
f
(
xL
) = = 0root 3 =
xL
;eps = 5;display (‘root = root 3’)endif
f
(
xR
) = 0root 4 =
xR
;eps = 5;
–5 –4 –3 –2 –1 0 1 2 3 4 50510152025
Fig. 2.
f
(
x
) =
x
2
.
A. Demir / Applied Mathematics and Computation 198 (2008) 339–345
343