[General boards] [Fall 2023 courses] [Summer 2023 courses] [Winter 2023 courses] [Older or newer terms]

Confusion about A2 Problem2

I am confused about the description of Problem 2 in Assignment 2. Does “n × m rectangular grid of cells” refer to a matrix with n rows and m columns? Then why does “the third quarter of the north doors at the top of the grid” seem to be on the right of the matrix?
I have drawn a figure based on my understanding. Please help me check if it is right.

Does $P_{i,j}$ refers to the entry at the i-th row intersecting the j-th column?

Also, there is another contradiction regarding the ordering of the cells. If we follow a bottom-up then left-right order and assume $P_{i,j}$ to be the i-th column and j-th row entry, then $P_{i,j}$ should be numbered as $(i-1)m + (n-j)$.

No, it is not an nxm matrix. Your figure is not correct.
See the code given. It is an nm x nm matrix.
Each cell gives one equation (row) and corresponds
to one unknown (column).
See also the figure drawn in the assignment handout.

The numbering of cells is as given in the assignment:
bottom up then left to right (from south-west corner to north-east corner).

Sorry, I haven’t made myself clear. I am talking about the grid of cells instead of the matrix we have modeled to solve this problem.

This example shows a grid of m rows and n columns (where m = 4 and n = 8). But the description says this is a n x m grid of cells.

Also, it says the north doors of cells (i,m), i = n/2+1, … 3n/4+1 lead to food, but the (i,m) cells should be to the right, because the convention is that (i,m) refers to the i-th row and m-th column.

Still, P_{i,j} refers to the ((i-1)m + j) th component of the vector, but in the figure above, when i = 3 and j = 3, (3-1)*4+3 = 11 but the cell is numbered 10.

I think I understand the confusion.
The grid has nothing to do with a matrix.
The above grid is 8 x 4, because it has 8 cells in the x-direction and 4 cells in the y-direction.
Each cell has a number (bottom-up then left-to-right),
but you can also refer to it by Cartesian coordinates (i, j),
where the (1, 1) is “1”, (1, 2) is “2”, etc, and (8, 4) is “32”.
So, for example, the cell (5, 4) (or “20” = 4x4 + 4) leads to food.
Also, cell (3, 3) is “11” = 2*4 + 3.
(The E’s and F’s are not regular cells.)

The convention you mention
“that (i,m) refers to the i-th row and m-th column.”
does not hold here. It is a matrix convention,
not a grid convention. Take my numbering as above,
as also in the assignment.

Now I understand. Thanks.

  [General boards] [Fall 2023 courses] [Summer 2023 courses] [Winter 2023 courses] [Older or newer terms]