Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 ) Complete this table rounding each decimal to the nearest integer. This should give you a senseof the comparative growth rates of the functions.
Complete this table rounding each decimal to the nearest integer. This should give you a senseof the comparative growth rates of the functions. Note that lgn means pythons logn lgnnnn nn nnnnnnnn nn nnnn nn For # and solve each summation in two ways: write out all terms of the sum and perform the arithmetic; then use one of the formulas in the class notes to confirm your answer. ii iiii ii Follow the same instructions for # and #; round off this answer to three decimal places. iiii For # solve this summation in two ways: write out all terms of the sum, but there will be no arithmetic to perform; then use one of the formulas in the class notes to express the sum as a polynomial function of n nn ii iiAsymptotic analysis for # and #: Determine the BigOh class of each algorithm. That is formally compute the worstcase running time as we did on class using a table to produce a function that tracks the work required by all lines of code. Include all steps of the algebraic simplification, but you do not need to provide comments to justify each step. Arithmetic mean add them all up and divide by how many Let the size of the problem n the number of entries in the array. # Input: an array A of real numbers # Output: the arithmetic mean of the entries in the array def arithmeticMeanA: sum count for x in A: sum x count average sumcount return average Sum of entries in an upper triangular nxn array. Let the size of the problem n thedimension of the nxn matrix. # Input: an upper triangular square matrices A where all entries below the diagonal # and an integer n giving the dimension of this nxn matrix # Output: a real number giving the sum of the entries def UpperTriangularMatrixSum A n: sum for i in range n: for j in rangei n: sum Aij return sum
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