Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please code this in JAVA Project #1 Description: Program the following algorithms that we covered in the c lass: a. Classical matrix multiplication b. Divide-and-conquer

Please code this in JAVA

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
Project #1 Description: Program the following algorithms that we covered in the c lass: 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 [1 x [1. Carry out a complete test of your algorithms with n : 2, 4, 8, 16, 32, 64, 128, 256, (up to the largest size ofn that your computer can handle). The size ofthe 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 ofthe 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. Subm ission Instructions: After the completion of at! three parts, Part 1, Part 2 and Part 3, submit (upload) the following files to Canvas: ' three program les of three algorithms or one program file including at! three algorithms (your ch oice of programming language with proper documentation) this document in pdf format (complete it with at! the answers) Part 1: Design & Theoretical Analysis {30 points) a. Complete the following table for theoretical worst-case complexity of each algorithm. 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. 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 Input Expected output Classical matrix Divide-and- Strassen's matrix case # multiplication conquer matrix multiplication multiplication (V if CORRECT V if CORRECT ( if CORRECT output from your output from your output from your program) program) program) 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 largestinput size n (which is in the form of2") that yourcomputer 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, it's 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 multipletimes and getthe averagerun 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 bestand worst run. Let X denotes theset which contains the m run times of the m trails, where X = (X1, X2, X3 ... Amj and eachx; is the run time ofthe i" trial. Let x, be the largesttime (worst case) andx, be the smallest time (bestcase). Then we have Average Run Time = Zi=1ki - Xw - Xb m-2 The studentshould think about and decide how many trials ( the value ofm) you will use in your experiment. Note that the common choice of the m value is at least 10. 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 Average time Average Time Average Time Classical matrix (Divide-and-conquer matrix (Strassen's matrix multiplication) multiplication) multiplication) 2 1 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. c. Compare the theoretical results in Part 1(a) and empirical results here. Explain the possible factors that cause the difference. Give a spec of your computing environment, e.g. computer model, OS, hardware/software info, processor model and speed, memory size, ... 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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions