Answered step by step
Verified Expert Solution
Question
1 Approved Answer
These question need to be coded in python please! Answer the following questions to the best of your ability. Solutions should be typed. Any plots
These question need to be coded in python please!
Answer the following questions to the best of your ability. Solutions should be typed. Any plots or graphs should be included with the question (please include the questions in your solutions) 1. Assume that you are solving the quadratic equation ax2 + br + c = 0, with ael.22, b=3.34, and c-228, using a normalized floating-point systern with base -10 , p 3 (the mantissa has only three digits). That is all numbers in the system are of the form: where d 0 (a) What is the computed value of the discriminant b 4ac? (Round to Nearest is used for decimal truncation). (b) What is the exact value of the discriminant in real (exact) arithmetic? (c) What is the relative error in the computed value of the discriminant? 2. The harmonic series 2 3 4 is known to diverge to oo. The nth partial sum approaches oo at the same rate as In(n). Euler's constant is defined to be 07 If you computer ran a program for a week based on the psudo code: x1.O s1.0 repeat 38.27) x+1.0; end repeat what is the largest value of s it would obtain? Wr loop every 100th step in a chart. Make a plot of the values of at least 5000 steps to estimate Euler's constant. Print intermedi ite and test a program that uses a er's consta 3. Show that Eul ler's constant can also be represented by by writing a code and testing it w convergence compa your answer using a plot and brief discussion of what is 11 m 1,2, 3, , 5000, How does the re with that seen in the previous problem. You should back up obser Answer the following questions to the best of your ability. Solutions should be typed. Any plots or graphs should be included with the question (please include the questions in your solutions) 1. Assume that you are solving the quadratic equation ax2 + br + c = 0, with ael.22, b=3.34, and c-228, using a normalized floating-point systern with base -10 , p 3 (the mantissa has only three digits). That is all numbers in the system are of the form: where d 0 (a) What is the computed value of the discriminant b 4ac? (Round to Nearest is used for decimal truncation). (b) What is the exact value of the discriminant in real (exact) arithmetic? (c) What is the relative error in the computed value of the discriminant? 2. The harmonic series 2 3 4 is known to diverge to oo. The nth partial sum approaches oo at the same rate as In(n). Euler's constant is defined to be 07 If you computer ran a program for a week based on the psudo code: x1.O s1.0 repeat 38.27) x+1.0; end repeat what is the largest value of s it would obtain? Wr loop every 100th step in a chart. Make a plot of the values of at least 5000 steps to estimate Euler's constant. Print intermedi ite and test a program that uses a er's consta 3. Show that Eul ler's constant can also be represented by by writing a code and testing it w convergence compa your answer using a plot and brief discussion of what is 11 m 1,2, 3, , 5000, How does the re with that seen in the previous problem. You should back up obser
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started