Practice problems for the final

Note: The following exercises are on arrays. Other exercises will be added shortly.
  1. We constructed banded arrays in class. Consider the following matrix that is similar but has a band about the other diagonal.
    0 0 0 1 1
    0 0 1 1 1
    0 1 1 1 0
    1 1 1 0 0
    1 1 0 0 0 
    
    Construct a 10x10 matrix that looks like the one given above.
  2. Construct an 10x10 Array that has a "X" pattern of width 3. In other words it has 2 bands of 1's, one about each diagonal. All other elements are 0.
  3. Construct an 10x10 Array that has a "+" pattern of width 2. The pattern should be centered horizontally and vertically.
  4. Construct an 10x10 Array that has the same pattern as the 5x5 Array shown below.
    0 1 0 1 0
    1 1 0 1 0
    0 0 0 1 0
    1 1 1 1 0
    0 0 0 0 0