Computers and Technology

In the present module, it was demonstrated that you could estimate the exponent of the asymptotic time complexity (i. e., a of O(na)) by plotting the runtime of an algorithim as a function of the problem size on a log-log plot and determining the slope of the resulting line. In this problem, you will write a function that uses this methodology to estimate a given the runtimes and associated problem sizes. Write a function called estTC with the following declaration line
begin code
function alpha estTC(nSize, runTime)
end code
where the input arguments are:
• nSize: a 1-by-n array whose elements are the problem size for each test
• runtime: a k-by-n array where each row is the runtimes for an algorithm tested at each problem size. Thus the number of rows corresponds to the number of algorithms.
The output argument, alpha, is a k-by-1 array that contains the estimate of the exponent for each of the k algorithms.
The estTC function should first transform both of the input arguments using the base-10 logarithm (i. e., log10 in MATLAB). Then, using regression you should fit an linear function (i. e., of the form f(x) = ax + 3) to the transformed input data. As seen in the module, the slope of this function will then be an estimate for a, the exponent of the asymptotic time complexity.
You should test this function using the data from the previous problem. Additionally in the assignment download there is a runTimeData. mat file that contains runtime data for 4 operations involving matrices. The first row corresponds to vector-vector multiplication (i. e., xTy where x and y are n-by-1 vectors). The first row corresponds to matrix-vector multiplication (i. e., Ay where y is a n-by-1 vector and A is a n-by-n matrix). The third row corresponds to matrix- matrix multiplication (i. e., AB where A and B are n-by-n matrices). The fourth row corresponds to solving a system of linear equations Ax = b (i. e., where b is a n-by-1 vector and A is a n-by-n matrix). An example using this function with the supplied data is given below.
begin code load runTimeData 2 3 alpha = estTC(nSize, runTime) 4 5 alpha 6 7 8 0.8193 1.8465 2.8224 2.5852 9 10 end code

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 19:30, ansley81
Assignment directions the owner of a popular local coffee shop has approached you to design a network for his business. he would like to offer his customers wifi access to the internet, but also thinks it might be handy to network the kitchen and store room together with the office computer he already uses for ordering, scheduling, and payroll. he thinks that might save him time doing inventory control and ordering. your assignment is to create a set of questions for him that will precisely define the purpose of the network and any constraints and restrictions on its implementation. assignment guidelines create a list of at least ten questions to ask your customer. of those ten questions, at least one question must come from each of the following subject areas: purpose of the network network access and security issue network availability and fault tolerance issues future expansion issues vendor issues briefly explain in two or three sentences why you would ask each question and what you expect to learn from your customer’s response. submission requirements your questions should meet the criteria of a good survey question by being specific, unambiguous, and closed-ended. all questions, as well as your explanations, should be written in proper english using correct grammar, spelling, and punctuation. use complete sentences, and do not use slang, texting abbreviations, or shortcuts.
Answers: 3
image
Computers and Technology, 22.06.2019 15:30, micahpauleen748
In a compound condition, both conditions on either side of the logical operator and must be true for the overall condition to be true. a: true b: false
Answers: 1
image
Computers and Technology, 23.06.2019 03:10, nxusasmangaliso8780
Fill in the following program so that it will correctly calculate the price of the orange juice the user is buying based on the buy one get one sale.#include //main functionint main() { int cartons; float price, total; //prompt user for input information printf("what is the cost of one container of oj in dollars? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & price); printf("how many containers are you buying? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & cartons); if ( [ select ] ["cartons / 2", "cartons % 1", "cartons % 2", "cartons % price", "cartons / price", "cartons / total"] [ select ] ["=", "==", "! =", "< =", "> =", "< "] 0) total = [ select ] ["price * cartons", "cartons * price / 2 + price", "(cartons / 2) * price", "cartons / (2.0 * price)", "(cartons / 2.0) * price + price", "((cartons / 2) * price) + price"] ; else total = ((cartons / 2) * price) + price; printf("the total cost is $%.2f.\n", total); return 0; }
Answers: 2
image
Computers and Technology, 24.06.2019 01:30, Cinders13
How can you make your column headings stand out?
Answers: 1
Do you know the correct answer?
In the present module, it was demonstrated that you could estimate the exponent of the asymptotic ti...

Questions in other subjects:

Konu
Mathematics, 10.12.2020 18:00