Mathematica's calculating power
Practically the system works with an unlimited number of arithmetic symbols and has the most effective algorithms for complex symbolic and numeric calculations built in. It attempts to calculate exactly every time and can product results from a number of pages of formulas. In this case it is recomended to use tangible real and complex numbers, a numerical method or a truncation error function.
Example 1. Here we show how Mathematica presents the irrational number π . In one case it remains π, in the second case it is shown with a typical accuracy of 6 digits and in the third - an accuracy of an unspecified number of digits chosen by the user, 100 as shown in the case below. The capital letter N is used for numeric calculation. Finally, we calculate the number e with 50 decimal digits.
Example 2. Mathematica efortlessly calculates complex expressions. In order to get an end result with a numerical value it is necessery to write at least one argument with a decimal point (type Real).
The last result is the upper one with doubled accuracy. To show it we need to place the mouse cursor in the result line and press the ENTER key.
Example 3. Immediately after carrying out an action, its result can be used by writing the symbol %, %% for the previous etc.:
However, this is also true with the number which the system uses to remember it in the current session, shown in the blue symbols marking the beginning and the end of a line: In[number] Out[number].
Example 4. Mathematica works equally fast with complex numbers when the complеx unit is written with I or is chosen from the palette with basic mathematical symbols Basicinput - i. Of course, we can use these symbols too.
Example 5. Mathematica can carry out complex matrix calculation. The function Random[ ] generates a random number in the interval [0,1]. With the function Table a 100 by 100 matrix is created with random numbers. To avoid printing the 10,000 results at the end of the operator we write ; (semicolon).
Example 6. The next command line calculates and draws the eigenvalues of the matrix m from the previous example.
Example 7. For a fraction of a second Mathematica calculates the value of a factorial of 500 - exact and approximate.
Example 8. Here is and example of factoring a polynomial expression over the integers, which takes a lot of time calculated by hand. A Simplify build-in function makes the oposit.
Example 9. One of the trademarks of Mathematica is the effective calculation with prime numbers. After calculating the table with the first 200 numbers, saved in the variable tp we show its graphics.
Created by Mathematica (October 6, 2007)