In a lab, \(C(t) = \frac{t^2 + 3t}{t - 2}\). What is \(C'(t)\)?
# install.packages("Deriv")
library(Deriv)
C <- function(t) {
(t^2 + 3 * t) / (t - 2)
}
C_prime <- Deriv(C)
C_prime
## function (t)
## {
## .e1 <- t - 2
## (3 + t * (2 - (3 + t)/.e1))/.e1
## }
Lyn picked a natural number and multiplied by 7. Which number CANNOT be the result of this multiplication?
A. 728
B. 623
C. 583
D. 567
# install.packages("tidyverse")
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
q2_data <- data.frame(Choice = c("A","B","C","D"),
Number = c(728,623,583,567))
answer <- q2_data %>%
filter(Number %% 7 != 0) %>% # which number does not divide by 7
pull(Choice)
cat("The number that CANNOT be the result of this multiplication is answer choice",answer,". \n")
## The number that CANNOT be the result of this multiplication is answer choice C .
A spinner is spun 1 million times. When the arrow stops and points to a number, determine which event is least likely to occur.
\[\text{Spinner} = [1,5,3,5,2,1,1,5,3]\]
A. Arrow points to 1
B. Arrow points to 2
C. Arrow points to 3
D. Arrow points to 4
set.seed(123) # for reproducibility
spinner <- c(1,5,3,5,2,1,1,5,3)
N <- 1e6 # 1 million trials
simulation <- sample(x = spinner,size = N,replace = T)
probabilities <- prop.table(table(simulation))
probabilities
## simulation
## 1 2 3 5
## 0.333465 0.111175 0.222192 0.333168
We find that answer choice B (arrow points to 2) is the least likely event to occur with a probability of 0.111175.
A ball is thrown in the air. Its height \(h\) in meters, at time \(t\) seconds is given by \(h(t) = 5t(4 - t)\). What is the maximum height reached by the ball?
h <- function(t) {
5 * t * (4 - t)
}
result <- optimize(f = h,interval = c(-10,10),maximum = T) # maximum = T means maximum point
result
## $maximum
## [1] 2
##
## $objective
## [1] 20
cat("The maximum height reached by the ball is:",result$objective,"\n") # result$maximum: maximum x-value, result$objective: maximum y-value at maximum x-value
## The maximum height reached by the ball is: 20
We can verify this through graphing.
# install.packages("tidyverse")
library(tidyverse)
h <- function(t) {
5 * t * (4 - t)
}
t_values <- seq(0,4,length.out = 500)
h_values <- h(t_values)
q4_data <- data.frame(t = t_values,h = h_values)
ggplot(q4_data,aes(x = t,y = h)) +
geom_line(col = "black",lwd = 1.25) +
geom_vline(aes(xintercept = 0),col = "red",linetype = "dashed") + # plotting x = 0 for reference
geom_hline(aes(yintercept = 0),col = "red",linetype = "dashed") + # plotting y = 0 for reference
annotate("point",x = 2,y = 20,col = "blue",size = 5) + # annotating the maximum point
labs(title = "Graph of h(t) = 5t(4 - t)",
x = "t",
y = "h(t)") +
theme_gray(base_size = 14)
We can see that the graph verifies the maximum point with \(x = 2\) and \(y = 20\).