Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
expand_more
expand_more
format_list_bulleted
Question
Chapter 30, Problem 6P
a.
Program Plan Intro
To provide a simple heuristic argument for expecting k to be approximately , in case one search for the smallest k such that
b.
Program Plan Intro
To show that discrete Fourier Transform and inverse Fourier transform are inverse operation.
c.
Program Plan Intro
To show how to make the FFT and its inverse work modulo p in time
d.
Program Plan Intro
To compute the DFT modulo p = 17 of the
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Implement the modular exponentiation (a.k.a. fast exponentiation)
function mod_exp (b, n, m) to compute bn (mod m) more efficiently. (Hint: to
read n bit-by-bit, use / and % operations repeatedly)
a) Test your function for b = 3, n = 231 – 2, m = 231 – 1.
b) Report the result and the time (in seconds) it takes to find the result.
Q3. [30 pts] Modify your is_prime function to use the mod_exp (b, n, m) instead of
the standard power operation (b**n % m). Rename it as is_prime2. Modify the
mersenne (p) function to use is_prime2, and call it mersenne2.
a) Use the modified function mersenne2 to print all the Mersenne primes
Mp for p between 2 and 31 if possible, (with k = 3 in the is_prime
function). Compare the results with the ones found in Q1.
b) Gradually increase the range of p to find more Mersenne primes (say up
to p = 101 if possible). What is the largest Mersenne prime you can
achieve here?
c) Extend the work in part (b) and find the maximum Mersenne prime you
can get from this…
Given an integer say 45, to find the sum of 45 with 8 in binary form (see
the figure below), we can use the TM designed in slides 79-90 of the notes
"Turing Machines and Equivalent Models I" twice to find the result. A more
effective way is to design a TM to do the addition with 8 directly.
1000
101101 A
+
=
?
Such a TM can be designed by extending the TM designed in slides 79-90
of the notes "Turing Machines and Equivalent Models I". The TM has 14
instructions and 6 states: 0, 1, 2, 3, 4, and halt. Six instructions of such a
TM have been given in the first and the second tables below. Fill out the
remaining blanks in the first and the second tables and also blanks in the
third table to show the remaining instructions of the TM (you have to use
your own text boxes here)
Implement the following error detection and error correction algorithms using C programming for Hamming code.
For Hamming codes, flip a bit in the data and implement the algorithm to correct the same on the receiver side.
Knowledge Booster
Similar questions
- When multiplying an elliptic curve point P by a positive integer n, it can be done in O(log n) time by doubling an accumulator and adding P according to the bit pattern of n. For example, 6P can be expressed as ((0*2+P)*2+P)*2. In the format shown above, show the sequence of doubles and adds, from left to right, needed to compute 11P. 11 in binary is 1011. Autograder format: Begin with 0*2. After each +P close a parentheses (don't forget the opening parentheses) and after each *2 do not insert a close parentheses. Because of the order of operations these are the only parentheses needed. Do not insert any other parentheses or any spaces. Hint: there should be exactly three close parentheses.arrow_forwardImplement the following function F(x,y,z) using a decoder. This function will return 1 if the value is divisible by Four otherwise it will return zero. asap pls.arrow_forwardGive regular expressions for the i (a) {w : w contains at most two 1s} (b) {w : w contains at least two 1s} (c) {w: every odd position in w is 1} (d) {w : w contains an even number of 0s, orarrow_forward
- A certain picture is constructed of a matrix of dots of color which have been created by mixing 3 primary colors of ink, where each ink color can have one of 320 different amounts (i.e. different intensities). If the picture has 106 x 106 dots of color, then what is the minimum number of Bytes (in kB to one decimal place) it would take to store a digitized image of this picture?arrow_forwardGF(8) is defined like GF(256) except the polynomials all have degree less than 3 and the modulus is + x + 1. Which of the following is the multiplicative inverse of O10 in GF(8)? 001 011 110 100 None of thesearrow_forwardLet us define a sequence parity function as a function that takes in a sequence of binary inputs and returns a sequence indicating the number of 1’s in the input so far; specifically, if at time t the 1’s in the input so far is even it returns 1, and 0 if it is odd. For example, given input sequence [0, 1, 0, 1, 1, 0], the parity sequence is [0, 0, 0, 1, 0, 0]. Implement the minimal vanilla recurrent neural network to learn the parity function. Explain your rationale using a state transition diagram and parameters of the network.arrow_forward
- Consider the following multiplication problem: where each P stands for a (possibly different) prime digit (so 2, 3, 5 or 7).Formulate this problem as a CSP. For your information: this problem has a unique solution, namely: see image below:arrow_forwardنقطة واحدة Unstable systems usually exhibit erratic and extreme behavior and cause overflow in any practical. True O False O نقطة واحدة A discrete-time signal is an indexed sequence of real or complex numbers. Thus, a discrete-time signal is a function of an integer-valued variable, n, that is denoted by x(n). Although the independent variable n need not necessarily represent "time" (n may, for example, correspond to a spatial coordinate or distance), x(n) is generally referred to as a function of time. True O False Oarrow_forwardThe latest super-duper supercomputer has memory locations that are 64-bits wide. What is the largest unsigned integer that can be stored in one memory location? Suppose that we use sign-magnitude for storing negative numbers and dedicate one bit for a sign bit. What would be the largest POSITIVE integer that can be stored in a memory location.arrow_forward
- The assignment is to create a MIPS program that demonstrates that the associative law fails in addition for floating point numbers (single or double precision). You only need to demonstrate it for single precision. Remember the associative law is a + (b + c) = (a + b) + c. The key is to have two of the number large (one positively and one negatively but equal in magnitude) floating point numbers and the third floating point number very small in comparison. ***Please make sure you include comments in every field*** Note: make sure the program operats and doesnt run with errors like: operand is of incorrect type or not formattedarrow_forwardProvide a counter example for: The number n is an even integer if and only if 3n + 2 is an even integer.arrow_forwardGiven that a,b,c,d,e are distinct whole numbers from 1 to 9 inclusive, along with the equalityab=c⋅100+d⋅10+e where c⋅100+d⋅10+e is the largest possible value, find the value ofa+b+c+d+earrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- 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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education