Consider the quantitya^{2} - b^{2} where a and b are real numbers. (a) Under what conditions should one expect an unusually large relative error in the computed value of a^{2} - b^{2} when this expression is evaluated in finite precision arithmetic? (b)cWs 4-digit (decimal) rounding arithmetic to evaluate both a^{2} - b^{2} and (a + b)(a - b) with a = 995.1 and b = 995.0. Calculate th relative error in each result. (c) The expression (a + b)(a - b) is algebraically equivalent to a^{2} - b^{2}, but it is a more accurate way to calculate this quantity if both a and b have exact floating point representations. Why?

Consider the quantitya^{2} - b^{2} where a and b are real numbers. (a) Under what conditions should one expect an unusually large relative error in the computed value of a^{2} - b^{2} when this expression is evaluated in finite precision arithmetic? (b)cWs 4-digit (decimal) rounding arithmetic to evaluate both a^{2} - b^{2} and (a + b)(a - b) with a = 995.1 and b = 995.0. Calculate th relative error in each result. (c) The expression (a + b)(a - b) is algebraically equivalent to a^{2} - b^{2}, but it is a more accurate way to calculate this quantity if both a and b have exact floating point representations. Why?

Question
Decimals
asked 2020-10-20
Consider the quantity\(a^{2}\ -\ b^{2}\) where a and b are real numbers.
(a) Under what conditions should one expect an unusually large relative error in the computed value of \(a^{2}\ -\ b^{2}\) when this expression is evaluated in finite precision arithmetic?
(b)cWs 4-digit (decimal) rounding arithmetic to evaluate both \(a^{2}\ -\ b^{2}\ and\ (a\ +\ b)(a\ -\ b)\ with\ a\ = 995.1\ and\ b = 995.0.\) Calculate th relative error in each result.
(c) The expression \((a\ +\ b)(a\ -\ b)\ is\ algebraically\ equivalent\ to\ a^{2}\ -\ b^{2},\) but it is a more accurate way to calculate this quantity if both a and b have exact floating point representations. Why?

Answers (1)

2020-10-21
Solution:
a.The condition is that the computed value is rounded off when this expression is evaluated in finite precision arithmetic.
b.Given: \(a = 995.1\ and\ b = 995.0\)
\(a^{2}\ -\ b^{2} = (995.1)^{2}\ -\ (995.0)^{2}\)
\(= 990224.01\ -\ 990025\)
\(= 199.01\)
4 digit rounding arithmetic we have \(a^{2}\ -\ b^{2} = 199.0.\)
The relative error becomes \(\frac{|199.01\ -\ 199.0|}{199.01}=\frac{0.01}{199.01}\approx0.525\ \times\ 10^{-4}\)
Conclusion:
Given: \(a = 995.1\ and\ b = 995.0\)
\((a\ +\ b)(a\ -\ b) = (995.1\ +\ 995.0)(995.1\ -\ 995.0)\)
\(= (199.01)(0.1)\)
4 digit rounding arithmetic we have \((a\ +\ b)(a\ -\ b) = 199.0.\)
The relative error becomes \(\frac{|199.01\ -\ 199.0|}{199.01}=\frac{0.01}{199.01}\approx0.525\ \times\ 10^{-4}\)
c.The expression \((a\ +\ b)(a\ -\ b)\ is\ more\ accurate\ than\ a^{2}\ -\ b^{2}\) when a and b have exact floating point representations because the expression
\((a\ +\ b)(a\ -\ b)\) involves simple addition and subtraction of decimals, then easy multiplication takes place,
however the expression \(a^{2}\ -\ b^{2}\) involves squaring of decimals resulting in more decimals , then subtraction takes place. The latter may involves round off whereas the former may not.
0

Relevant Questions

