Probability and Statistics: Exercises


8. Validating Total Area under a Probability Density Function. Another property of a probability density function (pdf) is that its total area (or integral) over its entire support must be equal to 1. In this exercise, we will validate this property for the function \( f = \frac{x}{60} \) over its support [0, 10].

To approximate the integral of the function over its support in R, you can use the integrate() function. Specifically, you can use integrate(f, lower, upper) where f is the function to be integrated, and lower and upper specify the interval of integration.


# Define the function. f <- function(x) { return(x/___) } # Compute the integral of the function over [0, 10]. result <- integrate(___ , 0, ___)$value # Print the result. result # Define the function. f <- function(x) { return(x/60) } # Compute the integral of the function over [0, 10]. result <- integrate(f , 0, 10)$value # Print the result. result test_error() test_object("result", incorrect_msg="Make sure to integrate the function over the correct interval and extract the value.") success_msg("Good job! Based on your findings, does the function satisfy the property of integrating to 1 over its support?")
Use the provided function `f` and the `integrate()` function over the interval [0, 10].

Previous Exercise Next Exercise