|
Using Basic Maple Programming in Elementary
Mathematics Courses
by Miroslaw Majewski , Inter-University Institute of Macau
An elementary knowledge of Maple programming in the high school classroom
is a powerful teaching tool that is more easily acquired than most educators
realise. For example, writing Maple programs helps me to explore recursive
functions and to trace algorithms with my own students.
Choosing among the flood of technology aids for mathematics education
can be daunting. Educators used to assess such programs solely on their
user-friendliness, thinking that programs requiring knowledge of a programming
language are too difficult for classroom use. This was especially believed
of Maple and Mathematica®. However, we began to notice that teaching
mathematics requires many activities that are not available in point-and-click
programs. For instance, we have to explore algorithms, use recursive functions
and build complex constructions in 2-D or 3-D geometry. All these activities
have many steps, and their nature resembles writing a kind of a program.
These activities can be practiced if we use a technology aid that features
a programming language. One such aid is Maple 8, whose programming language
is quite easy to learn.
For teaching, you only need a basic set of Maple commands and control
structures. In my experience, using about 30 commands, you can successfully
introduce most of the topics of high school mathematics. For example,
for solving equations, you can use Maples solve
command, as in the following example:
> solve( x^2 + 1 = x^4, x);
If you wish to obtain results in a decimal form, you may use the fsolve
command or just convert the obtained result to decimal form using evalf:
> evalf( % );
Other useful Maple commands for introductory classes are: expand,
simplify, factor, combine, diff (for differentiate), int
(for integrate), plot, plot3d, subs
(for substitute).
Despite the usefulness of these commands, you and your students may feel
that something is missing. For example, the command solve
works like a black box and requires little understanding from the students
of how equations are actually solved. Is Maple merely a device for students
to do assignments without learning? Far from it. By introducing one or
two Maple programming commands, you can give your students a chance to
explore mathematics without using the black-box commands. There is no
better way to learn mathematics than to be forced to implement it! Here
is a simple example of a Maple program written by one of my students to
solve quadratic equations:
FindQuadraticRoots := proc( a, b, c )
local det;
det := b^2 - 4*a*c;
if det >= 0 then
x1 := (-b-sqrt(det))/(2*a):
x2 := (-b+sqrt(det))/(2*a):
sol := {x1,x2}:
else
sol := {}:
print("No real solutions")
end if;
sol;
end:
Now you can use FindQuadraticRoots in a
similar manner to the operation solve.
> FindQuadraticRoots (1, -3, 2);
With knowledge solely of Maples if
then
else
construction, this student learned how quadratic equations are solved
by implementing the process in Maple on his own.
Exploring Algorithms with Maple
Most mathematical processes taught in high school are algorithmic: finding
roots of a polynomial, calculating the determinant of a matrix, etc. Teachers
focus on teaching these algorithms rather than obtaining numeric solutions.
Thousands of examples in thousands of books are written solely to give
students practice in carrying out algorithms. Thus, using the Maple programming
language, students can explore how the given algorithm works and learn
its tiny secrets secrets that are often missed in the traditional
approach.
While teaching discrete mathematics, I often use the Euclidian algorithm
to calculate the GCD of two integers. Although this algorithm is simple,
students find it difficult unless I give them an opportunity to explore
its nature by implementing it as a Maple procedure. Here is how one of
my students implemented this algorithm.
> Euclid := proc( a, b)
if a = b then return a;
else
if a > b then return Euclid( a-b, b);
else return Euclid( a, b-a )
end if;
end if;
end:
> Euclid( 71755875, 61735500 );
Maple vs. Other Programming Languages
I have been teaching mathematics for a very long time. I used to model
many topics in this discipline with PASCAL or Microsoft® Excel®
spreadsheets. However, there were always topics that were impossible to
illustrate. After switching to Maple, I found that I could easily demonstrate
most of the hard topics with the use of simple Maple programs. Moreover,
Maple is interactive, and its programs do not require compiling. In PASCAL,
compiling and debugging programs was a time-consuming process. The flexible
programming syntax in Maple gives students more freedom in expressing
their ideas. Modelling operations on lists, sets or graphs in PASCAL required
introducing pointers and dynamic structures, which was difficult for beginning
students. In Maple, I was able to work with sets, lists and graphs without
bothering how to implement them. In consequence, tutorials with Maple
were far more productive than similar tutorials with PASCAL and Excel.
| Article: Using Basic Maple Programming in Elementary
Mathematics Courses |
|
|