Pensieve header: January 20: Textbook (EIWL) chapters 5-8, evaluated.

5. Operations on Lists

{1,2,3}+10

{1,1,2}*{1,2,3}

{1,1,2}.{1,2,3}

Range[10]^2

ListPlot[Range[20]^2]

Sort[{4,2,1,3,6}]

?Sort

l=Table[RandomReal[{-1,1}], 20]

Sort[l]

Sort[l, Abs[#1]<Abs[#2]&]

Length[{5,3,4,5,3,4,5}]

N2=(#1*#1-((#2)^2))&

N2[2,3]

N3=(#1*#3-((#2)^2))&

N3[2,3]

N4=Function[{x,t},(x^2)-(t^2)]

N4[2,3]

Total[{1,1,2,2}]

Total[Range[100]]

Clear[a]

Count[{a,b,a,a,c,b,a},a]

First[{7,6,5}]

Last[{7,6,5}]

?Prime

ll=Prime /@ Range[10]

Last[ll]

First[ll]

Rest[ll]

Most[ll]

Second[ll]

Part[ll,4]

ll//Rest//First

ll[[4]]

ll[[3;;7]]

ll[[3;;]]

ll[[;;6]]

?;;

ll[[-3]]

ll[[0]]

Expand[(((x+y))^10)][[7]]

First[Sort[{6,7,1,2,4,5}]]

Min[{6,7,1,2,4,5}]

IntegerDigits[(2^40)]

Take[{101,203,401,602,332,412},3]

Take[IntegerDigits[2^100],10]

Drop[{101,203,401,602,332,412},3]

?Take

6. Making Tables

Table[5,10]

Table[x,10]

Table[{1,2},10]

Table[PieChart[{1,1,1}],3]

Table[a[n],{n,5}]

Table[n+1,{n,10}]

Table[n^2,{n,10}]

Table[Range[n],{n,5}]

Table[Column[Range[n]],{n,8}]

Table[ListPlot[Range[10*n]],{n,3}]

Table[PieChart[Table[1,n]],{n,5}]

Table[2^expt,{expt,10}]

Table[{x,x+1,x^2},{x,5}]

Table[f[n],{n,10}]

Table[f[n],{n,4,10}]

Table[f[n],{n,4,10,2}]

Range[4,10]

Range[4,10,2]

f/@Range[4,10,2]

Range[0,1,0.1]

ListPlot[Table[x-x^2,{x,0,1,.02}]]

ListPlot[Range[0,1,.02]-Range[0,1,.02]^2]

Table[RandomInteger[10],20]

RandomInteger[10,20]

7. Colors and Styles

Red

{Red,Green,Blue,Purple,Orange,Black}

ColorNegate[Yellow]

Blend[{Yellow,Pink,Green}]

RGBColor[1,0,0]

Table[RGBColor[1,g,0],{g,0,1,0.05}]

?ColorData

Hue[0.5]

Table[Hue[u],{u,0,1,0.05}]

RandomColor[]

Table[RandomColor[],30]

Blend[Table[RandomColor[],20]]

Style[1000,Red]

Style[1000,Red]+1

Table[Style[RandomInteger[1000],RandomColor[]],30]

Style[x,30]

Table[Style[100,n],{n,30}]

Table[Style[x,RandomColor[],RandomInteger[30]],25]

8. Basic Graphics Objects

Graphics[Circle[]]

Graphics[Disk[]]

?Circle

Graphics[{Thick,Circle[{0,0}],Red,Thin,Circle[{0,0.5},0.5]}]

?Thickness

?Dashed

Graphics[RegularPolygon[5]]

Table[Graphics[RegularPolygon[n]],{n,5,10}]

Graphics[{Style[RegularPolygon[5],Orange],Disk[{1,1}]}]

Graphics[{Orange,RegularPolygon[5]}]

Graphics3D[Sphere[]]

{Graphics3D[Cone[]],Graphics3D[Cylinder[]]}

Graphics3D[Style[Sphere[],Yellow]]

Graphics3D[Style[Sphere[],Yellow],Boxed->False]

CurrentImage[]