1) Let A and B be two programs that perform the same task. Let tA (n) and tB (n), respectively, denote their run times. For each of the following pairs, find the range of n values for which program A is faster than program B. Show the values for each and how you obtained them (justify).
a) tA (n) =1000n , tB (n) =10n^2
b) tA (n) = 2n^2 , tB (n) = n ^3
c) tA (n) = 2^n , tB (n) =100n
d) tA (n) =1000n logn , tB (n) = n^2
The best way of calculating this is by using an Excel sheet or a programming language with a looping construct. For the first column in excel I am putting value of n. Next column as tA(n), next as tB(n) and last column as tA(n)-tB(n). When the value of 4th column is negative it is when tA(n) is faster as compared to tB(n). The thing with excel is you can easily expand using the small dot at the bottom right of the cell. With a programming language you just need to add an if statement to find a starting point and by looking at functions you can detemined if there will be an ending point or not (if tA(n) is asymptotically smaller as compared to tB(n) then there will be no ending point).
a. n = 101 to infinity
b. n = 3 to infinity
c. n = 0 to 9
d. n = 3551 to infinity
1) Let A and B be two programs that perform the same task. Let tA (n)...
Consider four algorithms for doing the same task with exact running times of n log2 n, n 2 , n 3 , and 2n (the algorithms take n log2 n, n 2 , n 3 , and 2n operations to solve the problem), respectively, and a computer that can perform 10^10 operations per second. Determine the largest input size n that can be processed on the computer by each algorithm in one hour.
1. For each of the following choices of r(n) and N, you will perform the five tasks stated below (a) x(n (b) r(n)-2-a(n), Л-16, (d) x(n) is same as in part (c) with N = 8 otherwise Task 4: Compute DTFT of y. You may not be able to obtain a closed form expression for the DTFT of y. However since y has finite duration of length N, you can just code the analysis equation in Matlab. Let y(k 1)...
3. (25 points) Let TA and Te be two function returning the running time of algorithms A and B, defined by the recusions TA(n) T(2 and TR(n) T(2n2. Find the largest integer value of a for which algorithm B is asymptotically faster than A. Show your work and justify your answer in the PDF file. Answer in the MyCourses quiz.
Suppose we have two algorithms A1 and A2 for solving the same problem. Let T_1(n) be the worst case time complexity of Algorithm A1 and T_2(n) be the worst case time complexity of Algorithm A2. We know that T_1(1) = 1 and T_1(n) = 8 middot T_1(n/2) + 100n^2. We also know that T_2(1) = 1 and T_2(n) = 63 middot T_2(n/4) + 200 middot n^2. Use the master method to decide T_1(n). Follow all the steps as illustrated in...
a) Suppose that computer A executes 1 billion instructions per second, and computer B executes 10 million instructions per second, i.e, Computer A is 100 times faster than computer B in raw computing power. Suppose an expert programmer implements insertion sort in machine language for computer A, and the resulting code requires 2 * n2 instructions to sort n numbers. Suppose an average programmer implements merge sort, using a high-level language on computer B, with the resulting code taking 5...
2. Let (a, b) nonvanishing. Denote the Frenet frame by {T, N, B} vector a E R3 with R3 be smooth with = 1 and curvature k and torsion r, both Assume there exists a unit Ta constant = COS a. circular helix is an example of such curve a) Show that b) Show that N -a 0. c) Show that k/T =constant ttan a 2. Let (a, b) nonvanishing. Denote the Frenet frame by {T, N, B} vector a...
Problem 4 (20p). Let α > 0, and for each n E N let Xn : Ω R b probability space (2, F, P) with the gamma distribution Ta,n. Does there exist a random variable e a random variable on a Problem 4 (20p). Let α > 0, and for each n E N let Xn : Ω R b probability space (2, F, P) with the gamma distribution Ta,n. Does there exist a random variable e a random variable...
Two vessels A and B each contain N molecules of the same ideal monatomic gas at the same pressure P. Initially, the two vessels are thermally isolated from each other, and have initial temperatures TA and Ta respectively. The two vessels are brought into thermal contact, and reach equilibrium at the same pressure P and the new final temperature 7, 4-2 (a) Calculate an expression for the final temperature in terms of the initial temperatures. [2 marks] (b) Find the...
Let M be an n x n matrix with each entry equal to either 0 or 1. Let mij denote the entry in row i and column j. A diagonal entry is one of the form mii for some i. Swapping rows i and j of the matrix M denotes the following action: we swap the values mik and mjk for k = 1,2, ... , n. Swapping two columns is defined analogously. We say that M is rearrangeable if...
Two training programs have been devised to train people to assemble a particular mechanical component. Let p1 and p2 denote the proportion of assemblers trained by methods 1 and 2 respectively who can assemble a component in less than 10 minutes. It was found that 61 out of 80 people trained by method 1 could assemble a component in less than 10 minutes, and 43 out of 75 people trained by method 2 ccould assemble a component in less than...