Challenging High School Computer Oriented Students with Non-Euclidean Geometry D. E. Stevenson 442 R. C. Edwards Hall Department of Computer Science Clemson University PO Box 341906 Clemson, SC 29634-1906 803-656-5880
[email protected] Student Co-Authors Michael Astel, Kevin Bathurst, Jimmy Holi eld, and Andy Moise Governor's School of Science and Mathematics Hartsville, South Carolina
Challenging High School Computer Oriented Students with Non-Euclidean Geometry
contemporary of Euclid's. His universe was so ordered; all those neat, precise proofs. Wasn't all this so obvious? But Coach knew how to turn order into chaos: one could have a world with no parallel lines through a point or an in nite number of parallel lines. How could this be possible? Was not Euclid clear on this point? Thirty- ve years later, I nd that Euclid suspected as much but it took 2,300 years to understand why and how. But wasn't that the Coach's goal: to set o on a life's journey in mathematics looking for those things that make one sit up and say, \Wow!" I think so. This aside is the author's way of introducing the crux of this paper. Four years ago, we had an opportunity to have high school students spend six weeks on campus. The purpose of this stint is for the students to \experience" a research environment. This program has continued each summer. Our students come from special programs in South Carolina. Among the programs is the one for gifted students in science and mathematics, called the Governor's School of Science and Mathematics (GSSM). This school has a requirement that seniors do six weeks of research in the summer before graduation. Students other than those from GSSM can participate and are supported by industry. The research must be presented at a colloquium during the senior year. The students are able to pick their own topic within a list submitted by faculty/industry mentors. The rst two summers, the author \advertised" a CSE style program but had no takers. Seeing that we were getting nowhere fast, we tried a dierent tack. The computer science oriented students seemed to be interested in graphics. So we decided to try to attract two students to work in visualization|non-Euclidean, of course. The carrot was that the the students could have a chance to visualize something new and unique and learn many advanced CS techniques, too. We could explore these crazy worlds so dierent from our own. The ploy worked. Our goal, then, is to take students interested in computing and graphics and take them far from their everyday experience. No longer could they count on some things|but only some things. Absolute geometry |that not dependent on the parallel line postulate| is the same but it looks dierent when viewed from outside. For example, in most non-Euclidean worlds, the straight line is not rendered as a straight line even though its distance property|a line is the shortest distance between two points|still holds. This forces the students to ponder what the theorems are really saying. Even after we have rendered the object, there is still the killer question: how do you know it is right? Our ulterior motive is to interest students into enrolling in computer science and then pursuing a career in CSE. These students will have unique experiences far beyond their peers. They would also be exposed to the frontiers of visualization as well as facing the idea of program proofs rst hand. The author is proud to say that we have had four outstanding students, all of whom are now in undergraduate computer science programs. These students have done an outstanding job. Unfortunately, none chose us (sigh). Section 2 describes the basic program we follow. We include exercises that are used to \tune up" the students. In Section 3 we describe the project given the students. This project is well within the capabilities of
Abstract We describe an ongoing summer project used to direct the research activities of students by using them to implement a non-Euclidean geometry viewing system. Our goal is to challenge the students to deal computationally and graphically with a system they cannot see. We discuss how we prepare the students to make practical use of C, Unix, literate programming, and Silicon Graphics graphics hardware and software. The project can be used on virtually any computer with access to the graphics engine. 1 Introduction The author has been involved with computational science and engineering (CSE) for seven years. The goals of CSE are to develop a new way for scientists and engineers to do science on computers. Part of the program is very foundational if not philosophical[7]. Our view of CSE calls for an overhaul of the scienti c method and a change in emphasis in scienti c justi cation. There are many places for computer science to play vital roles in CSE. The High Performance Computing and Communiciations Initiative has been largely driven by the Grand Challenges. The Grand Challenges are engineering and scienti c problems requiring interdisciplinary teams working on the latest equipment using the latest techniques. This is an ambitious program. For it to succeed, we should work to interest students in the excitement of science and engineering. But how do we get students in late high school and early college to consider CSE as a career? Colleagues in psychology tell the author that there is little hard information on why people choose their careers. People become interested in a particular career for dierent reasons. Some are driven; for example, medical doctors often have that dream from a very early age. Many scientists are drawn by a particular problem or set of problems or perhaps a sense of awe at our universe such as observing a \shooting star" or lightning. More likely, though, the author believes{and anecdotal evidence shows|we become interested when we are exposed to a subject by some trusted person who plays the mentor role. Therefore, CSE advocates must be involved in more than computational models; they must help to create that sense of wonder. As a colleague once remarked, \You can't get the students to ask `Why?' until they've said `Wow!'." This phenomenon is usually a quite clear image in one's mind. For the the author, the subject is geometry and the mentor, one Coach W. D. Prickett. I was convinced that ol' Coach Prickett was certainly a Last Updated: August 29, 1995. Submitted to SIGCSE '96, 15{17 February, 1996, Philadelphia
2
to them every day for at least one-half hour|preferably a full hour. We try to get them to explain their algorithms in depth before they actually try to develop the code. This also allows us to keep better control of the project, yet allow the students as free rein as possible. Scienti c codes are developed dierently from codes in other areas. Because we can rely on theorems (with some care due to oating point arithmetic), there is more experimentation. The idea of algorithm takes on a dierent meaning[8]. A second goal is that of using literate programming techniques. We want the students to use literate programming in an informal way through noweb. noweb is available from any of a number of mirrors through the program archie. In literate programming, the program is constructed in chunks: code chunks and documentation chunks. The chunks are presented in human comprehendable sequence, not compiler-required sequence. The second, and perhaps more interesting feature, is that extensive documentation can be included in the documentation chunks, including indexing of variables and functions. The nal product is a single le. Processed by a program known as a tangle, one produces a compilable le. Processed by a 1program known as a weave, one produces WEB-ready HTML2 les. This WEB orientation appeals to the students.
high school students. Therefore, it could be used by high schools as well as lower division college students. Finally, we discuss the result of two summers' worth of students in Section 4. 2 The Program Week 1. Introduction to Unix, C. Unix le system. emacs editor. C and using libraries. Makefiles noweb and html. WWW viewer. Newsgroups. Week 2. Introduction to OpenGL, noweb. Week 3. Computational Euclidean Analytical Geometry. Week 4. Computational Euclidean and nonEuclidean Geometry. Week 5&6. Project.
Table 1: The Six-Week Syllabus.
The Graphics Background The students do not need to get into too much depth in graphics|just enough to understand how to produce three dimensional plots. We wanted a simple interface that would allow the students to use the mouse as well as the plots. Since gure drawing primitives in available packages could not be used, the students had to use only the low level point-oriented primitives. Once plotted though, we would want to be able to rotate the gure in 3-space. Because the students are working in non-Euclidean geometries, they must be very careful as to what primitives they use. This is part of the challenge, since a straight line in Euclidean geometry is \straight" when seen by beings living in the non-Euclidean world. We chose to use the Silicon Graphics3 Indy. The graphics package for the Indys is OpenGL . Were it not for the desire to rotate in 3D, any drawing primitives supporting the drawing of a single point is sucient to implement the project. The goal is to deal with only the conic sections. Despite the \weird" geometry, there is never any need to change coordinate systems. Therefore, there is never any need to move into non-linear transformations.
The Warmup Programming The syllabus for the six-week period is shown in Table 1. The students are \rising" high school seniors with extra mathematics and science training. While the students have had some introduction to calculus, it is not directly needed in this project. The students in our program all have substantial programming experience, but little or no experience with Unix or C. As might be suspected, the students are computer users outside of class. For the most part, they have had Pascal programming and not C. Our approach is to give them a brief introduction to C, then spend a week on many programs. This gives us a chance to assess their background as well as their programming skills. A statement of the exercises is listed in the Appendix. Likewise, they have had no experience with oating point round-o and truncation errors. We have developed a pair of libraries for their use in numerical processing (available from the author): 1. The library nummeth contains a high-power zero nder, a simple cubic interpolating spline program, and a Romberg integration routine. 2. The library arith contains a routine that returns machine constant values such as the machine epsilon, values of , etc.
3 The Project Our goal has been to have them plot the conic sections as seen from the outside world. The students are also asked to read Flatland[1], a \must-read" and enchanting book for everyone interested in geometry (and a little philosophy and sociology). The project itself is centered around classical analytical geometry. The rst step is to plot, using OpenGL, points, lines, line segments, circles, ellipses, parabolas, and hyperbolas in Euclidean 2-space. We have found
Software Engineering We have two goals. Firstly, we want the students to form good program development skills and good documentation habits. We insist on their using makefiles. It is the practice to talk
1 We use Web as an abbreviation for World Wide Web 2 HyperText Markup Language 3 OpenGL is a product of Silicon Graphics Inc.[6]
3
analytic geometry suce for the non-Euclidean as well. This turned out to be a mistake: the elliptic gures are just too dierent computationally. Both groups were able to ful ll a substantial portion of their charge. We found points, lines, circles, and ellipses to be very easy. The rst geometric insight comes (for the students) when they see a circle with the \center" o-center because the distance function is not isotropic. Both groups greatly increased their eorts once they could see \weird" drawings. The rst group were able to complete lines, polygons, circles, and ellipses. The second group was able to duplicate this work (in another geometry) plus hyperbolas. It turned out that the parabola was more than could be worked out in such a short time. Neither group showed much interest in literate programming. The author feels there are two reasons for this. The students are not really novices and may have a substantial amount of informal programming experience. The need for documentation is not stressed in their experience. The second reason is time which applies too our inability to get the students to use good design principles. On the other hand, there is a goodly bit of experimental mathematics and computing involved. This alone justi es using literate programming systems.
that the students do not receive a suciently strong background in analytic geometry for our needs. This exercise makes them really understand the classical gures. Then the fun begins. Points are easy. The problems start immediately with lines and line segments. We have worked with both spherical/elliptic and hyperbolic geometries. In each of these, a straight line is not straight when viewed from the outside. Circles are not circles; similarly, the other conic sections are distorted to greater or lesser degrees. The students must rst convince the author that they understand the de nition| which is independent of the geometry|then produce a program to render the gure. Each time we have done this project, we have been fortunate enough to have a pair of students. The students get good experience in teamwork. Teaming skills are being seen by both industry and academia as crucial. Computational science and engineering demands this mode of work. The students also need not feel that they are alone in this new environment. The main obstacles to the completion of the project are two-fold. The usual formulas for the conic section do not hold when viewed from outside the nonEuclidean world. They do, of course, hold inside that world. Therefore, the students must go back to rst principles. This means a trip into the literature that they have never seen. While they have had some analytic geometry, they were only given formulas. The requirement for rst principles brings up the second obstacle: the concept of distance is not the Euclidean one. For example, in hyperbolic space, one metric (there are many dierent hyperbolic worlds) requires points on a line to actually be on minor arcs of certain circles. Both obstacles can be overcome using some good programming and a very good zero- nder. We use Richard Brent's algorithm in [4]. This zero nder has been converted to C for their use. One assignment is to study the code and explain how it works.
4.2 Closing Comments The purpose of the program is to give high school students a \research" experience. This experience, of course, is highly dependent on the mentor. In the author's case, the tendency is let the students grapple with a problem of a day or so before stepping in. In a sixweeks' period, this strategy may or may not be a correct one. We do believe that the students have a chance to wrestle with problems that are very dicult. In some cases, this experience may have been the rst that challenged the student beyond her/his current capacities. If that happened, great! All four have continued on in computer science at top-ranked schools. So far, though, I have let Coach Prickett down: we have bred no new geometers. Because they are so bright, it is very easy to forget that these students are teenagers. It has been our experience that they respond well to our version of the research experience. In this same vein, I have come to the conclusion that we do not expose our own undergraduates to nearly enough challenging projects. If two students can do this much in six weeks, what can a highschool mathematics club or a college ACM chapter do? Better yet, what could a whole semester do?
4 Results and Closing Comments 4.1 Results The program reported here has been used with two separate groups of two students each. The rst group used PHIGS4 as its graphics engine. This group had the harder time because PHIGS is a very dicult system to master. For the second group, we had a choice of5OpenGL implemented on the Indys or the use of the SRGP developed to accompany [3]. SRGP was appealing because of its wider availability; unfortunately, it does not support three-dimensional graphics as easily as OpenGL. For this reason, we chose OpenGL. Our goal is to eventually use SRGP because it supports PCs, Macs, and X-Windows. The second group bene tted from our experiences with the rst group. We did not understand the backgrounds of the students when the rst group arrived and hence needed to ll in their skills as the need arose. When the second group came, we had a program in place to quickly teach C. We managed to stick to the syllabus outlined in Table 1 until the third week. In week 3, we tried to make the code for the Euclidean
Acknowledgement The cost of this program is borne by Westinghouse, Inc., as the prime contractor of the Department of Energy's Savannah River Site. The Governor's School of Science and Mathematics is located in Hartsville, South Carolina. The Summer Intern Program is administered by the GSSM faculty|mostly on their own time. Thanks are due to two of the author's graduate students: Oliver Heim and John Underwood: each gave freely of his own time to help our students. Je Green, another PhD student, also read the manuscript and made critical com-
4 Programmer's Hierarchical Graphics System[5] 5 Simple Raster Graphics Package
4
ments.
9. Write a program to study the limits of the following function: lim 1 + t ? ln(11+ t) : t!0 t It is best to explore this problem when you have the ability to plot. 10. Here are a bunch of \classical" two-dimensional functions that go 'way back. Plot them. Careful: some are in polar coordinates.
A Combined Exercises In all these exercises, write subprograms (functions and subroutines) that are called by a main. Even for these simple problems, construct a Makefile and document using noweb. 1. Write a program to show that for some values of N , the equation N N1 = 1 is not true. Why does this happen? 2. Write a program to produce the Fibonacci sequence 1; 1; 2; 3; 4; 8; 13; : : :. The rule is Xn+1 = Xn + Xn?1 , with initial conditions X0 = X1 = 1. Write this program iteratively (using for) and recursively. 3. Write a program to nd the minimum and maximum numbers in a vector. The length of the vector is an input parameter. 4. Write a program to solve the linear equations ax + by = c dx + ef = f In your writeup, prove that this is a solution x = (ce ? fb)=(ae ? bd) and y = (af ? dc)=(ae ? bd). What happens if a = d and b = e? Go to the library and nd a college algebra book that explains Cramer's rule. Compare Cramer's rule with the solution above. 5. The Newton-Raphson method of nding the square root of a is the recurrence x0 = a2 ; xi+1 = 21 (2xi + xa2 ): i
p
Name All Conic Sections Folium of Descartes Cissoid of Diocles Astroid Witch of Agnesi Strophoid Cardioid Limacon Spiral of Archimedes Hyperbolic Spiral Lemniscate of Bernoulli Three-Leaf Rose Cycloid
Equation Homework x23 + y33 ? 3axy = 0 y = x =(2a ? x) x22=3 + y22=3 = a2=3 x2 y = 42 a (2a ? y) y = x (a + x)=(a ? x) r = a(1 ? cos ) r = b ? a cos r = a r2 = a2 r = a cos 2 r = a sin 3 x = a( ? sin ); y = a(1 ? cos ) Trochoid for values of a < b, x = a ? b sin ; y = a ? b cos 11. Using the problems in 10, construct and plot representative normals and tangents. 12. Write a program to convert rectangular coordinates in (x; y) to polar coordinates in r; . Write a second program to do the reverse. Run this experiment: Choose several acute triangles with integer sides (i.e., Pythagorean integers). First convert to polar and then use those numbers as input to the polar to rectangular converter. What do you observe? 13. Here is another bunch of \classical" functions that go 'way back. This time, the functions are in three dimensions.
p
Go to the library and look up 2 and 7 in [2] as test values. 6. Write a recursive function to print out, in reverse order, the digits of an integer. Example 123 = 321. 7. Write a program to nd and count all the correct solutions to the cryptoarithmetic problem: I + AM = OK . In these problems, distinct letters stand for distinct digits. 8. The cosine of an angle (measured in radians) can be found by summing the series
X N
2k+1
3
Name Planes Intersection of planes Point at distance from plane Two planes at given angle Line through 2 points Plane containing line Sphere with radius r Ellipsoid
5
x = x + x3! + x5! + : : : : (2 k + 1)! k=0
Right Circular Cone Hyperboloid of one sheet Hyperboloid of two sheet Elliptic Parabaloid Hyperbolic Parabaloid
Write it a routine to compute the cosine of an angle. How would you determine how big to make N ? Try to be as ecient in the loop as possible.
5
Equation Homework Homework Homework Homework Homework Homework x2 + y 2 + z 2 = 1 a2 b2 c2 Same as above How can this be? x22 + y22 ? c22z2 = 0 x + y ? z =1 a2 b2 c2 x2 ? y 2 ? z 2 = 1 a22 b22 c2 x + y = 2cz 2 2 a b x2 ? y 2 = 2cz a2 b2 (c > 0)
14. Find the area under the curve x2 + y2 = 1 for 0 x 1 using the romberg program in libnummeth. 15. Write a program to nd the real zeroes of f (x) = 8x3 + 2x2 ? 5x + 1 using the zeroin program in libnummeth. References [1] Edwin Abbott. Flatland, a romance of many dimensions. Blackwell, 1950. [2] Milton Abramowitz and Irene A. Stegun. Handbook of mathematical functions with formulas graphs, and mathematical tables. Supt. of Docs, USGPO, 1972. [3] James D. Foley, Andries van Dam, Steven K. Feiner, and John F. Hughes. Computer Graphics: Principles and Practice. Addison-Wesley, 2 edition, 1993. [4] G. E. Forsythe, M. A. Malcum, and C. B. Moler. Computer Methods for Mathematical Computation. Prentice-Hall, 1977. [5] T.L.J. Howard, W. T. Hewitt, R. J. Hubbold, and K. M. Wyrwas. A Practical Introduction to PHIGS and PHIGS PLUS. Addison Wesley, 1991. [6] Jackie Neider, Tom Davis, and Mason Woo. OpenGL Programming Guide: The Ocial Guide to Learning OpenGL. Addison Wesley, 1993. [7] D. E. Stevenson. Science, computational science, and computer science: At a crossroads. Comm. ACM, 37(12):85{96, 1994. [8] D. E. Stevenson. Software engineering frontiers in computational science and engineering. In Proc. 33d Annual Southeast Conference, Clemson, SC, 17{18 March 1995, pages 120{127, 1995.
6