Mathematica Basics

Take the tour in the Help Browser, particularly Getting Started and Tour of Mathematica in the Getting Started section.  

Basically you type something, hit enter, it does something, and gives you the result.

The screen uses "cells" which can be input, output, or just text like what I'm typing right now.

Mathematica functions are all CapitalLettersWithWordsStuckTogether.  You use square brackets to apply them to something, like this.

In[132]:=

Sqrt[16]

Out[132]=

4

Curly braces are used for lists.

In[133]:=

t = {10, 20, 50}

Out[133]=

{10, 20, 50}

In[134]:=

Mean[t]

Out[134]=

80/3

One quirk ofMathematicais that it doesn't convert to decimal numbers unless necessary.The ages in the table above were given as integer values and so that's what we get for an answer.  To see a decmial value, type //N at the end of the expression, or input the numbers with periods, 10., 20., 50.

In[135]:=

Mean[{10, 20, 50}] // N

Out[135]=

26.666666666666668`

In[136]:=

Mean[{10., 20., 50.}]

Out[136]=

26.666666666666668`

There are Palletes in the File menu or keyboard shortcuts that let you enter formulas as they would typically look.  Or you can type the functions; either works - and the system in fact changes between the two.

In[137]:=

Sqrt[(a + b)/5]

Out[137]=

(a + b)^(1/2)/5^(1/2)

In[138]:=

(a + b)/5^(1/2)

Out[138]=

(a + b)^(1/2)/5^(1/2)


Converted by Mathematica  (September 11, 2003)