asked 2021-02-25
We will now add support for register-memory ALU operations to the classic five-stage RISC pipeline. To offset this increase in complexity, all memory addressing will be restricted to register indirect (i.e., all addresses are simply a value held in a register; no offset or displacement may be added to the register value). For example, the register-memory instruction add x4, x5, (x1) means add the contents of register x5 to the contents of the memory location with address equal to the value in register x1 and put the sum in register x4. Register-register ALU operations are unchanged. The following items apply to the integer RISC pipeline:
a. List a rearranged order of the five traditional stages of the RISC pipeline that will support register-memory operations implemented exclusively by register indirect addressing.
b. Describe what new forwarding paths are needed for the rearranged pipeline by stating the source, destination, and information transferred on each needed new path.
c. For the reordered stages of the RISC pipeline, what new data hazards are created by this addressing mode? Give an instruction sequence illustrating each new hazard.
d. List all of the ways that the RISC pipeline with register-memory ALU operations can have a different instruction count for a given program than the original RISC pipeline. Give a pair of specific instruction sequences, one for the original pipeline and one for the rearranged pipeline, to illustrate each way.
Hint for (d): Give a pair of instruction sequences where the RISC pipeline has “more” instructions than the reg-mem architecture. Also give a pair of instruction sequences where the RISC pipeline has “fewer” instructions than the reg-mem architecture.
asked 2021-04-25
The unstable nucleus uranium-236 can be regarded as auniformly charged sphere of charge Q=+92e and radius \(\displaystyle{R}={7.4}\times{10}^{{-{15}}}\) m. In nuclear fission, this can divide into twosmaller nuclei, each of 1/2 the charge and 1/2 the voume of theoriginal uranium-236 nucleus. This is one of the reactionsthat occurred n the nuclear weapon that exploded over Hiroshima, Japan in August 1945.
A. Find the radii of the two "daughter" nuclei of charge+46e.
B. In a simple model for the fission process, immediatelyafter the uranium-236 nucleus has undergone fission the "daughter"nuclei are at rest and just touching. Calculate the kineticenergy that each of the "daughter" nuclei will have when they arevery far apart.
C. In this model the sum of the kinetic energies of the two"daughter" nuclei is the energy released by the fission of oneuranium-236 nucleus. Calculate the energy released by thefission of 10.0 kg of uranium-236. The atomic mass ofuranium-236 is 236 u, where 1 u = 1 atomic mass unit \(\displaystyle={1.66}\times{10}^{{-{27}}}\) kg. Express your answer both in joules and in kilotonsof TNT (1 kiloton of TNT releases 4.18 x 10^12 J when itexplodes).
asked 2021-03-22
A box is sliding with a speed of 4.50 m/s on a horizontal surface when, at point P, it encounters a rough section. On the rough section, the coefficient of friction is not constant but starts at .100 at P and increases linerly with distance past P, reaching a value of .600 at 12.5 m past point P. (a) Use the work energy theorem to find how far this box slides before stopping. (b) What is the coefficient of friction at the stopping point? (c) How far would the box have slid iff the friciton coefficient didn't increase, but instead had the constant value of .1?
asked 2020-10-23
The table below shows the number of people for three different race groups who were shot by police that were either armed or unarmed. These values are very close to the exact numbers. They have been changed slightly for each student to get a unique problem.
Suspect was Armed:
Black - 543
White - 1176
Hispanic - 378
Total - 2097
Suspect was unarmed:
Black - 60
White - 67
Hispanic - 38
Total - 165
Total:
Black - 603
White - 1243
Hispanic - 416
Total - 2262
Give your answer as a decimal to at least three decimal places.
a) What percent are Black?
b) What percent are Unarmed?
c) In order for two variables to be Independent of each other, the P \((A and B) = P(A) \cdot P(B) P(A and B) = P(A) \cdot P(B).\)
This just means that the percentage of times that both things happen equals the individual percentages multiplied together (Only if they are Independent of each other).
Therefore, if a person's race is independent of whether they were killed being unarmed then the percentage of black people that are killed while being unarmed should equal the percentage of blacks times the percentage of Unarmed. Let's check this. Multiply your answer to part a (percentage of blacks) by your answer to part b (percentage of unarmed).
Remember, the previous answer is only correct if the variables are Independent.
d) Now let's get the real percent that are Black and Unarmed by using the table?
If answer c is "significantly different" than answer d, then that means that there could be a different percentage of unarmed people being shot based on race. We will check this out later in the course.
Let's compare the percentage of unarmed shot for each race.
e) What percent are White and Unarmed?
f) What percent are Hispanic and Unarmed?
If you compare answers d, e and f it shows the highest percentage of unarmed people being shot is most likely white.
Why is that?
This is because there are more white people in the United States than any other race and therefore there are likely to be more white people in the table. Since there are more white people in the table, there most likely would be more white and unarmed people shot by police than any other race. This pulls the percentage of white and unarmed up. In addition, there most likely would be more white and armed shot by police. All the percentages for white people would be higher, because there are more white people. For example, the table contains very few Hispanic people, and the percentage of people in the table that were Hispanic and unarmed is the lowest percentage.
Think of it this way. If you went to a college that was 90% female and 10% male, then females would most likely have the highest percentage of A grades. They would also most likely have the highest percentage of B, C, D and F grades
The correct way to compare is "conditional probability". Conditional probability is getting the probability of something happening, given we are dealing with just the people in a particular group.
g) What percent of blacks shot and killed by police were unarmed?
h) What percent of whites shot and killed by police were unarmed?
i) What percent of Hispanics shot and killed by police were unarmed?
You can see by the answers to part g and h, that the percentage of blacks that were unarmed and killed by police is approximately twice that of whites that were unarmed and killed by police.
j) Why do you believe this is happening?
Do a search on the internet for reasons why blacks are more likely to be killed by police. Read a few articles on the topic. Write your response using the articles as references. Give the websites used in your response. Your answer should be several sentences long with at least one website listed. This part of this problem will be graded after the due date.
asked 2021-05-05

