13 Arrays, or Lists of Lists
Weve seen how Table can be used to make lists. Now lets see how Table can be used to create higher-dimensional arrays of values.
Make a list of 4 copies of x:
 In:= Out= Make a list of 4 copies of a list that contains 5 copies of x:
 In:= Out= Use Grid to display the result in a grid:
 In:= Out= You can use Table with two variables to make a 2D array. The first variable corresponds to the row; the second to the column.
Make an array of colors: red going down, blue going across:
 In:= Out= Show every array element as its row number:
 In:= Out= In:= Out= Generate an array in which each element is the sum of its row and column number:
 In:= Out= In:= Out= ArrayPlot lets you visualize values in an array. Larger values are shown darker.
Visualize a multiplication table:
 In:= Out= In:= Out= ArrayPlot also lets you put colors as values:
 In:= Out= In:= Out= Use ArrayPlot to visualize the array of values:
 In:= Out= The image is of very low resolution, because thats how Rasterize made it in this case. Its also white-on-black instead of black-on-white. Thats because in an image 0 is black and 1 is white (like in RGBColor), while ArrayPlots default is to make larger values darker.
Find pixel values, then do arithmetic to swap 0 and 1 in the array:
 In:= Out= The result is black-on-white:
 In:= Out= Table[x,4,5] make a 2D array of values Grid[array] lay out values from an array in a grid ArrayPlot[array] visualize the values in an array ImageData[image] get the array of pixel values from an image
13.1Make a 12×12 multiplication table. »
Expected output:
 Out[]=  Answer & check your solution
13.2Make a 5×5 multiplication table for Roman numerals. »
Expected output:
 Out[]=  Answer & check your solution
13.3Make a 10×10 grid of random colors. »
Sample expected output:
 Out[]=  Answer & check your solution
13.4Make a 10×10 grid of randomly colored random integers between 0 and 10. »
Sample expected output:
 Out[]=  Answer & check your solution
13.5Make a grid of all possible strings consisting of pairs of letters of the alphabet (aa, ab, etc.). »
Expected output:
 Out[]=  Answer & check your solution
13.6Visualize {1, 4, 3, 5, 2} with a pie chart, number line, line plot and bar chart. Place these in a 2×2 grid. »
Expected output:
 Out[]=  Answer & check your solution
13.7Make an array plot of hue values x*y, where x and y each run from 0 to 1 in steps of 0.05. »
Expected output:
 Out[]=  Answer & check your solution
13.8Make an array plot of hue values x/y, where x and y each run from 1 to 50 in steps of 1. »
Expected output:
 Out[]=  Answer & check your solution
Expected output:
 Out[]=  Answer & check your solution
+13.1Make a 20×20 addition table. »
Expected output:
 Out[]=  Answer & check your solution
+13.2Make a 10×10 grid of randomly colored random integers between 0 and 10 that have random size up to 32. »
Sample expected output:
 Out[]=  Answer & check your solution
Yes, later ones can depend on earlier ones. Table[x, {i, 4}, {j, i}] makes a ragged triangular array.
Yes, you can make tables of any dimension. Image3D gives a way to visualize 3D arrays.
Why does 0 correspond to black, and 1 to white, in images?
0 means zero intensity of light, i.e. black. 1 means maximum intensity, i.e. white.
How do I get the original image back from the output of ImageData?