Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

SINCE I CAN NOT CHANGE THE POINT TO THE QUESTION, SO I REPEAT POST THIS QUESTION

ID: 654030 • Letter: S

Question

SINCE I CAN NOT CHANGE THE POINT TO THE QUESTION, SO I REPEAT POST THIS QUESTION FOUR TIMES, IF YOU CAN ANSWER THIS QUESTION I GIVE 1200 POINTS IN TOTAL, JUST COPY AND PASTE UNDER EACH QUESTION.

you should expect to learn about: (i) the experimental performance of algorithms and why it may not match the theoretical bound at times, and (ii) how to tackle problems for which there is no context as opposed to book problems that are tied to specific chapters so you immediately know which technique to try. You will get three attempts to work on this problem using three different techniques (start with the simplest design technique first). We are interested in your thought process so even failed attempts are important to document.Each time you must: 1. State the technique you are using 2. Explain your idea first in words with appropriate examples (not code) 3. If the idea fails, show examples on which it fails 4. If the idea succeeds, write algorithm in pseudo-code notation and then program it, test it, and turn in your test cases and the documented program along with instructions on how to compile and run it. Also analyze the time and space complexity of the algorithm, again if the idea succeeds.

Question: 1. (based on 4 steps as mention, notice that i need the program code and anlalyzing how it works I need the complete program and the analysis of algorithm for different value)

(Experimental, Due April 26, 11.59pm) Write a program, using your favorite computer (under some operating system, supporting Virtual Memory Management) and your favorite programming language, which demonstrates that the timings of matrix addition differ substantially for large enough matrices, depending on whether one uses Version 1 or Version 2:

Version 1:

for i:= 1 to n do

for j := 1 to n do

C[i, j] := A[i,j] * B[i, j]

Version 2:

for j := 1 to n do

for i:= 1 to n do

C[i, j] := A[i,j] * B[i, j]

Specifically, use this sequence of value for n, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, ... (as many values higher than 65536 as possible) study the timings of both versions. Keep in mind that if everything was done in main memory, the timings for the two versions would be the same and doubling n would quadruple the time required. Note that you must initialize your matrices A and B but the time required for this should not be part of your measurements.

Explanation / Answer

#include <stdio.h>     

#include <time.h>

#define N 200

int main ()

{int i,j,n;

int A[N][N],B[N][N],C[N][N];

double time_ver1, time_ver2;

printf(