A random sample of \( n_1 = 14 \) winter days in Denver gave a sample mean pollution index \( x_1 = 43 \).
Previous studies show that \( \sigma_1 = 19 \).
For Englewood (a suburb of Denver), a random sample of \( n_2 = 12 \) winter days gave a sample mean pollution index of \( x_2 = 37 \).
Previous studies show that \( \sigma_2 = 13 \).
Assume the pollution index is normally distributed in both Englewood and Denver.
(a) State the null and alternate hypotheses.
\( H_0:\mu_1=\mu_2.\mu_1>\mu_2 \)
\( H_0:\mu_1<\mu_2.\mu_1=\mu_2 \)
\( H_0:\mu_1=\mu_2.\mu_1<\mu_2 \)
\( H_0:\mu_1=\mu_2.\mu_1\neq\mu_2 \)
(b) What sampling distribution will you use? What assumptions are you making? NKS The Student's t. We assume that both population distributions are approximately normal with known standard deviations.
The standard normal. We assume that both population distributions are approximately normal with unknown standard deviations.
The standard normal. We assume that both population distributions are approximately normal with known standard deviations.
The Student's t. We assume that both population distributions are approximately normal with unknown standard deviations.
(c) What is the value of the sample test statistic? Compute the corresponding z or t value as appropriate.
(Test the difference \( \mu_1 - \mu_2 \). Round your answer to two decimal places.) NKS (d) Find (or estimate) the P-value. (Round your answer to four decimal places.)
(e) Based on your answers in parts (i)−(iii), will you reject or fail to reject the null hypothesis? Are the data statistically significant at level \alpha?
At the \( \alpha = 0.01 \) level, we fail to reject the null hypothesis and conclude the data are not statistically significant.
At the \( \alpha = 0.01 \) level, we reject the null hypothesis and conclude the data are statistically significant.
At the \( \alpha = 0.01 \) level, we fail to reject the null hypothesis and conclude the data are statistically significant.
At the \( \alpha = 0.01 \) level, we reject the null hypothesis and conclude the data are not statistically significant.
(f) Interpret your conclusion in the context of the application.
Reject the null hypothesis, there is insufficient evidence that there is a difference in mean pollution index for Englewood and Denver.
Reject the null hypothesis, there is sufficient evidence that there is a difference in mean pollution index for Englewood and Denver.
Fail to reject the null hypothesis, there is insufficient evidence that there is a difference in mean pollution index for Englewood and Denver.
Fail to reject the null hypothesis, there is sufficient evidence that there is a difference in mean pollution index for Englewood and Denver. (g) Find a 99% confidence interval for
\( \mu_1 - \mu_2 \).
(Round your answers to two decimal places.)
lower limit
upper limit
(h) Explain the meaning of the confidence interval in the context of the problem.
Because the interval contains only positive numbers, this indicates that at the 99% confidence level, the mean population pollution index for Englewood is greater than that of Denver.
Because the interval contains both positive and negative numbers, this indicates that at the 99% confidence level, we can not say that the mean population pollution index for Englewood is different than that of Denver.
Because the interval contains both positive and negative numbers, this indicates that at the 99% confidence level, the mean population pollution index for Englewood is greater than that of Denver.
Because the interval contains only negative numbers, this indicates that at the 99% confidence level, the mean population pollution index for Englewood is less than that of Denver.
asked 2021-05-12
4.7 A multiprocessor with eight processors has 20attached tape drives. There is a large number of jobs submitted tothe system that each require a maximum of four tape drives tocomplete execution. Assume that each job starts running with onlythree tape drives for a long period before requiring the fourthtape drive for a short period toward the end of its operation. Alsoassume an endless supply of such jobs.
a) Assume the scheduler in the OS will not start a job unlessthere are four tape drives available. When a job is started, fourdrives are assigned immediately and are not released until the jobfinishes. What is the maximum number of jobs that can be inprogress at once? What is the maximum and minimum number of tapedrives that may be left idle as a result of this policy?
b) Suggest an alternative policy to improve tape driveutilization and at the same time avoid system deadlock. What is themaximum number of jobs that can be in progress at once? What arethe bounds on the number of idling tape drives?
asked 2021-05-19
For digits before decimals point, multiply each digit with the positive powers of ten where power is equal to the position of digit counted from left to right starting from 0.
For digits after decimals point, multiply each digit with the negative powers of ten where power is equal to the position of digit counted from right to left starting from 1.
1) \(10^{0}=1\)
2) \(10^{1}=10\)
3) \(10^{2}=100\)
4) \(10^{3}=1000\)
5) \(10^{4}=10000\)
And so on...
6) \(10^{-1}=0.1\)
7) \(10^{-2}=0.01\)
8) \(10^{-3}=0.001\)
9) \(10^{-4}=0.0001\)
asked 2021-05-16
Consider the curves in the first quadrant that have equationsy=Aexp(7x), where A is a positive constant. Different valuesof A give different curves. The curves form a family,F. Let P=(6,6). Let C be the number of the family Fthat goes through P.
A. Let y=f(x) be the equation of C. Find f(x).
B. Find the slope at P of the tangent to C.
C. A curve D is a perpendicular to C at P. What is the slope of thetangent to D at the point P?
D. Give a formula g(y) for the slope at (x,y) of the member of Fthat goes through (x,y). The formula should not involve A orx.
E. A curve which at each of its points is perpendicular to themember of the family F that goes through that point is called anorthogonal trajectory of F. Each orthogonal trajectory to Fsatisfies the differential equation dy/dx = -1/g(y), where g(y) isthe answer to part D.
Find a function of h(y) such that x=h(y) is the equation of theorthogonal trajectory to F that passes through the point P.
asked 2021-04-25
A wagon with two boxes of Gold, having total mass 300 kg, is cutloose from the hoses by an outlaw when the wagon is at rest 50m upa 6.0 degree slope. The outlaw plans to have the wagon roll downthe slope and across the level ground, and then fall into thecanyon where his confederates wait. But in a tree 40m from thecanyon edge wait the Lone Ranger (mass 75.0kg) and Tonto (mass60.0kg). They drop vertically into the wagon as it passes beneaththem. a) if they require 5.0 s to grab the gold and jump out, willthey make it before the wagon goes over the edge? b) When the twoheroes drop into the wagon, is the kinetic energy of the system ofthe heroes plus the wagon conserved? If not, does it increase ordecrease and by how much?
asked 2021-03-02

Let \(x_1 = 94,210, x_2 = 8631, x_3 = 1440, x_4 = 133,\) and \(x5 = 34.\) Calculate each of the following, using four-digit decimal floating-point arithmetic: \(x1 + ((x2 + x3) + (x4 + x5))\)

...