Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Many useful calculations in probability and physics require us to perform certain weighted sums related to pairs of integers (i,j). Consider the following sum: EM-
Many useful calculations in probability and physics require us to perform certain weighted sums related to pairs of integers (i,j). Consider the following sum: EM- =) E'=zi+]ci Assume that the coefficients Cij (for all i, j, i=1,2,...n, j=1,2,...n) are given to you as inputs as the entries of a matrix C. a. (25 points) Write a pseudo-code that computes the above sum given the n*n coefficient matrix C with entries Cij, b. ( 12 points) Find the number of operations (only arithmetic and logical) that your algorithm performs in the worst case. C. (8 points) Assume now that the coefficients Cij are not given to you but have to be calculated for each i.j using an algorithm that requires O(log n) steps. Give a big-O estimate for computing the sum under this assumption (you don't have to write the pseudo-code but explain all details). Many useful calculations in probability and physics require us to perform certain weighted sums related to pairs of integers (i,j). Consider the following sum: EM- =) E'=zi+]ci Assume that the coefficients Cij (for all i, j, i=1,2,...n, j=1,2,...n) are given to you as inputs as the entries of a matrix C. a. (25 points) Write a pseudo-code that computes the above sum given the n*n coefficient matrix C with entries Cij, b. ( 12 points) Find the number of operations (only arithmetic and logical) that your algorithm performs in the worst case. C. (8 points) Assume now that the coefficients Cij are not given to you but have to be calculated for each i.j using an algorithm that requires O(log n) steps. Give a big-O estimate for computing the sum under this assumption (you don't have to write the pseudo-code but explain all details)
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