a.
To multiply two linear polynomials
a.
Explanation of Solution
Multiply two linear polynomials
Thus, the product of two polynomials is as follows:
b.
To provide two divide-and-conquer
b.
Explanation of Solution
Method 1(for dividing the input polynomial coefficients into a high half and low half):
Take two polynomials be
Now, assume that two polynomials are to be multiplied. Then,High half will be
Since, it is known that
Now on using master’s theorem the recurrence for above is calculatedto be as follows:
Method2(for dividingthe input polynomial coefficients based onif the index is even or odd the procedure):
Assume the odd index beOiand even index be Eisuch that
Then,
Therefore,
Now on using master’s theorem the recurrence for above is calculatedto be as follows:
c.
To show methodto multiply two n-bit integers in
c.
Explanation of Solution
To multiply two n-bit integers in
The generalization of the polynomial can be given as
The two n-bit integers can be taken as
These two algorithms are developed to solve the multiplication problem of polynomialwith run time of
Want to see more full solutions like this?
- Find the relation between the following functions: f(n) = log n and g(n) = Vn. (Square root for n)Hint: you may use L'Hopital's Theorem. For function f(n)=log n and time t=1 second, determine the largest size n of a problem that can be solved in time t, assume that the algorithm to solve the problem takes f(n) microseconds. Suppose you have algorithms with the two running times listed below. Suppose you have a computer that can perform 6 operations per second, and you need to compute a result in at most an hour of computation. For each of the algorithms, what is the largest input size n for which you would be able toget the result within an hour for:a) n^3b)10n^2arrow_forwardSolve the following recurrence: = T(;) + Tm) + n Expand the recurrence to obtain a summation. ]arrow_forwardFind all solutions for the following pair of simultaneous congruences. 5x = 9 (mod 11) 3x = 8 (mod 13)arrow_forward
- Solve the following recurrence using the iteration technique. () T(1) = 1 T(n) = 4T + narrow_forwardGiven a real number x and a positive integer k, determinethe number of multiplications used to find x^(2^k)startingwith x and successively squaring (to find x^2, x^4, and soon). Is this a more efficient way to find x^(2^k)than by multiplying x by itself the appropriate number of times?arrow_forward- You are given two sorted arrays of integers A and B of size m and n respectively. Describe a divide and conquer algorithm that takes O(logk) time for computing the k th smallest element in the union of the two arrays. Assume that the integers in both arrays are distinct, and no integers in A appear in B (and vice versa). Explain carefully why your algorithm takes O(logk) time. Hint: The k – th smallest element in the union of the two arrays has to be contained in A[1...k] and B[1...k].arrow_forward
- (1) Next try writing a simple function euler_phi to compute Euler's function. This should take an integer n, and for each i from 1 to n − 1, adds one to a counter each time we have gcd(i, n) = 1 (i.e., for each i which is relatively prime to n). Is this code quicker than semiprime_factorisation1? That is, if we wanted to compute (n) for n semiprime, is it quicker to use euler_phi directly, or to use semiprime_factorisation and then calculate (n) = (p − 1)(q − 1)? (2) It's not too hard to see that a faster semiprime factorisation function is trial division, also called direct search factorisation. This simply involves dividing n by each integer from 2 to [√n], to find integers which divide n exactly (that is, have a remainder of zero). Write a function semiprime_factorisation2 which takes an integer n, which is a semiprime (i.e., is the product of two primes p and q), and returns both p and q. Remember to use integer division here, with //. Test your function on some values of n = pq.…arrow_forward7. For n 2 1, in how many out of the n! permutations T = (T(1), 7(2),..., 7 (n)) of the numbers {1, 2, ..., n} the value of 7(i) is either i – 1, or i, or i +1 for all 1 < i < n? Example: The permutation (21354) follows the rules while the permutation (21534) does not because 7(3) = 5. Hint: Find the answer for small n by checking all the permutations and then find the recursive formula depending on the possible values for 1(n).arrow_forwardUsing the substitution method, prove that: T(n) = T(n − 1) + 4n is O(n^2)arrow_forward
- Solve following recurrence with iterative substitution: T(n)= 2T(n/2)+c *O(1)arrow_forward6. Define the following (almost Fibonacci) recurrence for n = 0 Gn for n = 1 = Gn-1+ Gn-2+1 for n 22 Find the values of Go, G1,..., G10- Express Gn as a function of Fibonacci numbers. Prove that your expression for G, is correct for all n 2 0.arrow_forwardStep 3) In this stage we do the exponentiation in the smaller groups. Xp Ур x q = Cp Cq da = Yq dp Step 4) We now return to the big group using the formula x = qcp xp + pcqq mod N. qx In this formula, Cp Cq = p¯¹ = = mod p = And finally, X = mod q = = mod q. q-¹ mod p andarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education