Set Theory

List of functions :

Union
Intersection
MemberQ
Complement
Subsets

Examples

a={1,2,3,4,5,6,7};
b={0,2,4,6,0};
c=Table[i^2,{i,1,20}];
d=Table[Prime[i],{i,1,10}];
e=Table[i+j,{i,1,5},{j,1,5}];
ListPlot3D[e];

Lists

list1={1,2}

Lists are ordered and may contain the same element several times. Sets have no prescribed order and only contain each element once. Lists are finite -- sets may be infinite.

List Commands

Table
ListPlot
First
Last
Length

Recursion

x = If[1+1==2,3,5]

even[n_]:=If[n==0,0,even[n-1]+2];
even[10];
Table[even[i],{i,0,10}];
even[-1]; (*This will not work *)

factorial[n_]:=If[n==0,1,n factorial[n-1]];
factorial[6];
Table[factorial[i],{i,0,10}];

square[n_]:=If[n==0,0,square[n-1]+2n-1];
square[2];
Table[square[i],{i,0,10}];

pascal[n_,i_]:=If[i==1  || i==n,1,pascal[n-1,i-1]+ pascal[n-1,i]];

MatrixForm[Table[pascal[n,i],{n,1,5},{i,1,n}]]

pascal[n, i] generates Pascal's triangle where n denotes a row and i denotes a postion in that row.  pascal[n,i] is also known as the binomial coefficient, indicating in how many ways one may choose i objects from a collection of n objects.