Please proof my work. Make needed corrections if necessary :)
2. Determine for the following code how many pages are transferred between disk and main memory, assuming each page has 2000 words, the active memory set size is 1000 (i. e., at any time no more than 1000 pages may be in main memory), and the replacement strategy is LRU (the Least Recently Used page is always replaced); also assume that all two- dimensional arrays are of size (1:2000, 1:2000), with each array element occupying one word, N=2000 for I := 1 to 4000 do for J :=1 to 4000 do { A[I,J] :=A[I,J) *B[I,J]; B[I,J] :=C(N-I+1,J) *B[I,J] } provided the arrays are mapped into the main memory space (a) in row-major order, (b) in column-major order. 2a) For A[I, JI ALIJ] *B[I, J], - there are 4 pulls and 4 writes to A for each t and 4 pils to Be FOR B[I, J] =CINI, J]* ALI, J] There are 4 writes to B , 4 polls to C and 4 pulls taken from A suce A is already in memory for every I. Hence; ( (3) 24 pulls)) + ((2) 84 writes). * 4000= 180,000 transfers 26) Since each now has 4000 transfers And each column has 4,000 pages. There are 3 reads and 2 wrtes. Hence, 4000 * 4,000 *5=180,000,000 transfers 2. Determine for the following code how many pages are transferred between disk and main memory, assuming each page has 2000 words, the active memory set size is 1000 (i. e., at any time no more than 1000 pages may be in main memory), and the replacement strategy is LRU (the Least Recently Used page is always replaced); also assume that all two- dimensional arrays are of size (1:2000, 1:2000), with each array element occupying one word, N=2000 for I := 1 to 4000 do for J :=1 to 4000 do { A[I,J] :=A[I,J) *B[I,J]; B[I,J] :=C(N-I+1,J) *B[I,J] } provided the arrays are mapped into the main memory space (a) in row-major order, (b) in column-major order. 2a) For A[I, JI ALIJ] *B[I, J], - there are 4 pulls and 4 writes to A for each t and 4 pils to Be FOR B[I, J] =CINI, J]* ALI, J] There are 4 writes to B , 4 polls to C and 4 pulls taken from A suce A is already in memory for every I. Hence; ( (3) 24 pulls)) + ((2) 84 writes). * 4000= 180,000 transfers 26) Since each now has 4000 transfers And each column has 4,000 pages. There are 3 reads and 2 wrtes. Hence, 4000 * 4,000 *5=180,000,000 transfers