Mathematica_9

**
In the examples below:
- the following sequences of letters each refer to one keyboard key not multiple keys
Esc, F1, F3, F7, F12, Alt, shift, ctrl, Enter
- iff means "if and only if"**

The author of Mathematica, Stephan Wolfram, has created a hierarchy of three engines:

-Wolfram - an interactive programming language which manipulates numbers and strings (c1980)

-Mathematica - an interactive programming language containing Wolfram and adding image functionality

-Wolfram|Alpha - a WebSite that answers questions. It uses the following:

Mathematica

An engine to understand questions that are posed in English

Data located elsewhere on the Internet.

- x->4.
- x\[Rule]4.
- xEsc->Esc4.
- Rule[x,4.]
- Copy from another expression
- Copy from another notebook

( * indicates na [not available . . . yet] )

create a list of numbers from 1 to 5EdgeDetect[object]Discipline... | Name | Description |

All | Cases[n,n..._p ] | Returns cases that match the pattern |

All | Now | Returns current time e.g. Wed 2 Apr 2014 13:34:45 |

All | Timing [e] | Returns elapsed time, value of e |

All | SortBy[list,f ] | Sorts the elements by applying f to each element |

Asm. | ByteArray[s ] | Converts a Base64 string to a byte array |

Crypt. | Encrypt [ ] | Encrypts something using a key/code |

Dict. | DictionaryLookup[s] | Looks up words using patterns |

Editting | TextWords[ ] | Break into a list of words |

Info. | WikipediaSearch*[s ] | Structured search for content in Wikipedia |

Linux | UnixTime[date] | Converts Date/Time to seconds since 1970 A Jan 01 |

Math. | MinMax[l,d ] | Returns the min & max values padded by d |

Math. | NestWhileList[f,e,?] | repeats f starting with e till test:? fails |

Math. | Solve[{e,e},x] | Solves a list of equationsfor x |

Math. | With[{x=x0..},e] | evaluates e with x=x0 etc |

Math. | Range[n ] | Range[5] |

Stats. | TTest[{d,d...}] | Probability that the mean (ie Average) is zero |

Strings | StringJoin[s,s,s ] | Joins a list of strings |

Strings | StringPartition[s,n ] | Partitions a string into a list of .. |

Tables | Table[x^2,{x,3}] | create a Table with 1,4,9 in it. |

Vision(IS) | EdgeDetect[j] | Creates an object showing edges |

Vision(IS) | ImageIdentify[ ] | Tries to identify what the image is |

[ ] |

Discipline... | Name | Description |

All | Clear[] | clears previous definition of variables |

All | Clear[f] | clears previous definition of function f |

