
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
5. Rewrite the statements below as an implication (that is, in "if... then..." structure).
n is an even integer, or n = 2k - 1 for some k Є Z.
x²> 0 or x = 0.
6. Rewrite each statement below as a disjunction (an or statement).
If I work in the summer, then I can take a vacation.
• If x2
y.
4. Negate the following sentences. Then (where appropriate) indicate whether the orig-
inal statement is true, or the negation is true.
⚫ If I take linear algebra, then I will do my homework or go to class.
• (x > 2 or x < −2) ⇒ |x| ≥ 2
• P⇒ (QVR) ⇒(¬PV QV R)
Vn EN Em E Q (nm =
1)
• Ex E N Vy & Z (x. y = 1)
8. Give three statements that are logically equivalent to x ≥ 0⇒ (x² = 0V −x < 0).
You may use any equivalences that you like.
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
- 3. Let P, Q, and R be arbitrary statements, and let x E R. Determine whether the statements below are equivalent using whatever method you like. • • -[-P → (QVR)] and ¬(¬P V Q) A¬R (PA¬Q) ⇒(¬PVS) and (SVP) VQ • x = 4 and √√√x=2 x = 4 and x2. = 16arrow_forward7. Write the inverse, converse, and contrapositive. Which are true? Which are false? If x is an even integer, then x² + 3x + 5 is an odd integer. If y 5n+1 for some natural number If a <0, then 2a < 0. n, then 5 y.arrow_forward5. The volume V of a given mass of monoatomic gas changes with temperat re T according to the relation V = KT2/3. The work done when temperature changes by 90 K will be xR. The value of x is (a) 60 (b)20 (c)30 S (d)90arrow_forward
- Consider a matrix 3 -2 1 A = 0 5 4 -6 2 -1 Define matrix B as transpose of the inverse of matrix A. Find the determinant of matrix A + B.arrow_forward5) State any theorems that you use in determining your solution. a) Suppose you are given a model with two explanatory variables such that: Yi = a +ẞ1x1 + ẞ2x2i + Ui, i = 1, 2, ... n Using partial differentiation derive expressions for the intercept and slope coefficients for the model above. [25 marks] b) A production function is specified as: Yi = α + B₁x1i + ẞ2x2i + Ui, i = 1, 2, ... n, u₁~N(0,σ²) where: y = log(output), x₁ = log(labor input), x2 = log(capital input) The results are as follows: x₁ = 10, x2 = 5, ỹ = 12, S11 = 12, S12= 8, S22 = 12, S₁y = 10, = 8, Syy = 10, S2y n = 23 (individual firms) i) Compute values for the intercept, the slope coefficients and σ². [20 marks] ii) Show that SE (B₁) = 0.102. [15 marks] iii) Test the hypotheses: ẞ1 = 1 and B2 = 0, separately at the 5% significance level. You may take without calculation that SE (a) = 0.78 and SE (B2) = 0.102 [20 marks] iv) Find a 95% confidence interval for the estimate ẞ2. [20 marks]arrow_forwardPage < 2 of 2 - ZOOM + The set of all 3 x 3 upper triangular matrices 6) Determine whether each of the following sets, together with the standard operations, is a vector space. If it is, then simply write 'Vector space'. You do not have to prove all ten vector space axioms. If it is not, then identify one of the ten vector space axioms with its number in the attached sheet that fails and also show that how it fails. a) The set of all polynomials of degree four or less. b) The set of all 2 x 2 singular matrices. c) The set {(x, y) : x ≥ 0, y is a real number}. d) C[0,1], the set of all continuous functions defined on the interval [0,1]. 7) Given u = (-2,1,1) and v = (4,2,0) are two vectors in R³-space. Find u xv and show that it is orthogonal to both u and v. 8) a) Find the equation of the least squares regression line for the data points below. (-2,0), (0,2), (2,2) b) Graph the points and the line that you found from a) on the same Cartesian coordinate plane.arrow_forward
- Page < 1 of 2 - ZOOM + 1) a) Find a matrix P such that PT AP orthogonally diagonalizes the following matrix A. = [{² 1] A = b) Verify that PT AP gives the correct diagonal form. 2 01 -2 3 2) Given the following matrices A = -1 0 1] an and B = 0 1 -3 2 find the following matrices: a) (AB) b) (BA)T 3) Find the inverse of the following matrix A using Gauss-Jordan elimination or adjoint of the matrix and check the correctness of your answer (Hint: AA¯¹ = I). [1 1 1 A = 3 5 4 L3 6 5 4) Solve the following system of linear equations using any one of Cramer's Rule, Gaussian Elimination, Gauss-Jordan Elimination or Inverse Matrix methods and check the correctness of your answer. 4x-y-z=1 2x + 2y + 3z = 10 5x-2y-2z = -1 5) a) Describe the zero vector and the additive inverse of a vector in the vector space, M3,3. b) Determine if the following set S is a subspace of M3,3 with the standard operations. Show all appropriate supporting work.arrow_forwardPlease help solve the following whilst showing all working out. Is part of exam revision questions but no solution is givenarrow_forwardplease help me with this question with working out thanksarrow_forward
- Page < 1 of 2 - ZOOM + 1) a) Find a matrix P such that PT AP orthogonally diagonalizes the following matrix A. = [{² 1] A = b) Verify that PT AP gives the correct diagonal form. 2 01 -2 3 2) Given the following matrices A = -1 0 1] an and B = 0 1 -3 2 find the following matrices: a) (AB) b) (BA)T 3) Find the inverse of the following matrix A using Gauss-Jordan elimination or adjoint of the matrix and check the correctness of your answer (Hint: AA¯¹ = I). [1 1 1 A = 3 5 4 L3 6 5 4) Solve the following system of linear equations using any one of Cramer's Rule, Gaussian Elimination, Gauss-Jordan Elimination or Inverse Matrix methods and check the correctness of your answer. 4x-y-z=1 2x + 2y + 3z = 10 5x-2y-2z = -1 5) a) Describe the zero vector and the additive inverse of a vector in the vector space, M3,3. b) Determine if the following set S is a subspace of M3,3 with the standard operations. Show all appropriate supporting work.arrow_forwardUsing Karnaugh maps and Gray coding, reduce the following circuit represented as a table and write the final circuit in simplest form (first in terms of number of gates then in terms of fan-in of those gates).arrow_forwardConsider the alphabet {a, b, c}.• Design a regular expression that recognizes all strings over {a, b, c} that have at least three nonconsec-utive c characters (two characters are non-consecutive if there is at least one character between them)and at least one a character.• Explain how your regular expression recognizes the string cbbcccac by clearly identifying which partsof the string match to the components of your regular expressionarrow_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