
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
From Fundamentals of Discrete Math for Computer Science: A Problem-Solving Primer, 2nd edition
Apply

Transcribed Image Text:// When the condition between the "If" and "Then" is true, the steps between
// This pseudo-code contains 2 conditional statements with no Else part:
it can be madé as
Algorithm 1.4.1: The Bisection Algorithm for Solving f(x) = T
Begin
z - (A + B) / 2;
While (z - A >= d) Do
If (f(z)<= T) Then
A - z;
%3D
End;
If (f(z)>= T) Then
BE Z;
End;
z - (A + B) / 2;
End;
Return(z);
End.
// “Then" and “End" are done. but when it is false nothing at all is o
// What would happen if at some point, (z) = T?
%3D

Transcribed Image Text:1.4 Numerical Solutions
39
Walkthrough with input f(x) = x' + 2*, T = 200, A = 5, B = 10, and ô = 0.005:
/ Each line in the table corresponds to fixed values of A and B (and z between them).
%3D
|z - A|
A
B
f (z)
5
7.5
10
2.5
602.894 ...
6.25
7.5
1.25
320.249 ...
5.625
6.25
%3D
.625
227.329 ...
5.3125
5.625
.3125
189.672 ...
5.3125
5.46875
.15625
207.840 ..
...
5.390625
5.46875
.078125
198.596 ...
5.390625
5.4296875
.0390625
203.177 ...
5.41015625
5.4296875
.01953125
200.876 ...
5.400390625
5.41015625
.009765625
199.733 ...
5.400390625 5.4052734375
.0048828125 (200.304...)
The algorithm returns z =
f the equation, x*, and this number has an absolute error that is < 8
5.405 273 437 5 as an approximation of the solution
0.005.
If we continue, we find 5.402 668 655 < x* < 5.402 668 656,
but no one can ever know the exact (numerical) value of x*.
Before this algorithm can be executed, certain “preconditions" must be met:
f(x) must be a continuous and computable function.
A target value T for the function f(x) must be specified
. An x-value A where (A) < T must be specified.
. An x-value B where f(B) > T must be specified.
A bound ô on the absolute error in the approximation must be given.
// "guessed" somehow
// “guessed" too
Continuity is a concept from calculus; it ensures f has no sudden "jumps" in
value so that the Intermediate Value Theorem applies.
And f must be in a form that can be evaluated fairly accurately despite roundoff
errors. In practical applications, this precondition is almost always met.
Very often the target value T for the function is taken to be zero.
Preconditions 3 and 4 imply that A # B and (at least one) exact solution x* is
between A and B.
Therefore, either A < x* < B or B < x* < A.
ô provides "quality control"; it specifies how "good" an approximation we will
get and gives a termination criterion for the algorithm.
But how many iterations will be done?
A
Zi
В
X**
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 3 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Exercise 1.A set W of strings of symbols is defined recursively by a, b, and d belong to W. If x belongs to W, so does a(x)d. Provide 3 strings made of 3 letters each belonging to W and show the procedure used to obtain them. Provide 3 strings made of at least 5 letters each belonging to W and show the procedure used to obtain them.arrow_forwardIN PYTHON A tridiagonal matrix is one where the only nonzero elements are the ones on the main diagonal and the ones immediately above and below it.Write a function that solves a linear system whose coefficient matrix is tridiag- onal. In this case, Gauss elimination can be made much more efficient because most elements are already zero and don't need to be modified or added. As an example, consider a linear system Ax = b with 100,000 unknowns and the same number of equations. The coefficient matrix A is tridiagonal, with all elements on the main diagonal equal to 3 and all elements on the diagonals above and below it equal to 1. The vector of constant terms b contains all ones, except that the first and last elements are zero. You can use td to find that x1= −0.10557. The following code format should help: def td(l, m, u, b): '''Solve a linear system Ax = b where A is tridiagonal Inputs: l, lower diagonal of A, n-1 vector m, main diagonal of A, n vector u,…arrow_forwardneed help with R2arrow_forward
- This is a MATLAB Coding problem: Implement a recursive function, called count, that takes two inputs, an array of integers and target integer. count should search the array for the target integer and return the number of occurrences of the target integer in the array. For example: disp(count([1, 2, 4, 1, 2, 1], 1)) % Generates 3disp(count([1, 2, 4, 1, 2, 1], 2)) % Generates 2disp(count([1, 2, 4, 1, 2, 1], 4)) % Generates 1disp(count([1, 2, 4, 1, 2, 1], 9000)) % Generates 0arrow_forward= = 2×2 and 6 = (a) A composite number is a positive integer that has at least one divisor other than 1 and itself. For example, 2 1×2 is not a composite number but 4 2 × 3 are composite numbers. A logic circuit has four binary input variables, A, B, C and D. The output Z of the logic circuit is 1 if the unsigned integer represented by the binary number ABCD is a composite number. Using variables A and B for the select inputs S1 and S0 of a 4-to-1 multiplexer, implement the logic function Z(A, B, C, D) using this multiplexor and other logic gates.arrow_forwardI am working on this recursive function, and I am drawing a blank. Line 15 else if(s.charAt(0) != s.length () -1 && ............ )) Is there a String method that looks for intergers ? Suppose to look to see if it is the last value and if it is a Integer, if it is , add the vaules that intergers together for a total sum public class Finder { //Write two recursive functions, both of which will parse any length string that consists of digits and numbers. Both functions //should be in the same class and have the following signatures. //use the if/else statement , Find the base case and -1 till you get to base case //recursive function that adds up the digits in the String public static int sumIt(String s) { int sumOfNumbers =0; //if String length is less or equal to 1 retrun 1. for (int i = 0; i >= 0 ;i++) if (s.length()<= 1)//Base case = 1 return 1; //else if the CharAt(value in index at 0 = 1) is not equal to the last vaule in the string else if(s.charAt(0) != s.length ()…arrow_forward
- Alice, a friend of Mr. Bernard’s, wants to compose a song. She asks Mr. Bernard for help. Although Mr. Barnard knows nothing about music, he finds that the sequence of notes in a numbered musical notation can be expressed as an FSM with input the alphabet {1, 2, 3, 4, 5, 6, 7} (“do”, “re”, “mi”, “fa”, “so”, “la”, “ti”). Alice wants to compose a song that contains the pattern “15” an even number of times. Please draw an FSM that only accepts a sequence of notes that satisfies the above pattern. Note that you should provide a detailed description of the FSMs in your design to show how it works. Specifically, you should describe the meaning of each state.arrow_forwardSuppose a recursive function f(n)=3f(n-1) + 2. If f(0)=1, what is f(2)? 53 17 13 O O O Oarrow_forwardCan you please help me solve problem 2?arrow_forward
- Write a recursive implementation of Euclid's Algorith for finding the greatest common divisor(GCD) of two intergers. Descriptions of this algorithm are available in algebra books and on theweb. (Note: A nonrecursive version of the GCD problem was given in the programming exercisesfor Chapter 7.) Write a test program that calls your GCD procedure five times, using thefollowing pairs of integers: (5,20),(24,18),(11,7),(432,226),(26,13). After each procedure call,display the GCD.arrow_forwardConsider a recursive function, called f, that computes powers of 3 using only the + operator. Assume n > = 0. int f(int n) { if (n == 0) return 1; return f(n-1) + f(n-1) + f(n-1); } Give an optimized version of f, called g, where we save the result of the recursive call to a temporary variable t, then return t+t+t. i got int g(int n) { if (n == 0) return 1; int t = g(n - 1); return t+t+t; } so now Write a recurrence relation for T(n), the number addition operations performed by g(n) in terms of n.arrow_forwardGive a recursive definition for the set of all strings of a’s and b’s that begins with an a and ends in a b. Say, S = { ab, aab, abb, aaab, aabb, abbb, abab..} Let S be the set of all strings of a’s and b’s that begins with a and ends in a b. The recursive definition is as follows – Base:... Recursion: If u ∈ S, then... Restriction: There are no elements of S other than those obtained from the base and recursion of S.arrow_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