Question
Sorting Algorithms Consider A Matrix Multiplication Computation Program C = B*(A +D) Where A, B, C, And D Are (Nxn) Two-Dimensional Matrices. Ans =? Time
Sorting Algorithms Consider A Matrix Multiplication Computation Program C = B*(A +D) Where A, B, C, And D Are (Nxn) Two-Dimensional Matrices. Ans =? Time Complexity Of Matrix Addition A + D = O(N2) Time Complexity Of Matrix Multiplication B*(A + D) = O(N3) So, Total Complexity Of Operation C = B*(A + D)
- Consider a matrix multiplication computation program C = B*(A +D) where A, B, C, and D are (nxn) two-dimensional matrices.
Ans => Time complexity of matrix addition A + D = O(n2)
Time complexity of matrix multiplication B*(A + D) = O(n3)
So, total complexity of operation C = B*(A + D) is
= O(n2) + O(n3)
= O(n3)
- The program is executed on a computer with the following characteristics:
- CPU time for one multiplication is 100 microseconds
- CPU time for one addition is 5 microseconds
- The memory reference time for either read or write is 200 microseconds
- Let n=1000, what is the total time required to perform the multiplication. Assume that all data is located in memory.
- Ans => As we can see above time complexity for multiplication is O(n3).
So, n = 1000.
N3= 10003= 1000,000,000
Performing one multiplication requires = 100 microseconds
- N3* 100 microseconds 100,000,000,000 microseconds.
- 100,000 seconds Approx. 1667 minutes Approx. 28 hours.
- What is the space complexity for this problem
- Ans => O(N2).
- Now assume that you run the program on a computer with the following characteristics
- CPU time for one multiplication is 500 microseconds
- CPUT time for one addition is 1 microsecond
- The memory reference time for either read or write is 100 microseconds
- Let n=1000, what is the total time required to perform the multiplication. Assume that all data is located in memory (5)
- Ans => Only difference here is time for one multiplication is 500 microseconds. Complexities are the same.
- N3* 500 microseconds.
- 500,000,000,000 microseconds Approx. 139 hours.
- What is the space complexity for this problem (5)
- Ans => The space complexities would be the same because the number of performance and items were playing with is the same.
- Given the results for the above two scenarios, what is the time complexity for the matrix multiplication code?
- Ans => O(n3)
- Now assume that you have 1000 processors available for the program execution. Each processor has a local memory, large enough to accommodate the problem.
- what is the total time required to perform the multiplication using 1000 processors.
- Ans => When multiple processors(parallel computers) are used for program execution, the number of operations will be divided between processors for efficiency, yet the complexity stays the same regardless the number of processors.
- 100,000,000 microseconds 100 seconds Approx. 1.67 minutes.
- 500,000,000 microseconds 500 seconds Approx. 8 minutes.
- What is the space complexity for this case?
- Ans => As I said above, the large number of processors will speed up the time to get results faster, but the complexities are independent from number of processors used. So, the space complexity stays the same. O(n2).
- What is the time complexity for this case?
- What is the speedup for the system, when 1000 processors are used (5)
- What is the absolute minimum complexity for this problem assuming infinitely large number of processors?
- Answer this question.
- What is the minimum number of processors required to achieve the absolute minimum complexity (5)
- Answer this question.
- What is the space complexity for the minimum time complexity case (2)
- Answer this question.
- Why is it not practical to measure the time complexity of sorting and search algorithms in terms of actual execution time?
- Ans =>Its not practical because time complexity is independent of execution time. Time complexity is the theoretical concept, whereas execution time refer to how long does it take to run the program and can be measured using stopwatch or anything.
\"Could you please check my answers and correct them if they are wrong, and answer question 10, 11, and 12 based on the previous answer\"
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started