Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program the following algorithms that we covered in the class: a. Classical matrix multiplication b. Divide-and-conquer matrix multiplication c. Strassen's matrix multiplication You can use

Program the following algorithms that we covered in the class: a. Classical matrix multiplication b. Divide-and-conquer matrix multiplication c. Strassen's matrix multiplication You can use either Java, or C++ for the implementation. The objective of this project is to help student understand how above three algorithms operates and their difference in run-time complexity (average- case scenario). The project will be divided into three phases to help you to accomplish above tasks. They are Part 1: Design and Theoretical analysis, Part 2: Implementation, and Part 3: Comparative Analysis. This project will ask student to conduct the matrix multiplication on the numeric data type. You can implement the above three algorithms in your choice of data structures based on the program language of your choice. Note that you always try your best to give the most efficient program for each problem. Let the matrix size be n x n. Carry out a complete test of your algorithms with n = 2, 4, 8, 16, 32, 64, 128, 256, ... (up to the largest size of n that your computer can handle). The size of the input will be limited in the power of 2. They are 2, 4, 8, 16, 32 up to 2k where 2k is the largest size of the input that your computer can handle or your program might quit at size of 2k due to running out of memory. The reason for the power of 2 is to ease the programming component of the assignment. Submission Instructions: After the completion of all three parts, Part 1, Part 2 and Part 3, submit (upload) the following files to Canvas: three program files of three algorithms or one program file including all three algorithms (your choice of programming language with proper documentation) this document in pdf format (complete it with all the answers)

2 Part 1: Design & Theoretical Analysis (30 points) a. Complete the following table for theoretical worst-case complexity of each algorithm. Also need to describe how the worst-case input of each algorithm should be. Algorithm theoretical worst-case complexity describe the worst-case input Classical matrix multiplication Divide-and-conquer matrix multiplication Strassen's matrix multiplication b. Design the program by providing pseudocode or flowchart for each sorting algorithm.

3 c. Design the program correctness testing cases. Design at least 10 testing cases to test your program, and give the expected output of the program for each case. We prepare for correctness testing of each of the three programs later generated in Part 2. Testing case # Input Expected output Classical matrix multiplication ( if CORRECT output from your program) Divide-and- conquer matrix multiplication ( if CORRECT output from your program) Strassen's matrix multiplication ( if CORRECT output from your program) 1 2 . . . 10 d. Design testing strategy for the programs. Discuss about how to generate and structure the randomly generated inputs for experimental study in Part 3. Hint 1: The project will stop at the largest input size n (which is in the form of 2k) that your computer environment can handle. It is the easiest to use a random generator to help generate numbers for the input data sets. However, student should store all data sets and use the same data sets to compare the performance of all three Matric Multiplication algorithms. Hint 2: Note that even when running the same data set for the same Matrix Multiplication program multiple times, its common that they have different run times as workloads of your computer could be very different at different moments. So it is desirable to run each data set multiple times and get the average run time to reflect its performance. The average run time of each input data set can be calculated after an experiment is conducted in m trails; but the result should exclude the best and worst run. Let X denotes the set which contains the m run times of the m trails, where X = {x1, x2, x3 ... xm} and each xi is the run time of the ith trial. Let xw be the largest time (worst case) and xb be the smallest time (best case). Then we have Average Run Time = = 1 2 The student should think about and decide how many trials (the value of m) you will use in your experiment. Note that the common choice of the m value is at least 10.

4 Part 2: Implementation (35 points) a. Code each program based on the design (pseudocode or flow chart) given in Part 1(b). b. Test you program using the designed testing input data given in the table in Part 1(c), Make sure each program generates the correct answer by marking a if it is correct for each testing case for each program column in the table. Repeat the process of debugging if necessary. c. For each program, capture a screen shot of the execution (Compile&Run) using one testing case to show how this program works properly By now, three working programs for the three algorithms are created and ready for experimental study in the next part, Part 3.

5 Part 3: Comparative Analysis (35 points) a. Run each program with the designed randomly generated input data given in Part 1(d). Generate a table for all the experimental results as follows. Input Size n Average time (Classical matrix multiplication) Average Time (Divide-and-conquer matrix multiplication) Average Time (Strassen's matrix multiplication) 2 4 8 16 . . . The largest size that your computer can handle b. Plot a graph of each algorithm and summarize the performance of each algorithm based on its own graph. Plot all three graphs on the same graph and compare the performance of all three algorithms. Explain the reasons for which algorithm is faster than others.

6 c. Compare the theoretical results in Part 1(a) and empirical results here. Explain the possible factors that cause the difference. d. Give a spec of your computing environment, e.g. computer model, OS, hardware/software info, processor model and speed, memory size, ... e. Conclude your report with the strength and constraints of your work. At least 200 words. Note: It is reflection of this project. Ask yourself if you have a chance to re-do this project again, what you will do differently (e.g. your computing environment, programing language, data structure, data set generation, ... ) in order to design a better performance evaluation experiment.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe the patterns of business communication.

Answered: 1 week ago

Question

3. Provide two explanations for the effects of mass media

Answered: 1 week ago