All | Clear[Global`*] | clears all previous Global definitions |

Coding | ctrl-6 | superscript |

Coding | ?Name | Look Up "Name" in Documentation |

Coding | Print[s] | Output s to window pane just prior to next [Out-nn] |

Coding | Print[s,s] | Output s,s to window pane |

Coding | % | Previous Output Result |

Coding | %n | Output Result number n |

Coding | (* *) | These enclose comments |

Coding | Word` | Context Names must end with ` |

Coding | SetAttributes[f,Listable] | function is defined by a list |

Coding | FullForm["a"<>"b"] | Prints a string enclosed in double quotes |

Coding | FullForm[2Pi] | Prints Times[2,Pi] (* showing the implied multiplication *) |

Math. | InputArray(in menu) | accepts array elements from the user |

Math. | Solve[{x^2-1==0},x] | Solves x^2-1 for x [iff x is undefined] |

Math. | Solve*[{Equal[x^2-1,0]},x] | Solves x^2-1 for x |

NoteBook | Print[$OperatingSystem] | Prints "Unix" for example |

** indicates deprecated syntax (either "no longer valid" or "now has a different meaning")

!! indicates Warning: this similar construct does not have the same meaning

GT is voiced as Greater Than

LT is voiced as Less Than

EQ is Voiced as Equal To

Name.... | Syntax | Voiced Equivalent | Example | Voiced As |

Alias | Esc Esc | escaped | Esc->Esc | Escaped "->" is the alias of the Rule Operator |

All | FullForm | print the full form of | FullForm[2.Pi] | print the full form of 2.Pi prints 6.283185307179586` |

Anonymous Function | f[&] | see Pure Function | Can be piped (see Piping) | |

Apply | @@ | apply to | Plus @@ {a,b,c} | Plus apply to list ie a+b+c |

Arguments | _ | 1 argument | f[x_] | function f with only 1 argument |

Arguments | __ | 1 or more arguments | f[x__] | function f with 1 or more arguments |

Arguments | ___ | 0, 1 or more arguments | f[x___] | function f with 0, 1 or more arguments |

Assign. | := | set equal to (deferred) | x:=b | x is set equal to b (deferred) |

Assign. | = | set equal to | x=b | x is set equal to b |

Assign. | = | set equal to | x=5. | x is set equal to 5. |

Assign. | = | is given the value of | x=5. | x is given the value of 5. |

Assign. | ! | not | x!<y | x not less than y |

Code | Alt-/ | Uncomment | Alt-/ | Uncomment a statement-removes (* & *) |

Concat. | <> | concatenated to | a$<>b$ | a$ concatenated to b$ |

Condition | >= | is GT or EQ to | y>=x^2-3 | y is GT or EQ to x^2-3 |

Condition | <= | is LT or EQ to | y<=x^2-3 | y is LT or EQ to x^2-3 |

Cond. | /; | such that | f[r_ /; r <a]:=n*r | function of r such that r<a is equal to deferred n times r |

Full Name | \[ ] | full name of | \[Rule] | \[Rule] is the full name of the Rule operator. |

Function | f[x_]= | f is the result of x being substituted in | f[x_]=Sin[x] | f is the result of x being substituted in Sin[x] |

Iteration | += | increment by then test after | i += 1 | begin with i=first, increment by 1 then test for completion |

Help | F1 | Find Selected Function | Select Sin then F1 | Wolfram Doc center explains Sin |

Help | shift-F1 | any symbol | shift-F1 then (# in search documentation box) | shift F1 explains any single symbol (#-first arg of a pure function) |

Help | F3 | Find Next | F3 | Finds next occurance of current search string |

Help | shift-F3 | Find Previous | shift-F3 | Finds previous occurance of cureent previous search string |

Help | F7 | Evaluate in Subsession | F7 | ? |

Help | F12 | Toggle Full Screen | F12 | Toggles Full Screen Mode on/off |

Iter. | {x,a,z,d} | iterated | {x,1,7,2} | x iterated from 1 to 7 by 2 |

Math. | == | is equal to | y==x^2-3 | y is equal to x^2-3 |

Math. | Equal[ ] | is equal to | Equal[x^2-1,0] | x^2-1 is equal to 0 |

Math. | Equal[] | is equal to | Equal[y,x^2-3] | y is equal to x^2-3 |

Math. | Esc==Esc | is equal to | yEsc==Escx^2-3 | y is equal to x^2-3 |

Math. | I | imaginary I | 3+I*2 | 3 plus imaginary I times 2 |

Patterns | "d" | defined string | DictionaryLookup["sphinx"] | Searches for "sphinx" |

Patterns | ~~ | joined to | DictionaryLookup["so"~~"x"] | Searches for "sox" |

Patterns | ___ | any string | DictionaryLookup["x"~~___~~"x"] | Finds "xerox" |

Patterns | y | variable name | y="x";DictionaryLookup[y~~___~~y] | Finds "xerox" |

Patterns | _pattern | match a pattern | _Integer | match an Integer |

Piping | // | piped to | Sin[.01] // ArcSin | Sin[.01] piped to ArcSin ie ArcSin[Sin[.01]] |

Pure Function | f[&] | is a pure function | f[&]=Sin[#] | f is a pure function of Sin |

Rule | -> | goes to | y->x^2-3 | y goes to x^2-3 |

Rule | Esc->Esc | goes to | yEsc->Escx^2-3 | y goes to x^2-3 |

Rule | Rule[] | goes to | Rule[y,x^2-3] | y goes to x^2-3 |

Rule | :> | goes to (delayed) | y:>x^2-3 | y goes to delayed x^2-3 |

Rule!! | => | Invalid | y=>x^2-3 | y=>x^2-3 (* bad syntax *) |

Rule!! | Esc=>Esc | Implies | yEsc=>Escx^2-3 | y Implies x^2-3 |

Rule!! | \[Implies] | Implies | y\[Implies]x^2-3 | y Implies x^2-3 |

Rule!! | Implies[] | Implies | Implies[y,x^2-3] | y Implies x^2-3 |

Replacement | /. | given that | 2.Sin[x]/.x->4. | 2.Sin[x] given that x goes to 4. (* 2Sin[4] *) |

Replacement | /. | given that | 2.Sin[x]/.xEsc->Esc4. | 2.Sin[x] given that x goes to 4. (* 2Sin[4] *) |

R.Replacement | //.. | repeated replacement | ||

- Elements of lists are numbered beginning with 1.
- Example variables in function definitions end with _.
- Numbers for aritmetic should contain a decimal point.
- Imaginary I must be capitalized.
- Clear[] variable parameters before using them in functions or commands such as Solve[]
- Clear[Global`*] is wise at the beginning of a NoteBook (if n GT 1 in line In[n])
- The command "c=d" assigns the expression on the right (d) to the variable on the left (c)
- The command "j:=k" does the same as "=" but it is deferred until the command is executed.
- The operator "l==m" asserts that (l EQ m) is True. This is how an equation is defined.
- The rule "p->q" asserts that the rule is True iff p goes to the expression on the right (q).It does not do p=q.
- The operator "=>" is bad syntax. It means neither "EQ or GT" nor "Esc=>Esc" which would mean \[Implies]/
- The expression 3.*x/.x->4. is equivalent to 3.*4. The expression 3.*x/.x->n is equivalent to 3.*n
- Use StringJoin[] instead of the undefined function: Concatenate[]
- The character "`" printed after a decimal number means "approximated i.e. truncated"
- The integer 2 in "2 Pi" vs 2. in "2. Pi" is an unevaluated 2 (* quite different; try FullForm[] of each *)
- A $ as the last letter of a string name is not necessary, but improves code readability
- Plot IBM since 2008 using DateListPlot[TimeSeries[FinancialData["IBM","Jan.1,2008"]]];

Click on Title to view the Mathematica article

Discipline... | Title | Description |

Math. | Mathematical Operators | List of such operators eg +, *, <> |

Input Assistant | Wolfram Predictive Interface | Provides suggestions while typing into a notebook. |

Intro. | Fast Introduction for Programmers. | First slides for coders. |

The www link is on the web, the main link is "identical" but may also be archived on the Webmaster's server, just in case the www link disappears or is altered. The small icons after the name of the main link indicate the type or location of the reference.

Book 1: Stephen Wolfram - www It's Been 10 Years: What's Happened with A New Kind of Science , Date: 2012 E May 07Source 1:www Mathematica Tips, Tricks, and Techniques by Michael A. Morrison Date: 2000 D Apr 02

Source 2:www Mathematica Stack Exchange by many authors Date: 2015 D Apr 02

Source 3:www Mathematica Stack Exchange: Tips and Tricks (very thorough) by faysou Date: 2012 A Jan 09

Source 4:www Basic Advice for beginners (short excerpt from Source 3) by faysou Date: 2015 C Mar 15

Source 5:www Code Refactoring Wikipedia Date: 2015 C Mar 15

Source 6:www Refactoring by Martin Fowler Date: 2015 C Mar 25

Source 7:www Mathematica 10 announcement by Amoud Buzing of Wolfram Date: 2014 8 Aug 14

WebMaster: Thou Old King Cole

Click here to return to ePC Articles by Old King Cole

Updated: 2015 D Apr 11

/75.html