Mathematica Navigator contains a great deal of material not easily found elsewhere in a well-organized form, with sufficient detail and illustrative examples. This book will serve excellently as a Mathematica handbook; it starts with the basics, goes carefully through the main material of Mathematica, and covers some advanced topics. Mathematica packages are integrated into the text, so that the reader gets a comprehensive overview of the features of Mathematica. This book allows a new user to begin working with Mathematica and proceed to quite a high level. Old users will find much new material, allowing them to raise their knowledge and skill to an even higher level. In addition, registered readers can send questions to the author concerning the use of Mathematica in areas treated in the book.
* Gives a careful, overall introduction to Mathematica
* Explores graphics in detail,both for functions and data
* Covers procedural, functional, and rule-based programming
* Presents useful standard Mathematica packages throughout the text
* Emphasizes methods of applied mathematics and numerical analysis
* CD-ROM contains the entire book, including all animations, and data sets presented in the book
"synopsis" may belong to another edition of this title.
Heikki Ruskeepää teaches applied mathematics at the University of Turku. He has published guides on mathematical software such as Macsyma, Mathematica, and SAS/OR. Ruskeepää received his Ph.D. from the Department of Applied Mathematics of the University of Turku, Finland. He has also published several books in Finnish.
MATHEMATICA NAVIGATOR is designed to provide readers with a general introduction to the use of Mathematica, with emphasis on graphics, methods of applied mathematics, and programming. This book is useful both as a tutorial and as a handbook.
No previous experience with Mathematica is required. Coverage also includes advanced material and material not easily found elsewhere. This book will be a valuable resource for both beginners and experienced users.
The mathematical topics covered are differential calculus, integral calculus, equations, optimization, interpolation, approximation, differential and difference equations, partial differential equations, probability, and statistics.
Using the enclosed CD-ROM, the entire book can be included in the help system of Mathematica. All of the material in the book is then effectively accessible from within Mathematica. This invites you to experiment with the examples of the book. The CD-ROM can be read with Windows, Macintosh, and Unix computers.
1 GETTING STARTED
INTRODUCTION
In 1903 at a meeting of the American Mathematical Society, F. N. Cole read a paper entitled "On the Factorization of Large Numbers". When called upon to speak, Cole walked to the board and, saying nothing, raised two to its sixty-seventh power and subtracted 1 from the answer. Then he multiplied, longhand, 193 707 721 by 761 838 257 287 and the answers agreed. Without having said a word, Cole sat down to a standing ovation. Afterwards he announced that it had taken him twenty years of Sunday afternoons to factorize the Mersenne number 2^67 - 1. - Edward Sexton
This chapter is intended to give you an impression of Mathematica and teaches you some of the basic techniques and commands of Mathematica. A more complete insight is given in the next chapter, where we briefly present a selection of the most important commands of Mathematica.
Although this book gives some emphasis to the methods of applied mathematics, this chapter begins with a "pure" example: factoring integers. We consider the problem mentioned in the anecdote above and show what we can do nowadays with such powerful systems as Mathematica. This example tries to enlighten some of the major aspects of Mathematica. We emphasize that it is not intended that you do the calculations of this example, nor that you should understand the commands we use. Your ordinary session begins in section 1.2.
After this example we give a brief overview of some of Mathematica's basic techniques and commands, beginning with the classical starting example of calculating 1 + 2 and ending with calculus and graphics. Then we present and explain the important conventions of Mathematica, which often cause trouble to beginners.
In sections 1.4 and 1.5 we tell how you can get help within Mathematica and how you can correct and edit what you have written. These two sections may give more information than you need now, but you can read the basic points and continue later on when getting help and editing become more relevant concerns.
Parts of this chapter depend on the computer you use. We will explain only the Windows and Macintosh environments, although some comments may be found about the basics of Mathematica in a Unix system.
And now it begins. Breathe deeply, make yourself comfortable, and start the expedition.
1.1 WHAT IS MATHEMATICA
1.1.1 EXAMPLE
VERIFYING THE WORK OF COLE
Did you read the anecdote about F. N. Cole at the beginning of the introduction to this chapter? Cole sacrificed every Sunday afternoon during twenty years before he found that the Mersenne number M67 or
2^67 - 1
147573952589676412927
is the product of the following two numbers:
193707721 761838257287
147573952589676412927
(The first line is always the command entered to Mathematica, and the second line is the answer given by Mathematica.) M67 is thus not a prime. Cole's feat was admirable. Now, after about one hundred years we have Mathematica and the situation is totally different. Now it takes about 2.4 seconds in my machine to do the factorization:
FactorInteger[2^67 - 1] //Timing
{2.35 Second, {{193707721, 1}, {761838257287, 1}}}
Mathematica found that 193707721 and 761838257287 are factors of multiplicity one.
DIFFICULT FACTORS
However, even nowadays some problems can be surprisingly difficult. Mathematica in my PowerPC Macintosh factorized M149 about 4 hours and needed about 12 megabytes of RAM for the calculations. Mathematica did not succeed in factorizing M193 in dozens of hours and of megabytes. However, note that these numbers are very large:
2^149 - 1
713623846352979940529142984724747568191373311
2^193 - 1
12554203470773361527671578846415332832204710888928069025791
and also the factors of M149 are very large:
FactorInteger[2^149 - 1] //Timing
{14289.9 Second, {{86656268566282183151, 1}, {8235109336690846723986161, 1}}}
so that factoring the two numbers is obviously a very difficult task. Mathematica can, however, immediately tell that M193 is not a prime:
PrimeQ[2^193 - 1] //Timing
{0.0833333 Second, False}
The difficulty of factoring large numbers is a key fact utilized in some cryptographic methods.
A DEMANDING COMPUTATION
To further illustrate the use of Mathematica, we now factor the Mersenne numbers M2 to M192. (Note that you are not supposed to do the calculations in this example. Just cast an admiring glance at the commands. Later on in this book you will learn such commands as Table, Apply, and Map.) We do not show the factors themselves but only count the number of factors:
(t = Table[Apply[Plus, Map[#[[2]]&, FactorInteger[2^i - 1]]], {i,2,192}]) //Timing
{32257.9 Second, {1,1,2,1,3,1,3,2,3,2,5,1,3,3,4,1,6,1,6,4,4,2,7,3,3,3,6,3,7,1,
5,4,3,4,10,2,3,4,8,2,8,3,7,6,4,3,10,2,7,5,7,3,9,6,8,4,6,2,13,1,3,7,7,3,9,
2,7,4,9,3,14,3,5,7,7,4,8,3,10,6,5,2,14,3,5,6,10,1,13,5,9,3,6,5,13,2,5,8,
14,2,11,2,10,11,6,1,15,2,12,6,11,5,9,6,9,9,6,6,17,4,3,5,8,5,14,1,9,5,9,2,
15,3,5,10,11,2,9,2,16,6,6,6,19,5,6,7,10,2,14,5,11,8,10,8,18,4,5,8,13,7,16,
5,10,10,8,2,19,4,7,7,10,4,11,9,14,6,5,3,24,4,11,5,11,5,8,5,10,10,10,5,16}}
Thus, for example, the Mersenne number M2 or 2^2 - 1 = 3 has one factor, the number M3 or 2^3 - 1 = 7 has one factor, the number M4 or 2^4 - 1 = 15 has two factors (3 and 5), and the number M192 or 2^192 - 1 has 16 factors. The computations took 32258 seconds or about 9 hours and about 13 megabytes of memory:
MaxMemoryUsed[]
12943368
Next we form pairs from the indices and the numbers of factors:
s = Transpose[{Range[2, 192], t}];
and select the cases with only one factor:
Select[s, #[[2]] == 1 &]
{{2,1},{3,1},{5,1},{7,1},{13,1},{17,1},{19,1},{31,1},{61,1},{89,1},{107,1},{127,1}}
So we know that M2, M3, M5, ..., and M127 are primes.
A GRAPHIC ILLUSTRATION
We find a logarithmic least squares fit for the number of factors:
lsq = Fit[s, {1, Log[x]}, x]
-2.55081 + 2.11234 Log[x]
Then we plot the numbers of factors and the fit:
Plot[lsq, {x,2,192}, AspectRatio->0.3, PlotRange->{-1,25},
PlotStyle->{RGBColor[0,0,1], AbsoluteThickness[0.3]},
Ticks->{Join[{2}, Range[20,180,20], {192}], {1,5,10,15,20,24}},
Epilog->{AbsoluteThickness[0.3], Line[s], AbsolutePointSize[2], Map[Point,s]}];
So, here are the numbers of factors of M2 to M192 together with the logarithmic fit. Prime Mersenne numbers are the ones with only one factor. These Mersenne primes had all been found by 1913.
Primes are not very common among Mersenne numbers. The next known primes occur with indices 521 (found in 1952), 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 1257787 (the last was found in 1996).
LESSONS LEARNED
The example above shows how easy it is nowadays to do complicated and long calculations and visualize the results. Mathematica is one of the popular systems for doing such calculations. However, even nowadays, with powerful mathematical systems and powerful machines, some problems may remain awkward and time-consuming.
The example also illustrates some aspects of Mathematica, namely working with exact and approximate quantities, using graphics, and even making programs (the command calculating t can be considered to be a small program). In general, Mathematica integrates symbolic calculation, numerical calculation, graphics, and programming into one system.
Mathematica contains, in fact, still another aspect: a document-making environment (in versions of Mathematica supporting the so-called notebook interface). In this environment you can do symbolic and numerical calculations, produce graphics, and add text to explain what you have done. The result is a complete document of your work (this book, for example, has been written with Mathematica). In addition, the document is interactive. You can change parameters and functions, do calculations anew, show animations, and continuously develop the document. The notebook interface is, for example, in the Windows and Macintosh versions of Mathematica. In plain Unix the interface is text-based and thus using Mathematica is not so flexible, but the X Window System supports notebooks.
One and the same mathematical system may not be the most suitable for all calculations and all users. Remember that there are, in addition to Mathematica, other systems like Maple, Derive, Axiom, Macsyma, and Reduce. Maple is the main competitor of Mathematica, while Derive is a smaller system but still remarkably powerful, easy to learn and use, and moderate in its resource requirements. Axiom is the newest system and not yet popular. Macsyma and Reduce are pioneering and still powerful symbolic calculation systems, but today some other systems have gained more popularity.
"About this title" may belong to another edition of this title.
US$ 3.75 shipping within U.S.A.
Destination, rates & speedsSeller: HPB-Red, Dallas, TX, U.S.A.
hardcover. Condition: Good. Connecting readers with great books since 1972! Used textbooks may not include companion materials such as access codes, etc. May have some wear or writing/highlighting. We ship orders daily and Customer Service is our top priority! Seller Inventory # S_353520263
Quantity: 1 available
Seller: SatelliteBooks, Burlington, VT, U.S.A.
Hardcover. Condition: Very Good. Softcover. Clean text. Tight binding. CD still sealed inside. Light foxing on top edge. For any additional information or pictures, please inquire. Seller Inventory # 210404014
Quantity: 1 available