Question 1

A ball is thrown from the top of a 96-foot building with an initial velocity of 80 feet per second. The height \(h\) (in feet) is given by \(h(t) = -16t^2 + 80t + 96\). How long does it take for the ball to reach its maximum height, and when does it hit the ground?

  1. Construct the graph of \(h(t) = -16t^2 + 80t + 96\).
# install.packages(c("tidyverse","rootSolve"))
library(tidyverse)
## Warning: package 'lubridate' was built under R version 4.5.2
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.1     ✔ stringr   1.5.2
## ✔ ggplot2   4.0.0     ✔ tibble    3.3.0
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.1
## ✔ purrr     1.1.0     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(rootSolve)
h <- function(t) {
  -16 * t^2 + 80 * t + 96
}
roots <- uniroot.all(h,c(-10,10))
for (x in seq_along(roots)) {
  cat("Root",x,":",roots[x],"\n")
}
## Root 1 : -1 
## Root 2 : 6
x_values <- seq(-2,7,length.out = 500)
y_values <- h(x_values)
q1_data <- data.frame(x = x_values,y = y_values)
ggplot(q1_data,aes(x = x,y = y)) +
  geom_line(col = "black",lwd = 1.25) +
  geom_hline(aes(yintercept = 0),col = "red",linetype = "dashed",lwd = 1) +
  annotate("point",x = roots[1],y = h(roots[1]),col = "blue",size = 5) +
  annotate("point",x = roots[2],y = h(roots[2]),col = "blue",size = 5) +
  labs(title = "Graph of h(t) = -16t^2 + 80t + 96",
       caption = paste("Roots:",roots[1],"and",roots[2]),
       x = "t",
       y = "h(t)") +
  theme_gray(base_size = 14)

  1. How long does it for the ball to reach its maximum point?
max_point <- optimize(f = h,interval = c(-10,10),maximum = T) # maximum = T searches for the maximum point
cat("It takes the ball",max_point$maximum,"seconds to reach its maximum point.","\n")
## It takes the ball 2.5 seconds to reach its maximum point.
  1. When does the ball hit the ground?
cat("The ball hits the ground at t =",roots[2],"seconds.\n")
## The ball hits the ground at t = 6 seconds.

Question 2

Let \(\vec{u},\vec{v},\vec{w}\) be three vectors in \(\mathbb{R}^3\) that form a left-handed system. Let \(A\) be the matrix with these vectors as columns, \(A = \begin{pmatrix} \vec{u} \space \vec{v} \space \vec{w} \end{pmatrix}\). Which statement is true about the determinant of the matrix \(B = \begin{pmatrix} \vec{w} \space \vec{u} \space \vec{v} \end{pmatrix}\)?

Note: A left-handed system is one where the determinant is negative. We will use the following vectors below as they are an example of a left-handed system.

Choices:

  1. \(|B| > 0\)

  2. \(|B| < 0\)

\[\vec{u} = \lbrace 1,0,0 \rbrace \\ \vec{v} = \lbrace 0,1,0 \rbrace \\ \vec{w} = \lbrace 0,0,-1 \rbrace\]

  1. Matrix A.
u <- c(1,0,0)
v <- c(0,1,0)
w <- c(0,0,-1)
A <- cbind(u,v,w)
print(A)
##      u v  w
## [1,] 1 0  0
## [2,] 0 1  0
## [3,] 0 0 -1
cat("det(A) =",det(A),"\n")
## det(A) = -1
  1. Matrix B.
u <- c(1,0,0)
v <- c(0,1,0)
w <- c(0,0,-1)
B <- cbind(w,u,v)
print(B)
##       w u v
## [1,]  0 1 0
## [2,]  0 0 1
## [3,] -1 0 0
cat("det(B) =",det(B),"\n")
## det(B) = -1

We find that the determinants of each matrix are the same and both negative. Thus, answer choice B is the correct answer.

Question 3

Beatrice has the following tops and skirts in her closet. She is going to a party and can choose any one of the tops and any one of the skirts, but she does not want to choose exactly the same color for both. How many favorable outcomes are there?

shirts <- c("Black","Red","Yellow","Blue","Purple","Orange","Gray","Green","Light Blue")
skirts <- c("Black","Purple","Brown","Green","Orange","Red")
pairs <- expand.grid(Shirt = shirts,Skirt = skirts,stringsAsFactors = F)
favorable <- subset(pairs,Shirt != Skirt)
cat("There are",nrow(favorable),"favorable outcomes.","\n")
## There are 49 favorable outcomes.

Question 4

What is the area between the curve \(f(x) = \ln(x)\) and the \(x\)-axis from \(x = 1.5\) to \(x = 3.5\)? Give your answer correct to 2 decimal places.

# install.packages("tidyverse")
library(tidyverse)
f <- function(x) {
  log(x)
}
area <- integrate(f = f,lower = 1.5,upper = 3.5)$value
x_vals <- seq(1.45,3.55,length.out = 500)
y_vals <- f(x_vals)
q4_data <- data.frame(x = x_vals,y = y_vals)
ggplot(q4_data,aes(x = x,y = y)) +
  geom_line(col = "black",lwd = 1.25) +
  geom_ribbon(data = subset(q4_data,x >= 1.5 & x <= 3.5),
              aes(ymin = 0,ymax = y),
              fill = "purple") +
  labs(title = "Graph of f(x) = ln(x)",
       caption = paste("Area:",round(area,2)),
       x = "x",
       y = "y") +
  theme_gray(base_size = 14)