Professional Documents
Culture Documents
Vedic Algorithms Revisited by Mathematics Teachers and Computer Science Teachers: A Comparative Study
Vedic Algorithms Revisited by Mathematics Teachers and Computer Science Teachers: A Comparative Study
Sarah Pollack
Department of Science Teaching
Weizmann Institute of Science, Rehovot
Israel 76100
Tel: 972-8-934-2493 Fax: 972-8-934-4115
ntsara@wis.weizmann.ac.il
Nurit Zehavi*
Department of Science Teaching
Weizmann Institute of Science, Rehovot
Israel 76100
Tel: 972-8-934-3156 Fax: 972-8-934-4115
Nurit.Zehavi@weizmann.ac.il
ABSTRACT
Using examples from ancient Vedic Mathematics, we describe the interaction between
graduate students in Mathematics teaching and Computer Science teaching as they
explored Vedic Mathematics. This subsequently led to a comparative study of Vedic
Mathematics in workshops for a group of computer science teachers and a group of
mathematics teachers. Each group of teachers was exposed to the Vedic algorithms
and discussed (a) the knowledge required to perform the methods, (b) the relationship
between the mathematical justification and the computer program, and (c) the
didactical value. We found that the two groups had a different point of view that
influenced their interests, the knowledge they pursued, and the procedures they
employed as they studied. However, each group gained from the encounter with the
other discipline. Based on the findings, we discuss the epistemological and
pedagogical issues that these two groups of teachers can learn from each other in
regard to algorithmic thinking.
KEYWORDS
Interdisciplinary projects, pedagogical issues, improving classroom teaching
1.
INTRODUCTION
mathematical norms. They claimed that programming norms could help in improving
the socio-mathematical norms to be more reality-adapted, for example, to establish
the perception that difficult questions are not solved in one shot, but rather by a chain
of guessing and conjecturing interlaced with meticulous testing and debugging.
The contribution of mathematics to CS education and later to the quality of software
engineers has also been intensively discussed. For example, Hoare (1989) claimed
that mathematical knowledge is a crucial component of the professional
programmers knowledge. In fact he perceived programmers as the engineers of
mathematics. Recently, a group of CS scholars has warned repeatedly from what
they refer to as mathematics phobia in the CS curriculum, which damages the quality
of future programmers. For a more detailed review of the relationship between
mathematical knowledge and CS studies, see Henderson et al. (2001) and the CUPM
website.
Ben-David Kolikant and Pollack (2002) described an instructional approach to
enhance the mathematical orientation in programming skills among beginning
Computer Science students, and demonstrated its application. They contend that
mathematics has three roles in CS education: (a) a knowledge domain of problems:
the understanding and solving of many problems require an adequate background in
mathematics, (b) tools and skills that facilitate the process of solution; these tools can
be provided to the student when viewing a problem from a mathematical perspective,
and (c) an anchor to concepts in CS whose association with mathematics can
contribute to the clarification of their meaning. A different approach for enabling the
cross-fertilization between mathematics education and CS education was proposed by
Gal-Ezer & Lichtenstein (1997). They discussed the possibilities of removing the
artificial boundaries between the two disciplines, which they claim exist in formal
education, by using topics that fit both CS curricula and mathematics curricula, such
as set theory, as well as encouraging an algorithmic approach.
The motivation for the comparative study reported in this paper stems from the
experience gained in exploring ancient Vedic algorithms in a graduate course
Integration of topics in mathematics through a Computer Algebra System (CAS).
The course, given by N. Zehavi (the last author), was held at the Weizmann Institute
of Science. The participants were graduate students in mathematics teaching or CS
teaching. One of the topics in the course was concerned with investigating several
methods of Vedic mathematics (see Section 2 for a historical perspective of the Vedic
Mathematics and Section 4 for a description of two Vedic mathematics methods). To
this end, the students used a computer-algebra programming environment (Section 3)
to develop and implement algorithms that simulate the Vedic methods. We noticed
that students from these two groups approached the problems differently and each
group favored different features and topics. However, these differences did not
prevent them from sharing and exchanging ideas, but rather had the effect of
stimulating them in a fertile vein of interesting new problems and solution techniques
(Section 5).
This experience motivated us to explore the perspectives that teachers of both
disciplines possess. The significance of exploring the teachers communities is clear
due to the their pedagogical role as formulators of socio-professional norms. We
conducted similar workshops for each of the groups. Specifically, we introduced the
teachers to two methods of Vedic Mathematics and their implementation using CAS
(see Section 6). The teachers were engaged in using these methods and in proving
their correctness, namely, they dealt with mathematical problems of an explicit
algorithmic type. In each group we initiated a discussion about the methods and their
pedagogical value in order to explore the perspectives of each group.
The findings clearly indicate that the two groups have a different point of view, which
was demonstrated by different answers to the same questions, and different
approaches to the same assignments. The findings are described in Section 7. Finally,
Section 8 discusses the possible cooperation between the groups as well as the
benefits of sharing experiences.
2.
the first centuries of the second millenium spherical trigonometry and Pell equations
(Bhaskara) were developed. The discovery of power series for trigonometric functions
took place around 1500. Hindu mathematians were inclined to further develop topics
in number theory and indeterminate analysis in particular. However, these aspects did
not contribute to later developments in modern mathematics such as analytic
geometry, calculus, and algebra.
The term Vedic Mathematics refers to a set of sixteen mathematical sutras and their
corollaries derived from the Vedas. The Vedas are ancient texts written in Sanskrit; the
word Veda means knowledge knowledge both within and among the senses. It is
conjectured that the vedic mathematical system was part of the Sulvasutras. This is a
system of calculations based on easy-to-follow rules and principles that can be used
effectively to solve problems in arithmetic, algebra, geometry, and trigonometry. The
Vedic system was rediscovered between 1911 and 1918 by Sri Swami Bharati Krisna
Tirthaji and has been re-structured for use in schools. It is being taught in some
schools in several countries as well as being used for scientific applications (see
references to Web sites).
3.
WHY CAS?
Johnson (2001) suggested that one of the major obstacles in integrating programming
into the mathematics curriculum is the choice of the programming environment, since
learning to program is not a trivial task. However, he claimed that recently developed
computerized environments, such as the Spreadsheet and the Computer Algebra
System (CAS) are easy to manipulate and master.
From an algorithmic point of view, the Vedic rules are sets of instructions that solve
problems, that is, algorithms. Therefore, Computer Algebra Systems, having both
mathematical and programming power, are suitable for revisiting the ancient Vedic
mathematics. The CAS technology can perform symbolic mathematics calculations.
We used Derive, which is based on the declarative paradigm of programming
(functional programming), a set of pre-defined functions, and programming tools.
There are several pedagogical advantages of using such an environment with both
mathematics and CS students:
-1 It provides the students with a convenient environment for inquiry of both
mathematical and algorithmic problems, mainly due to the variety of
representations as well as the built-in functions.
-2 Using the symbolic mechanism, it is easy to verify the correctness because it
provides immediate feedback and powerful tools for simplifying mathematical
expressions.
-3 The environment enables introducing students to programming. For example, the
pre-defined functions can reinforce explanations of re-use and encapsulation
(black-boxes), which are fundamental concepts of programming.
-4 Numbers are represented as a list of digits by the software, and therefore big
numbers can be manipulated easily, using many pre-defined functions such as
DIM(S), which counts S digits, ELEMENT(S, N), which returns the Nth digit of
S, and INSERT (X, S, N), which inserts the digit X in position N into number S.
Thus, we concluded that CAS software provides a suitable environment for both
communities of CS and mathematics practitioners.
4.
Case II: If xs length is smaller than ys length, then perform the following
procedure:
10
In both cases the number of digits of the suffix should equal the number of digits
of y, by adding leading zeroes (see example 4 for case I and example 5 for case
II).
4. 98*99 98 1 | 99 (98 1) => 97 | 2 97 | 02
5. 5499*99 54 | 99*99 5499 (54 + 1) | 99 (99 1) 5444 | 1
5444 | 01
The matching algorithmic problem for this method is as follows: write a function that
implements the Vedic method and multiplies two natural numbers x and y, whereas
ys digits consist entirely of nines.
1.
If x y
For a suitable algorithm we used the pre-defined Derive function FLOOR, in order
Prefix = x 1
= y (instruction:
x 1)
to translate Suffix
the Vedic
divide the number with | to prefix and suffix.
1.2 Else { if x>y} compute:
If the number of digits of the suffix is smaller than the number of digits of y, add leading
zeroes.
3.
11
Compose the two parts (prefix and suffix) into one number i.e. compute:
Prefix * (y + 1) + Suffix
the length of the two multipliers, was translated to the equivalent two cases, x y and
x > y. The cases are equivalent because ys digits consist entirely of nines, and
therefore any number whose number of digits is equal, smaller, or greater than y
would be smaller, equal or greater than y, respectively. Figure 1 presents the algorithm
for this method.
In order to prove the correctness of the method, we show that in both cases, x y and
x > y, the application of the Vedic method yields x *y. The scheme of the proof for case
I and case II are illustrated in Figure 2 and 3, receptively.
Case I: x y. The first line in Figure 2 presents the result of applying the Vedic
method on x and y, according to case I. The result is a concatenation of the prefix x 1, and the suffix y - (x-1). The composition of the number is determined by
multiplying the prefix, with the adequate power of ten, y + 1, and adding the suffix, as
in the second line. The third line is a simplification of the expression obtained in the
second line, which finally yields x*y.
12
Case II: x > y The first and the second line in Figure 3 present the calculation of x 1,
and x2, according to the Vedic method. The third line demonstrates the composition of
the number by multiplying the prefix with the suitable power of ten, y + 1, then
adding the suffix. The rest of the lines represent the process of simplifying the
expression of the number, finally yielding x*y.
Method 2
Multiplication of two numbers x (the multiplicand) and y (the multiplier), using
the Urdhva-Tiryagbhyam Sutra, which means: Vertically and Cross-Wise.
The Vedic instructions are represented visually. The method works for numbers of
any length. Here we demonstrate two cases: the multiplication of two-digit numbers
illustrated in Figure 4 and the multiplication of three-digit numbers illustrated in
Figure 5.
Case I: The multiplication of two-digit numbers ac*bd:
13
14
Examples:
3. 194*285 = 55290
1*2| 1*8 + 9*2 | 1*5 + 9*8 + 4*2 | 9*5 + 8*4 | 4*5
2 | 26 | 85 | 77 |20 2 | 26 | 85 | 77 +2 | 0 2 | 26 | 85 + 7 | 9 | 0
2 | 26 + 9 | 2 | 9 | 0 2 + 3 | 5 | 2 | 9 | 0 5 | 5 | 2 | 9 | 0
In case that the lengths of the two multiplication numbers are not the same, we
should add zeroes at the beginning of the shortest number.
The development of a suitable algorithm: The main difficulty is in forming a
general rule for any two numbers, based on the cases for two-digit numbers and
three-digit numbers, as presented above. The mathematical justification for the
Vedic rules using polynomial representation of the numbers, where x = 10, can be
a big help:
(ax + b)*(cx + d) = acx2 + (ad + bc)x + bd
(ax2 + bx + c) *(dx2 + ex + f) =
adx4 + (ae + bd)x3 + (af + be + cd) x2 + (bf + ce)x + cf
Figure 7 presents the intermediate products (obtained in the first step of the Vedic
method Vertically and Cross-Wise) according to the digits of the resulting number
formed by these products.
---insert figure 7 here --The relation between the digits position and the power values in the polynomial
representation led to a general representation of the multiplication: every digit Z, in
position k of the resulting number, is calculated by summing the multiplications of
pairs of digits Xi and Yj, whose positions i and j are summed up to k, as in the
15
4.
16
how the algorithms were invented. At the same time, the CS teaching students were
very much interested in the future. These students discussed the possible contribution
of the implementation of these methods to the solutions of other problems, such as the
multiplication of big numbers.
We also noticed that the two groups of students approached the activity of
constructing the computer program differently. For example, CS students
continuously tested numerical examples, in order to verify the correctness of the
program. In contrast, the mathematics teaching students deduced correctness from the
symbolic manipulation of (x - 1)*(y+1) + (y - (x -1)), which simplifies to xy.
However, we noticed a mutual appreciation between the CS-teaching students and the
mathematics-teaching students. The CS-teaching students found the mathematical
inquiry to be productive since it was used to improve the efficiency of the algorithms.
The mathematics-teaching students appreciated the ability of the CS-teaching students
to talk with the computer at a higher level than merely using manipulations as a
way to provide answers. Eventually, they participated in a programming tutorial
session that the CS-teaching students held.
5.
A COMPARATIVE STUDY
The aim of the comparative study was to identify veins for cross-fertilization among
CS teachers and mathematics teachers. To this end we conducted two identical
workshops, one to a group of 30 secondary mathematics teachers, and the second to a
group of 18 CS teachers. Each workshop consisted of the presentation of each of the
two Vedic methods previously described. First, we introduced the teachers to the
method and discussed the Vedic method in comparison with the traditional method
regarding the criteria of the knowledge required to perform the method. Second, we
17
6.
FINDINGS
For each group we will start by describing the teachers general attitude during the
workshop. Then we will present the teachers responses to our three questions as
reflected in the discussions: (a) the knowledge required to apply the methods in
comparison with the traditional method, (b) the relationship between the mathematical
correctness proof and the algorithms that implement the methods, and (c) the
didactical potential of the methods and their correctness proof.
18
must master subtraction from zeros. They admitted that the Vedic method requires
less: one only has to master subtraction from 9-digit numbers, which is easier, with no
need to master multiplication in its entirety. The difficulty in using the Vedic method
is the need to remember the rule.
Knowledge required (for method 2) Multiplication of two three-digit numbers by
pencil and paper requires nine multiplications of one-digit numbers, locating the intermediate results correctly according to the two multiplicands, dealing with the carry
over and then summing up these results, and again dealing with the carry over. In the
Vedic method we still have the same nine multiplications of one-digit numbers, but
the locations of the results are clearer and carry over is being dealt with only once,
after all the multiplications are over. Thus, the usefulness of the Vedic method stems
from the option of performing the intermediate multiplications freely and the simpler
location of the intermediate results.
The relationship between the justification and the algorithm (in method 1)
The teachers argued that justifying the method requires algebraic knowledge. Most of
the teachers discussed the algebraic structures of the mathematical justification. Some
of the teachers spontaneously concentrated on justifying each of the methods using
arithmetic tools. For example, the following justification to method 1 simplified the
Vedic expression into the traditional multiplication:
243 * 999 = 243 1 | 999 - (243 1) =
(243 - 1) * 1000 + 999 243 + 1=
= 243000 1000 + 1000 243 = 243 * (1000 - 1) = 243 * 999
19
A few of the teachers insisted on going in the opposite direction, from the exercise to
the Vedic rule, in an attempt to explain how the Vedic came to invent the rule,
where x y:
243 * 999 = 243 * (1000 - 1) = 243 * 1000 243 =
243 * 1000 + 1000 - 1000 243= (243 - 1) *1000 + 999 + 1 - 243 =
243 1 | 999 - (243 - 1)
Similarly, they backtracked an example for case 2, where x > y:
5489 * 99 = 5489 * (100 1) = 548900 5489 =
548900 5400 100 + 99 89 + 1 =
(5489 (54 + 1)) * 100 + 99 (89 1) =
5489 (54 + 1) | 99 (89 1)
The algorithm and the program did not help these teachers in their justification of
the method. They claimed that the execution of the program could reflect its
correctness but still a solid proof needs to be constructed.
The relationship between the justification and the algorithm (in method 2)
The algorithm that implements method 2 was based on the polynomial
representation of the multiplication of the numbers. This representation was a
satisfactory proof for the mathematics teachers.
The didactical value In general, most of the mathematics teachers preferred the first
method because it was piquant. They commented on a painful familiar obstacle: what
would the students say regarding the benefit of these methods compared to the simple
use of calculators. The benefit of working with big numbers in a rather convenient
20
representation of the number (rather than with using the exponent, which is built-in in
calculators) sounded like a good argument to them. Most of the teachers, however,
considered these methods as intellectual amusement, for enrichment and variety. Only
two teachers believed that these methods could be used as curricular activities: one
suggested using the methods as a type of verbal problems for which the students need
to translate the verbal information into algebraic patterns. The other suggested
preparing exercises of symbolic manipulations on patterns. In general the
mathematics teachers agreed that the instruction of these methods fit junior high
students better than high school students, because of their arithmetical characteristics.
One attribute of the algorithm that was appreciated by the mathematics teachers was
the calculation of the length of the result of multiplication according to the length of
the multiplicands. For example, the multiplication of an m-digit number by an n-digit
numbers will result in a number with m + n digits, or m + n -1. They offered using
this calculation as a verification method of products calculations and suggested
integrating this method into the class activities. However, several teachers claimed
that junior high students might find the polynomial representation, used in method 2,
difficult.
Finally, most of the teachers agreed that relating the history background would
interest the students and motivate them to explore these methods. It will also serve as
an opportunity to reflect on the nature of mathematical development, which most of
mathematics students are totally alien to.
The CS teachers
21
22
23
All the teachers agreed that developing the algorithms requires an understanding of
the rationale and underlying methods, but not all of them agreed that the rationale is
the mathematical proof, but rather classified mathematical patterns and proofs as one
resource for ideas a developer can use.
The didactical value - Most of the CS teachers preferred the second method because it
was more general than the first method, and declared the first method as nice but
useless. This attitude can be explained by the fact that finding the regularities, and
aspiring for a general solution is a basic activity in the CS class.
All the CS teachers except for one agreed that these methods could be used as
curricular activities for teaching and practicing fundamentals in CS. They suggested
exercises to practice the DIV and MOD operations, to exemplify and practice
representative input examples, and to demonstrate the concepts of complexity and
efficiency of algorithms. Only one teacher suggested teaching these methods as they
are, for enrichment. In addition many CS teachers indicated that Method 2 has the
potential to serve as a different but efficient solution to the practical, known problem
of multiplying two long numbers.
7.
DISCUSSION
First we will characterize the differences between the approaches of the two groups to
the two methods. Then we will discuss the cross-reference and the potential crossfertilization in order to formulate our recommendation for mutual mathematics and
computer science workshops.
Procedural versus declarative point of view - The difference between the groups was
shown even in their responses to the allegedly objective question: what is the
knowledge required to perform the methods. The mathematics teachers described the
24
required knowledge for both methods in terms of other algebraic methods, such as
subtracting from zero, for method 1, and dealing with the carry over for method 2.
They did not specify the basic operations that comprise these methods. In contrast, the
CS teachers specified each of the very basic operations that comprise the process. For
example they detailed the operations that constitute the method of dealing with the
carry over.
Justification techniques The mathematics teachers justified the correctness of
method 1 by moving backward and forward regarding specific numerical examples.
This justification served two goals: to justify correctness and to satisfy their eagerness
to understand the historic origins. CS teachers worked in the opposite direction. They
mapped the (input) domain into categories of numbers; for each they chose a few
numerical examples and applied the method, only to verify that it works.
Appreciation of problems The mathematics teachers characterized these methods as
piquant. They looked for unique cases that they described as beautiful, and therefore
they preferred method 1 over method 2. The CS teachers appreciated the possible
contribution for solving real-world problems, such as multiplication of big numbers
under the constraints of the space limitation of the digital computer. They also
appreciate generality. Therefore, the CS teachers preferred method 2 over method 1,
claiming that there is no point in teaching method 1 because it is useless whereas
method 2 is general and useful.
Integration of the methods in the instruction Most of the mathematics teachers
group perceived the instruction of the Vedic methods as a valuable enrichment
activity, in addition to the regular syllabus. The CS teachers, in contrast, pointed out
on several issues that can be practiced by using the Vedic methods, based on their own
analysis of the required knowledge.
25
Mutual impact The mathematics teachers group was enthusiastic about calculating
the numbers length as a result of arithmetic operations. Some of them decided to
integrate it into their instruction, because they thought that these calculations might
encourage the students to perceive numbers as objects rather than just performing
arithmetic manipulations. The CS-teachers group was excited about the power of
mathematics, as reflected in using method 2 to solve realistic problems. However,
some of them argued that a programmer does not necessarily have to understand the
idea underlying an algorithm, as long as he knows that the algorithm is correct. We
concluded that teachers of both disciplines borrowed ideas from the other to improve
teaching their subject matter.
Recommendations
In this work we learned that exposing two similar yet different methods to CS
teachers and mathematics teachers groups resulted in different responses. We showed
that the CS teachers and mathematics teachers groups had different preferences and
areas of interest, and consequently, their pedagogical decisions were essentially
different. Yet the exposure of the teachers to both mathematical and CS knowledge
regarding the Vedic methods, prompted each group to appreciate and acquire bits of
knowledge usually possessed by the other group. We therefore recommend
conducting a mutual workshop in which the teachers from both disciplines will
together investigate and develop algorithms. We believe that there will be enough
interest and that the disagreement that may arise between these two groups because of
their different points of view would contribute to a fertile discourse and to a mutual
enrichment.
26
Mathematics teachers will benefit from the mental tool of building algorithms (Knuth,
1974). In addition, the encounter with CS teachers can provide them with new images
of familiar objects as had occurred in this workshop (the partition of numbers to
prefix and suffix, calculation of the number length, and the use of a polynomial to
develop an algorithm). This encounter can also result in acquiring more pre-defined
functions to their teaching repertoire, such as FLOOR and DIM.
CS teachers will also benefit from this encounter. An encounter with a community that
tends to perform investigations might influence the CS teachers group to inquire about
the problem, rather than just focusing on the implementation. Consequently, their
solution would become more elegant and more efficient. Finally, the meeting between
practitioners of the old science of mathematics and the young science of CS can teach
the CS teachers to appreciate the historical perspective of mathematical developments
and later to project them toward the perspective of CS development.
An additional advantage of a meeting between CS teachers and mathematics teachers
is the reinforcement of mutual activities in school. For example, teaching topics that
fit both curricula. Moreover, a cross-reference attitude may enrich the students with a
more holistic attitude toward problem solving.
Finally, the CAS technology offers a suitable environment for activities of that type,
since it can address the needs of both mathematical inquiry and algorithm
development, and therefore is convenient for both groups.
ACKNOLEDGEMENT
The authors are grateful to Dr. Pushpa Agashe for her remarks regarding the Vedic
Mathematics.
27
REFERENCES
Agrawala, V.S. (1971), Vedic Mathematics, New Delhi: Motilal Banarsidass.
Ben-David Kolikant, Y. & Pollack, S. (2002). Improving mathematically oriented
programming skills. The Conference of Frontiers In Education, Boston 2002, session
T1G, 3-8.
Boyer, H. F. (1968). A History of Mathematics. New York: Wiley.
Gal-Ezer, J. & Lichtenstein, O. (1997). A mathematical-algorithmic approach to sets:
a case study. Mathematics and Computer Education, 31(1), 33-42.
Kats, V. J. (1993). A History of Mathematics. New York: Harper Collins.
Henderson, P., B., Baldwin, D. et al. ( 2001). Striving for mathematical thinking.
ACM SIGCSE Bulletin Inroads, 33(4), 114-124.
Hoare, C. A. R. (1989). Computer science. In C. A. R. Hoare & C.B Jones, Essays in
Computing Science (pp. 89-101). Englewood Cliff, NJ: Prantice-Hall.
Integrating Mathematical Reasoning into Computer Science Curricula, CUPM
Discussion Papers and Interim Reports, (2001). http://www.maa.org/news/cupm.html.
Johnson, D. (2000). Algorithms and programming in the school mathematics
curriculum: support is waning - is there still a case to be made? Education and
Information Technologies, 5 (3), 201 214.
Knuth, D. (1974). Computer science and its relation to mathematics. American
Mathematical Monthly, 81(4), 323-343.
Knuth, D. (1985). Algorithmic thinking and mathematical thinking. American
Mathematical Monthly, 92(3), 170-181.
28
29
VITAE
Yifat Ben-David Kolikant has submitted her doctoral thesis at the Department of
Science Teaching at the Weizmann Institute of Science where she is a member of the
computer science group. She has developed materials for computer-science teachers
and conducted in-service teacher training. Her doctoral research explored the
dynamics of knowledge evolution of high school students who studied concurrent and
distributed computation. Her research interests involve the characterization of
dynamic learning processes both from the cognitive and social aspects in order to
design effective instructional methods.
Sarah Pollack has recently received her Ms.c degree form the Department of
Science Teaching at the Weizmann Institute of Science where she is a member at
the computer science group. She has developed materials for computer-science
teachers and conducted in-service teacher training. In her research she designed
learning materials for project-based learning in computer science and evaluated
these materials.
Dr. Nurit Zehavi has been working on curriculum development and research
in the Science Teaching Department at the Weizmann Institute of Science
since 1972. She has coordinated mathematical software development and
professional training courses for teachers on using computers in the
classroom. Her current research interest is in using computer algebra for
teaching mathematics. She is the head of the MathComp project, which was
initiated in 1996 with the aim of integrating computer algebra systems
into the mathematics curriculum.
30
LIST OF FIGURES
31
If x y
then compute:
Prefix = x 1
Suffix = y ( x 1)
Else { if x>y} compute:
x1 = FLOOR(x, y + 1)
x2 = x FLOOR(x , y + 1) * (y + 1)
Prefix = x (x1 + 1)
Suffix = y (x2 1)
If the number of digits of the suffix is smaller than the number of digits of y, add leading
zeroes.
Compose the two parts (prefix and suffix) into one number i.e. compute:
Prefix * (y + 1) + Suffix
32
[x-1, y (x-1)]
(x 1) * (y + 1) + y (x 1)
=x*y + x y 1 + y x + 1
= x*y
Figure 2:the correctness proof of the Vedic method By One Less than the One Before for case I
33
x1 = FLOOR( x / (y + 1))
x2 = x x1* (y + 1)
(x (x1 + 1)) * (y +1)+ y (x2 1) =
(x (x1 + 1)) * (y + 1) + y (x x1* (y + 1) 1) =
x* (y + 1) x1* (y+1) (y+1) + y x + x1* (y + 1) + 1 =
x * y + x - x1* y - x1 y 1 + y x + x1* y + x1 + 1 = x * y
Figure 3: the correctness proof of the Vedic method By One Less than the One Before
for case II
34
35
36
37
a*d
a*e + b*d
Digit
position (k)
x (i)
y (j)
a*f + b*e
+ c*d
b*f + c*e
c*f
x*y
Figure 7: The components of each digit in the multiplicand x, multiplier y, and the result x*y
38
Figure 8: The algorithm for calculating the intermediate products for method 2
39
40