Evaluate the following limit.
\[\lim_{x \to \infty} \frac{2x^2 + 1}{x^3 - 8}\]
# install.packages("Ryacas")
library(Ryacas)
## Warning: package 'Ryacas' was built under R version 4.5.2
##
## Attaching package: 'Ryacas'
## The following object is masked from 'package:stats':
##
## integrate
## The following objects are masked from 'package:base':
##
## %*%, det, diag, diag<-, lower.tri, upper.tri
x <- ysym("x")
f <- (2 * x^2 + 1) / (x^3 - 8)
result <- lim(f,x,Inf)
result
## y: 0
If \(h(x,y) = e^{xy} \sin(x + y)\) and \(\frac{\partial{h}}{\partial{x}}(0,\pi) = a\), what is \(\frac{\partial{h}}{\partial{y}}(\pi,0)\)?
# install.packages("Deriv")
library(Deriv)
h <- function(x,y) {
exp(x * y) * sin(x + y)
}
h_y <- Deriv(h,"y") # partial derivative of h with respect to y
value <- h_y(x = pi,y = 0)
cat("The answer is:",value,"\n")
## The answer is: -1
There are 4 green, 3 blue, 3 orange, and 2 red marbles in a bag. Which color marble are you most likely to choose?
bag <- c(rep("Green",4),rep("Blue",3),rep("Orange",3),rep("Red",2))
N <- 1e6 # 1 million trials
simulation <- sample(x = bag,size = N,replace = T)
probabilities <- prop.table(table(simulation))
probabilities
## simulation
## Blue Green Orange Red
## 0.249150 0.334637 0.249966 0.166247
Which number is even?
A. \(31 \times 33 \times 35\)
B. \(32 \times 34 \times 35\)
C. \(33 \times 35 \times 37\)
D. \(33 \times 37 \times 39\)
# 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()
## ✖ purrr::simplify() masks Ryacas::simplify()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
q4_data <- data.frame(Choice = LETTERS[1:4],
Number = c(31*33*35,32*34*35,33*35*37,33*37*39))
correct_answer <- q4_data %>%
mutate(Even = Number %% 2 == 0) %>%
filter(Even == TRUE) %>%
pull(Choice)
cat("The correct answer choice is:",correct_answer,"\n")
## The correct answer choice is: B
A company that makes electronic components claims that they last for 5000 hours. Sixteen components were randomly selected and tested to see how long they lasted. The times (to the nearest hour) that they lasted were: \([5005,4976,4961,4953,4916,4954,4968,5085,4840,4901,4967,4854,4880,4943,4998,5073]\). Assuming that the times are a random sample from a Normal distribution with population mean \(\mu\), carry out a two-tailed t-test at the 1% level using the following null and alternative hypotheses: \(H_0: \mu = 5000\), \(H_1: \mu \neq 5000\).
times <- c(5005,4976,4961,4953,4916,4954,4968,5085,4840,4901,4967,4854,4880,4943,4998,5073)
t.test(times,mu = 5000,conf.level = 0.99,alternative = "two.sided")
##
## One Sample t-test
##
## data: times
## t = -2.6646, df = 15, p-value = 0.01767
## alternative hypothesis: true mean is not equal to 5000
## 99 percent confidence interval:
## 4904.445 5004.805
## sample estimates:
## mean of x
## 4954.625
What is \(\int x^6 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
g <- makeFun(x^6 ~ x)
anti_g <- antiD(g(x) ~ x)
anti_g
## function (x, C = 0)
## x^7/7 + C