A particle moves with \(\vec{r}(t) = \langle t^2, t^3 \rangle\). What is its speed at \(t = 2\)?
Here, we are given the position function as \(\vec{r}(t)\). We need to find the derivative \(\vec{r}'(t)\) to get the velocity (speed) function.
# install.packages("Deriv")
library(Deriv)
r <- function(t) {
c(t^2,t^3)
}
r_prime <- Deriv(r)
answer <- r_prime(t = 2)
cat("The speed at t = 2 is:",answer,"\n")
## The speed at t = 2 is: 4 12
Two spinners are in the shapes of a regular hexagon and a regular pentagon with labels of 1 to 6 and 1 to 5, respectively. What is the probability of spinning two even numbers at the same time?
spinner1 <- 1:5
spinner2 <- 1:6
counter <- 0
N <- 1e5
for (i in 1:N) {
spin1 <- sample(x = spinner1,size = 1,replace = T)
spin2 <- sample(x = spinner2,size = 1,replace = T)
if (spin1 %% 2 == 0 & spin2 %% 2 == 0) {
counter <- counter + 1
}
}
probability <- counter / N
cat("The probability both numbers are even is:",probability,"\n")
## The probability both numbers are even is: 0.20232