
EBK NUMERICAL METHODS FOR ENGINEERS
7th Edition
ISBN: 8220100254147
Author: Chapra
Publisher: MCG
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 2, Problem 25P
The pseudocode in Fig. P2.25 computes the factorial. Express this algorithm as a well-structured function in the language of your choice. Test it by computing 0! and 5!. In addition, test the error trap by trying to evaluate
FIGURE P2.25
Expert Solution & Answer

Want to see the full answer?
Check out a sample textbook solution
Students have asked these similar questions
Example: For what odd primes p is 11 a quadratic residue modulo p?
Solution:
This is really asking "when is (11 | p) =1?"
First, 11 = 3 (mod 4). To use LQR, consider two cases p = 1 or 3 (mod 4):
p=1 We have 1 = (11 | p) = (p | 11), so p is a quadratic residue modulo 11. By
brute force:
121, 224, 3² = 9, 4² = 5, 5² = 3 (mod 11)
so the quadratic residues mod 11 are 1,3,4,5,9.
Using CRT for p = 1 (mod 4) & p = 1,3,4,5,9 (mod 11).
p = 1
(mod 4)
&
p = 1
(mod 11
gives p
1
(mod 44).
p = 1
(mod 4)
&
p = 3
(mod 11)
gives p25
(mod 44).
p = 1
(mod 4)
&
p = 4
(mod 11)
gives p=37
(mod 44).
p = 1
(mod 4)
&
p = 5
(mod 11)
gives p
5
(mod 44).
p = 1
(mod 4)
&
p=9
(mod 11)
gives p
9
(mod 44).
So p =1,5,9,25,37 (mod 44).
how to construct the following same table?
please work out more details give the solution.
Chapter 2 Solutions
EBK NUMERICAL METHODS FOR ENGINEERS
Ch. 2 - 2.1 Write pseudocode to implement the flowchart...Ch. 2 - Prob. 2PCh. 2 - 2.3 Develop, debug, and document a program to...Ch. 2 - The sine function can be evaluated by the...Ch. 2 - 2.5 Develop, debug, and document a program for...Ch. 2 - The following algorithm is designed to determine a...Ch. 2 - The divide and average method, an old-time method...Ch. 2 - 2.8 An amount of money P is invested in an account...Ch. 2 - 2.9 Economic formulas are available to compute...Ch. 2 - 2.10 The average daily temperature for an area can...
Ch. 2 - Develop, debug, and test a program in either a...Ch. 2 - 2.12 The bubble sort is an inefficient, but...Ch. 2 - Figure P2.13 shows a cylindrical tank with a...Ch. 2 - 2.14 Two distances are required to specify the...Ch. 2 - Develop a well-structured function procedure that...Ch. 2 - Prob. 16PCh. 2 - Develop well-structured programs to (a) determine...Ch. 2 - 2.18 Piecewise functions are sometimes useful when...Ch. 2 - Develop a well-structured function to determine...Ch. 2 - 2.20 Develop a well-structured function to...Ch. 2 - 2.21 Manning’s equation can be used to compute the...Ch. 2 - 2.22 A simply supported beam is loaded as shown in...Ch. 2 - ThevolumeV of liquid in ahollow horizontal...Ch. 2 - 2.24 Develop a well-structured program to compute...Ch. 2 - The pseudocode in Fig. P2.25 computes the...Ch. 2 - 2.26 The height of a small rocket y can be...Ch. 2 - 2.27 As depicted in Fig. P2.27, a water tank...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, mechanical-engineering and related others by exploring similar questions and additional content below.Similar questions
- Burger Dome sells hamburgers, cheeseburgers, french fries, soft drinks, and milk shakes, as well as a limited number of specialty items and dessert selections. Although Burger Dome would like to serve each customer immediately, at times more customers arrive than can be handled by the Burger Dome food service staff. Thus, customers wait in line to place and receive their orders. Burger Dome analyzed data on customer arrivals and concluded that the arrival rate is 30 customers per hour. Burger Dome also studied the order-filling process and found that a single employee can process an average of 44 customer orders per hour. Burger Dome is concerned that the methods currently used to serve customers are resulting in excessive waiting times and a possible loss of sales. Management wants to conduct a waiting line study to help determine the best approach to reduce waiting times and improve service. Suppose Burger Dome establishes two servers but arranges the restaurant layout so that an…arrow_forwardNote: A waiting line model solver computer package is needed to answer these questions. The Kolkmeyer Manufacturing Company uses a group of six identical machines, each of which operates an average of 18 hours between breakdowns. With randomly occurring breakdowns, the Poisson probability distribution is used to describe the machine breakdown arrival process. One person from the maintenance department provides the single-server repair service for the six machines. Management is now considering adding two machines to its manufacturing operation. This addition will bring the number of machines to eight. The president of Kolkmeyer asked for a study of the need to add a second employee to the repair operation. The service rate for each individual assigned to the repair operation is 0.50 machines per hour. (a) Compute the operating characteristics if the company retains the single-employee repair operation. (Round your answers to four decimal places. Report time in hours.) La = L = Wa = W =…arrow_forwardUse the Euclidean algorithm to find two sets of integers (a, b, c) such that 55a65b+143c: Solution = 1. By the Euclidean algorithm, we have: 143 = 2.65 + 13 and 65 = 5.13, so 13 = 143 – 2.65. - Also, 55 = 4.13+3, 13 = 4.3 + 1 and 3 = 3.1, so 1 = 13 — 4.3 = 13 — 4(55 – 4.13) = 17.13 – 4.55. Combining these, we have: 1 = 17(143 – 2.65) - 4.55 = −4.55 - 34.65 + 17.143, so we can take a = − −4, b = −34, c = 17. By carrying out the division algorithm in other ways, we obtain different solutions, such as 19.55 23.65 +7.143, so a = = 9, b -23, c = 7. = = how ? come [Note that 13.55 + 11.65 - 10.143 0, so we can obtain new solutions by adding multiples of this equation, or similar equations.]arrow_forward
- - Let n = 7, let p = 23 and let S be the set of least positive residues mod p of the first (p − 1)/2 multiple of n, i.e. n mod p, 2n mod p, ..., p-1 2 -n mod p. Let T be the subset of S consisting of those residues which exceed p/2. Find the set T, and hence compute the Legendre symbol (7|23). 23 32 how come? The first 11 multiples of 7 reduced mod 23 are 7, 14, 21, 5, 12, 19, 3, 10, 17, 1, 8. The set T is the subset of these residues exceeding So T = {12, 14, 17, 19, 21}. By Gauss' lemma (Apostol Theorem 9.6), (7|23) = (−1)|T| = (−1)5 = −1.arrow_forwardLet n = 7, let p = 23 and let S be the set of least positive residues mod p of the first (p-1)/2 multiple of n, i.e. n mod p, 2n mod p, ..., 2 p-1 -n mod p. Let T be the subset of S consisting of those residues which exceed p/2. Find the set T, and hence compute the Legendre symbol (7|23). The first 11 multiples of 7 reduced mod 23 are 7, 14, 21, 5, 12, 19, 3, 10, 17, 1, 8. 23 The set T is the subset of these residues exceeding 2° So T = {12, 14, 17, 19, 21}. By Gauss' lemma (Apostol Theorem 9.6), (7|23) = (−1)|T| = (−1)5 = −1. how come?arrow_forwardShading a Venn diagram with 3 sets: Unions, intersections, and... The Venn diagram shows sets A, B, C, and the universal set U. Shade (CUA)' n B on the Venn diagram. U Explanation Check A- B Q Search 田arrow_forward
- Find all solutions of the polynomial congruence x²+4x+1 = 0 (mod 143). (The solutions of the congruence x² + 4x+1=0 (mod 11) are x = 3,4 (mod 11) and the solutions of the congruence x² +4x+1 = 0 (mod 13) are x = 2,7 (mod 13).)arrow_forwardDetermine whether each function is an injection and determine whether each is a surjection.The notation Z_(n) refers to the set {0,1,2,...,n-1}. For example, Z_(4)={0,1,2,3}. f: Z_(6) -> Z_(6) defined by f(x)=x^(2)+4(mod6). g: Z_(5) -> Z_(5) defined by g(x)=x^(2)-11(mod5). h: Z*Z -> Z defined by h(x,y)=x+2y. j: R-{3} -> R defined by j(x)=(4x)/(x-3).arrow_forwardDetermine whether each function is an injection and determine whether each is a surjection.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Algebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:CengageAlgebra: Structure And Method, Book 1AlgebraISBN:9780395977224Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. ColePublisher:McDougal LittellMathematics For Machine TechnologyAdvanced MathISBN:9781337798310Author:Peterson, John.Publisher:Cengage Learning,
- Linear Algebra: A Modern IntroductionAlgebraISBN:9781285463247Author:David PoolePublisher:Cengage LearningElements Of Modern AlgebraAlgebraISBN:9781285463230Author:Gilbert, Linda, JimmiePublisher:Cengage Learning,
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:9781133382119
Author:Swokowski
Publisher:Cengage

Algebra: Structure And Method, Book 1
Algebra
ISBN:9780395977224
Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:McDougal Littell

Mathematics For Machine Technology
Advanced Math
ISBN:9781337798310
Author:Peterson, John.
Publisher:Cengage Learning,

Linear Algebra: A Modern Introduction
Algebra
ISBN:9781285463247
Author:David Poole
Publisher:Cengage Learning

Elements Of Modern Algebra
Algebra
ISBN:9781285463230
Author:Gilbert, Linda, Jimmie
Publisher:Cengage Learning,
12. Searching and Sorting; Author: MIT OpenCourseWare;https://www.youtube.com/watch?v=6LOwPhPDwVc;License: Standard YouTube License, CC-BY
Algorithms and Data Structures - Full Course for Beginners from Treehouse; Author: freeCodeCamp.org;https://www.youtube.com/watch?v=8hly31xKli0;License: Standard Youtube License