Chap 6 Exercises

\[ \newcommand{\dnorm}{\text{dnorm}} \newcommand{\pnorm}{\text{pnorm}} \newcommand{\recip}{\text{recip}} \]

Exercise 1 Answer these questions. You can use Active R chunk 1 to plot out each function with domain from -5 to 5. Or you can refer to the graphs in Chapter 5 of the textbook.

Active R chunk 1

Choose from among these possibilities:

  • Flat: not-concave
  • Down: concave down on the whole domain
  • Up: concave up on the whole domain
  • DU: concave down on the left and up on the right
  • UD: concave up on the left and down on the right
  • UDU: concave down in the center and concave up on both flanks
  • …UDUDU…: alternating between concave up and concave down
  1. Which of these best describes the concavity of the gaussian function? (Hint: In R, the gaussian function is named pnorm().)
Flat       Down       Up       UDU       DU       UD      

question id: pattern-book-concavity-1

  1. Which of these best describes the concavity of the sinusoid function? (R name: sin())
Flat       Down       Up       UDU       DU       …UDUDU…      

question id: pattern-book-concavity-2

  1. Which of these best describes the concavity of the second-order monomial \(m_2(x) \equiv x^2\)?
Flat       Down       Up       UDU       DU       UD      

question id: pattern-book-concavity-3

Exercise 2 All but two of the pattern-book functions have a domain that runs over the whole number line: \(-\infty < x < \infty\).

  1. Which pattern-book function has a domain that excludes zero and negative numbers as inputs?
sinusoid       exponential       sigmoid       logarithm       square       reciprocal       identity      

question id: pattern-book-domain-a

  1. Which pattern-book function has just a single value missing from its domain?
sinusoid       exponential       sigmoid       logarithm       square       reciprocal       identity      

question id: pattern-book-domain-b

Exercise 3 A function’s domain is the set of possible inputs to the function. A function’s range is the set of possible outputs.

In each of the following questions, choose the correct answer from these possibilities:

  • All: The entire number line.
  • Pos: The positive numbers (excluding zero)
  • Neg: The negative numbers (excluding zero)
  • NonNeg: The non-negative numbers, that is, the positive numbers (including zero).
  • Closed: Closed, that is, a restricted finite interval of the number line.
  1. What is the range of the pattern-book exponential function?
Pos       NonNeg       Neg       All       Closed      

question id: pattern-book-range-1

  1. What is the range of the pattern-book sine function?
Pos       Neg       All       Closed      

question id: pattern-book-range-2

  1. What is the range of the pattern-book logarithm function?
Pos       NonNeg       Neg       All       Closed      

question id: pattern-book-range-3

  1. What is the range of the pattern-book square function?
Pos       NonNeg       Neg       All       Closed      

question id: pattern-book-range-4

  1. What is the range of the pattern-book proportional function?
Pos       Neg       All       Closed      

question id: pattern-book-range-5

  1. What is the range of the pattern-book sigmoid function?
Pos       NonNeg       Neg       All       Closed      

question id: pattern-book-range-6

Exercise 4  

Active R chunk 2
  1. Explain why the function graph made by Active R chunk 3 doesn’t cover the whole of the graphics domain indicated in the command.

question id: shark-rise-kitchen-1

  1. Calculate log(-5). What is the result?
-5       -1.609       NaN       1.609       5      

question id: shark-rise-kitchen-2

The answer to (2) demonstrates an important feature of modern computer numerics. When an input is outside of the domain of the function, the function value is undefined. This “undefined” value is represented by a special “number,” which has no value. The special “number” is written NaN standing for “not a number.”

Active R chunk 3
  1. Using Active R chunk 3, do some experimental arithmetic with NaN, for instance, adding 5 or multiplying by 3, and so on. Construct a simple but general rule that accounts for the results in your experiments.

question id: shark-rise-kitchen-3

Exercise 5 Suppose \(t\) is your age and the functions \(w(t)\) and \(h(t)\) are your weight and height as you age. The domain of both functions encompasses your whole life span. It’s reasonable to consider each of these functions to be continuous. So the function \(h(t) - w(t)\) is continuous.

Is the following statement true? At some time since you were born your weight in pounds equaled your height in inches.

True       False      

question id: elephant-wake-dress-1

In-class activity

Exercise 6 We’re going to look at the pattern-book functions in terms of three properties

  1. Slope: whether the graph has a slope that is consistently positive, negative, both, or neither, and
  2. Concavity: whether the function being graphed is concave up, concave down, neither, or both (i.e., concave up in some regions of the domain and down for others).
  3. Horizontal asymptote: whether the function becomes approximately constant as the input goes to either plus or negative infinity.

As a reminder, Active R chunk 4 gives a command to plot a function over the graphics domain \(-3 \leq x \leq 3\):

Active R chunk 4

Fill in the following table based on the graphs you make with Active R chunk 4 of the pattern-book functions. We have already shown answers for the exponential and sinusoid

function name R formula slope concavity horiz. asymptote
exponential exp(x) positive concave up \(x \rightarrow -\infty\)
logarithm
sinusoid sin(x) both both neither
square
identity
constant
reciprocal
gaussian
sigmoid

Exercise 7 The example in #lst-pattern-book-zeros can be modified to graph any of the pattern-book functions on the domain \(-3 \leq x \leq 3\). For convenience, it also draws a horizontal line corresponding to zero on the vertical axis. (You don’t need to learn functions like gf_hline().)

Active R chunk 5

In this exercise, you will be modifying the sandbox code to draw different functions, so you can examine their shapes.

Your task is to read and interpret the graphs of the basic modeling functions. Here, you will be looking for zero-crossings: the neighborhood of a point in the function’s domain where the output of the function is negative for inputs on one side and positive for inputs on the other side. If zero is touched but not crossed, we will call that “touched zero.”

The table below lists the pattern-book functions. For each function in the list, fill in the table. That is, say whether the function crosses zero, touches zero but does not cross, or does not touch at all in the part of the domain shown in the graphic: \(-3 \leq x \leq 3\). Also note if the value of the function appears to be reaching a horizontal asymptote at zero for very negative \(x\), for very positive \(x\), for both, or neither.

function name R formula zero in domain shown in graph asymptotic zero
exponential exp(x) no zeros for very negative \(x\)
logarithm
sinusoid
square
proportional
constant
reciprocal
gaussian
sigmoid
No answers yet collected