The “divide and average” method, an old-time method for approximating the square root of any positive number a can be formulated as
(a) Write well-structured pseudocode to implement this algorithm as depicted in Fig. P2.7. Use proper indentation so that the structure is clear.
(b) Develop, debug, and document a program to implement this equation in either a high-level language or a macro language of your choice. Structure your code according to Fig. P2.7.
FIGURE P2.7
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
EBK NUMERICAL METHODS FOR ENGINEERS
Additional Engineering Textbook Solutions
Basic Technical Mathematics
Advanced Engineering Mathematics
Fundamentals of Differential Equations (9th Edition)
Differential Equations and Linear Algebra (4th Edition)
Precalculus Enhanced with Graphing Utilities (7th Edition)
- Suppose that the check digit is computed as described in Example . Prove that transposition errors of adjacent digits will not be detected unless one of the digits is the check digit. Example Using Check Digits Many companies use check digits for security purposes or for error detection. For example, an the digit may be appended to a -bit identification number to obtain the -digit invoice number of the form where the th bit, , is the check digit, computed as . If congruence modulo is used, then the check digit for an identification number . Thus the complete correct invoice number would appear as . If the invoice number were used instead and checked, an error would be detected, since .arrow_forwardAccording to the Master Theorem, what is the run time of the algorithm described by the function T(n) - 4T () +e(nº")arrow_forwardDetermine which characteristics of an algorithm the following procedures have and which they lack. procedure divide(n: positive integer) while n begin m := 1 /n n:=n - 1 endarrow_forward
- Consider the following LP:min 5x1 + 4x2s.t. x1 + x2 ≥ 12x1 − x2 ≥ 13x2 ≤ 2x1, x2 ≥ 0.a. Write down the dual of this LP.b. We know that by strong duality, we can either solve this LP or its dual form to get the sameoptimal objective value. If you apply the simplex algorithm, which one would you rathersolve? Make your choice and apply the simplex algorithm to solve it.arrow_forwardPlease try to solve it in 30 minutearrow_forwardHow exactly does one go about utilizing numerical methods to solve a set of equations that have been arranged in a system? Provide your own explanation of the algorithm used in at least one of the methods.arrow_forward
- Use the Euclidean algorithm to find gcd(311562,285912). You may use a calculator, but must write out all of the steps of the Euclidean algorithm. You do not have to express the gcd as a linear combination of the given integers.arrow_forwardDiscrete matharrow_forwardWhat is the use of the Euclidean algorithm?arrow_forward
- Elements Of Modern AlgebraAlgebraISBN:9781285463230Author:Gilbert, Linda, JimmiePublisher:Cengage Learning,Linear Algebra: A Modern IntroductionAlgebraISBN:9781285463247Author:David PoolePublisher:Cengage LearningAlgebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:Cengage
- Mathematics For Machine TechnologyAdvanced MathISBN:9781337798310Author:Peterson, John.Publisher:Cengage Learning,