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?
- Suppose that a Professor were to develop a method of multiplying two 12 x 12 matrices using 150 scalar multiplications and a constant number of scalar additions and subtractions: What is the recurrence equation that describes the resulting divide and conquer algorithm for multiplying two n x n matrices? And what is the asymptotic solution of the equation (use big O notation)?arrow_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
- (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_forwardSolve the following recurrence using the iteration technique. () T(1) = 1 T(n) = 4T + narrow_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_forward
- Given 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_forwardUsing the substitution method, prove that: T(n) = T(n − 1) + 4n is O(n^2)arrow_forward
- 6. 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_forwardCan help in cpp check the sequence of integers a [1], a [2], ... a [n-1] if it is monotonically increasing, (1 <= n <= 100)arrow_forwardSolve following recurrence with iterative substitution: T(n)= 2T(n/2)+c *O(1)arrow_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