7 Exercises: Uncertainty in quantities

The chapter discusses the distinction between an (absolute) probability and a relative probability.

Exercise 7. 1  

WarningNext status step: Refine the draft

… to make it ready for testing.

Assigned to DTK

{>>Should we change this to multiple-choice answers?<<}

In Section 7.1 we looked at the problem of calculating the number of Cals used on a walk, when the uncertainty in the walk length is [3 to 4] miles, and the uncertainty in Cals-per-mile is [60 to 100].

In the chunk that follows, a simulation has been constructed that generates normally distributed random numbers based on the intervals for walk length and Cals-per-mile.

Then, the simulation is run for 5000 iterations. There will be 5000 rows in the resulting data frame, one row for each iteration. There will be three variables, the randomly generated walk length and cals per mile as well as the total Calories calculated by multiplying the two random quantities. The 5000-row output from the simulation is then passed to a statistics function which calculates the lower and upper bounds of the 95% interval.

The intervals are given as [3 to 4] and [60 to 80], but the simulation is run using random number generators that take the mean and standard deviation as their parameter values.

  1. Explain how the parameters used in generating walk_length and cals_per_mile correspond to the two intervals.
  1. Modify the code to find the uncertainty distribution of the product [-3 to 5]\(\times\)[-10 to 2]. What is the resulting interval? Does it include zero?
  1. Modify the code once again to find the uncertainty distribution of the ratio [-1 to 1] divided by [-1 to 1]. What is the resulting interval and why is it so much bigger than [-1 to 1]? (Hint: If the interval you calculate is about [-1 to 1], you probably used multiplication rather than division in your calculations.)

File ID: sister-freeze-map


Exercise 7. 2 Let’s do a formal analysis of uncertainty about the number of calories you burned on this morning’s walk. You didn’t follow your regular route, and you stopped to watch some construction work along the way, but you think you walked about 3 to 4 miles. An AI search stated that the energy burned per mile is approximately 60 to 100 Cals/mile.

  1. Do AI searches with three queries: “how to multiply two ranges,” “how to multiply two intervals,” and “how to multiply two uncertain numbers.” Quickly summarize what you found out, indicating whether the answers were clear and the extent to which they fall under the description, “Not related to what I was looking for.”
  1. GENERATE A SIMULATION WITH distance and energy_rate, each modeled by a hill function with an appropriate [WHAT IS THE PARAMETER, standard deviation?], and setting Cals to be the product of the two. What’s the mean and standard deviation of Cals.

IT WORKS OUT TO 280 \(\pm\) 80 Cals

mean(rnorm(1000, 3.5, .25) * rnorm(1000, 80, 10))
[1] 278.9147

File ID: monkey-lose-knife


Exercise 7. 3 Setting the \(\lambda\) parameter in an exponential distribution.

Setting mean and sd in a normal distribution.

File ID: panda-type-closet


Exercise 7. 4 Example: Daily high, extreme heat, what happens when you move the mean a little bit to the chances of extreme heat.

File ID: doe-keep-glasses


Exercise 7. 5 [[There are occasions when not only is the mantissa of a number uncertain, but the magnitude as well. The log-normal distribution is provides insight into a range of phenomena such as the impact of disasters, the workings of financial markets, and income distributions. The power-law family of distributions provides ways to quantify a statement like, “I have no idea at all what the outcome will be.” One reason this is rarely used in modeling is that most of the time the modeler has some idea of the outcome, even if it is vague.]]

(a) Log x axis
(b) Linear x axis
Figure 1: A relative probability function for a healthy person’s medical expenses over the next year.

There are two subgraphs in Figure 1. (a) shows inputs on a magnitude scale, meaning that position measured with a ruler corresponds to the magnitude of the medical expenses. For this, we’re using the familiar hill() function, which is to say, “We know something about the likely magnitude.”

Subgraph (b) shows exactly the same function, but plotted on a linear scale for the x-axis, meaning that position refers to the actual dollar amount of expenses. It should be clear that the relative probability function is very different from flat(). If it had been flat(), then expenses of $10,000 would be just as likely as $1000 or even $100. That is far from the case, reflecting that we have something to say about the magnitude of the expenses.

File ID: fish-draw-bolt


Exercise 7. 6  

Here is a contour plot of a function \(f(x, y)\), annotated with several letters. At each of the letters, say what is the direction of the gradient vector. As names for directions, we will use the eight major compass points: N, NE, E, SE, S, SW, W, NW. Choose Zero if the gradient vector is so short that the direction is essentially meaningless.

  1. At point A: dbk-A-dkws

    N       NE       E       SE       S       SW       W       NW       Zero      

  2. At point B: dbk-B-dkws

    N       NE       E       SE       S       SW       W       NW       Zero      

  3. At point C: dbk-C-dkws

    N       NE       E       SE       S       SW       W       NW       Zero      

  4. At point D: dbk-D-dkws

    N       NE       E       SE       S       SW       W       NW       Zero      

  5. At point E: dbk-E-dkws

    N       NE       E       SE       S       SW       W       NW       Zero      

File ID: daisy-blow-kitchen


AI questions

Exercise 7. 7 AI generated question: When navigating a river, your speed is affected by the current, wind, and your own physical stamina. To model this, we can use a relative probability function to visualize the range of possible outcomes.

Scenario: You are planning a canoe trip 8 miles upstream to a campsite. Under perfect conditions, you paddle at a constant rate of 4 miles per hour (mph). However, the river has a variable current that flows against you.

Figure 2 shows your professor’s sense of the relative probability for your “Net Upstream Speed” (your paddling speed minus the river’s current).

Figure 2: Relative probability for net speed.

The function shows that your net speed is most likely to be 2 mph, but due to fluctuating currents, it could be as low as 1 mph or as high as 3 mph.

  1. What’s the longest possible duration for the 8-mile trip?
fhm-1-udw2
4 hours       5 hours       6.67 hours       8 hours      

  1. What’s the shortest possible duration for the 8-mile trip?
fhm-2-34df
2 hours       2.67 hours       3 hours       4 hours      

  1. What’s the most likely duration?
fhm-3-9t3
3 hours       4 hours       5 hours       6.67 hours      

(a)
(b)
(c)
Figure 3: Candidate relative probability functions for trip duration.

Figure 3 shows three different relative probability functions, each purporting to show the distribution of travel times. Only one is correct. Which one?

fhm-4-rdf
a       b       c      

7.1 Drafty

At any point, you can submit your answers by collecting them and uploading them to the class site.

No answers yet collected

Link to upload site

If requested by your instructor, please identify here the people from whom you received assistance on this assignment.

If the answers that have been loaded automatically are not yours, press this button before starting your work: