a) f(x)=4x+8x+x+2 for x=3
= 2+x(4+8+1)
= 2+3(13)
= 2+39 =41
b) To convert between different positional of numeral systems we will use this method. In this method, case x is the base of the number system, and the ai coefficients are the digits of the x representation for a given number. And can also be used if x is a matrix, where the gain in computational efficiency is large. Actually, when x is a matrix, further acceleration is possible where we look deep into the structure of matrix multiplication, where only {\displaystyle {\sqrt {n}}}instead of n multiplies are needed (at the expense of requiring more storage)
c) O(n)= as we go with polynomial equation
Consider the following algorithm (known as Horner's rule) to evaluate f(x) = sigma_i=0^x a, x^i; poly...
f(x) = 2.10 Consider the following algorithm (known as Horner's rule) to evaluate -ax': poly = 0; for( i=n; i>=0; i--) poly = x * poly + ai a. Show how the steps are performed by this algorithm for x = 3, f(x) = 4x + 8x + x + 2. b. Explain why this algorithm works. c. What is the running time of this algorithm?
Consider the following algorithm Poly(A,a) --------------- 1. n = degree of polynomial (with coef A[n],..,A[0]) 2. sum = 0 3. for i = n downto 0 4. sum = sum * a +A[i] show all steps!! (a) Determine the running time of the algorithm, your work should explain your answer (b) what is the loop invariant property of the loop in line 3.
i=n Consider the following procedure to evaluate a polynomial a;x' at x = C. i = 0 procedure poly(ca ,...an power + 1 y cao for i from iton power + power * y+y+a; power return y where + denotes assignment, * denotes multiplication. Evaluate 3x2 + x + 1 at x = 2 by stepping through the algorithm.
|(a) Consider the following function for > 0 f (x)= = -4x 48x (i) Find the stationary point(s) of this function. (3 marks) (ii) Is this function convex or concave? Explain why. (3 marks) (iii What type of stationary point(s) have you found? Include your reasoning. (4 marks) |(b) Show that ln(a) - a has a global maximum and find the value of a > 0 that maximises it. Do the same for ln(a) - a" where n is a...
Consider the following algorithm. ALGORITHM Enigma(A[0.n - 1]) //Input: An array A[0.n - 1] of integer numbers for i leftarrow 0 to n - 2 do for j leftarrow i +1 to n - 1 do if A[i] = = A[j] return false return true a) What does this algorithm do? b) Compute the running time of this algorithm.
Consider the following Python function: def find_max (L): max = 0 for x in L: if x > max: max = x return max Suppose list L has n elements. In asymptotic notation, determine the best case running time as function of n In asymptotic notation, determine the worst case running time as function of n Now, assume L is sorted. Give an algorithm that takes asymptotically less time than the above algorithm, but performs the same function. Prove that...
Consider f : [0, 1] x [0, 1] C R2 + R defined by f(x,y) = ſi if y is rational 2x if y is irrational Show that f is not integrable over R by the following steps: in (a) For each n > 1, find a Sn:= Eosi,jan f(a 6? b., in [0, 1] for 0 < i, j < n such that the Riemann sum converges as n + 0.[10 pts] n 1 n2 n i, ja (b)...
Subject: Algorithm solve only part 4 and 5 please. need urgent. 1 Part I Mathematical Tools and Definitions- 20 points, 4 points each 1. Compare f(n) 4n log n + n and g(n)-n-n. Is f E Ω(g),fe 0(g), or f E (9)? Prove your answer. 2. Draw the first 3 levels of a recursion tree for the recurrence T(n) 4T(+ n. How many levels does it have? Find a summation for the running time. (Extra Credit: Solve it) 3. Use...
-/3 POINTS GHCOLALG12 3.3.052. Evaluate the piecewise-defined function. (8x if x < 0 f(x) = 9- if OS X < 8 (1x if x 28 (a) R-0.5) = (b) f(0) = (c) R(8) = Show My Work (Optional) 19. -/3 POINTS GHCOLALG12 3.3.064. Evaluate the function at the indicated x values. Rx) = [3x] (a) (6) (b) f(-4) = (c) R-1.8) - Show My Work (Optional)
[10 marks] consider the following pseudocode: p := 0 x := 2fori:= 2ton p := (p + i ) * x a) How many addition(s) and multiplication(s) are performed by the above pseudocode?b) Express the time-complexity of the pseudocode using the big-Θ notation.) Trace the algorithm, below, then answer (c) and (d): Procedure xyz(n: integer) s := 0, for i:= 1 to n, for j:= 1to i, s:= s+ j*(i− j+ 1) return s c) What is the time-complexity for...