A skater moves with \(\vec{r}(t) = \langle 3t - 1, t^2 + 2 \rangle\). What is the speed at \(t = 0\)?
# install.packages("Deriv")
library(Deriv)
r <- function(t) {
c(3* t - 1,t^2 + 2)
}
v <- Deriv(r) # velocity/speed
answer <- v(t = 0)
cat("The speed at t = 0 is:",answer,"\n")
## The speed at t = 0 is: 3 0
There are 3 gray marbles, 2 red marbles, 2 yellow marbles, and 1 blue marble in a bag. You mix them up and choose one marble from the bag without looking. Which color marble are you least likely to choose?
bag <- c(rep("Gray",3),rep("Red",2),rep("Yellow",2),"Blue")
N <- 1e6 # 1 million trials
simulation <- sample(x = bag,size = N,replace = T)
probabilites <- prop.table(table(simulation))
probabilites
## simulation
## Blue Gray Red Yellow
## 0.125097 0.374821 0.249535 0.250547
Which of the following multiplication facts is odd?
A. \(3 \times 5 \times 7\) B. \(3 \times 5 \times 8\) C. \(3 \times 6 \times 8\) D. \(5 \times 6 \times 8\)
# 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
q3_data <- data.frame(Choice = LETTERS[1:4], # A to D inclusive
Number = c(3 * 5 * 7, 3 * 5 * 8,3 * 6 * 8,5 * 6 * 8))
result <- q3_data %>%
filter(Number %% 2 == 1) %>% # checking for odd number
pull(Choice) # getting the corresponding choice
cat("Answer choice",result,"is correct.","\n")
## Answer choice A is correct.
A company that packs and distributes tea claims that their packs of tea weigh 250 grams. Twenty packs of tea were randomly selected and weighed to the nearest gram. The weights were \([247,250,253,249,258,252,247,251,257,250,255,250,252,254,251,246,255,252,256,247]\). Assuming that the weights are a random sample from a Normal distribution with population mean \(\mu\), carry out a one-tailed test at the 5% level using the following null and alternative hypotheses: \(H_0: \mu = 250\), \(H_1: \mu \neq 250\).
tea_weights <- c(247,250,253,249,258,252,247,251,257,250,255,250,252,254,251,246,255,252,256,247)
t.test(tea_weights,mu = 250,alternative = "two.sided",conf.level = 0.95)
##
## One Sample t-test
##
## data: tea_weights
## t = 2.053, df = 19, p-value = 0.0541
## alternative hypothesis: true mean is not equal to 250
## 95 percent confidence interval:
## 249.9688 253.2312
## sample estimates:
## mean of x
## 251.6
What is \(\int 4x^3 + \cos(x) dx\)?
# install.packages(c("ggformula","mosaicCalc"))
library(ggformula)
## Warning: package 'ggformula' was built under R version 4.5.2
## Loading required package: scales
##
## Attaching package: 'scales'
## The following object is masked from 'package:purrr':
##
## discard
## The following object is masked from 'package:readr':
##
## col_factor
## Loading required package: ggiraph
## Warning: package 'ggiraph' was built under R version 4.5.2
## Loading required package: ggridges
## Warning: package 'ggridges' was built under R version 4.5.2
##
## New to ggformula? Try the tutorials:
## learnr::run_tutorial("introduction", package = "ggformula")
## learnr::run_tutorial("refining", package = "ggformula")
library(mosaicCalc)
## Warning: package 'mosaicCalc' was built under R version 4.5.2
## Registered S3 method overwritten by 'mosaic':
## method from
## fortify.SpatialPolygonsDataFrame ggplot2
##
## Attaching package: 'mosaicCalc'
## The following object is masked from 'package:stats':
##
## D
f <- makeFun(4 * x^3 + cos(x) ~ x)
anti_f <- antiD(f(x) ~ x)
anti_f
## function (x, C = 0)
## sin(x) + x^4 + C