Question: 1. Write a program, using your favorite computer (under some operating system that must support VMM) and your favorite programming language, which demonstrates that

1. Write a program, using your favorite computer (under some operating system

 that must support VMM) and your favorite programming language, which demonstrates that 

1. Write a program, using your favorite computer (under some operating system that must support VMM) and your favorite programming language, which demonstrates that the timings of matrix addition differ substantially for large enough matrices, depending whether you use Version I or Version 2: for 1-1 to n do for j-1 to n do C[1,3]: A[1,3]+B[i, j] Version 1 for 1:1 to n do for 1-1 to n do C[1,1]:-A[1,3]+B (1,1] Version 2 Specifically, use this sequence of values for n, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, and 65536, and study the timings of both versions. (Be aware that some runs may take longer than you are willing, or able, to wait!) Keep in mind that the two versions should have the same timings and the doubling the value of n should result in a quadrupling of time spent to do the addition, assuming everything were done in core (which is of course not the case, since the last value corresponds to a memory requirement of almost 50 Gigabytes, assuming four bytes per word). Note that you must initialize your matrices A and B but the time required for this should not be part of the measurements.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!