Question 1

Your friend asks you to choose one card from the seven cards in his hand without looking. Which number are you most likely to choose?

set.seed(123) # for reproducibility
Cards <- data.frame(Number = c(8,4,2,2,4,6,2),
                    Suit = c("Heart","Heart","Club","Heart","Diamond","Club","Spade"))
N <- 1e6 # 1 million trials
Simulation <- sample(x = Cards$Number,size = N,replace = T)
probabilities <- prop.table(table(Simulation))
probabilities
## Simulation
##        2        4        6        8 
## 0.428851 0.285767 0.142509 0.142873

We would pick 2 the most.

Question 2

Which one of the following is odd?

A. \(89 \times 85 \times 84\)

B. \(89 \times 85 \times 81\)

C. \(87 \times 86 \times 85\)

D. \(84 \times 82 \times 81\)

# 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 = LETTERS[1:4],
                      Number = c(89*85*84,89*85*81,87*86*85,84*82*81))
correct_answer <- q2_data %>%
  mutate(Odd = Number %% 2 == 1) %>%
  filter(Odd == TRUE) %>%
  pull(Choice)
cat("The answer that is odd is:",correct_answer,"\n")
## The answer that is odd is: B

Question 3

Given the following points, construct its corresponding polygon.

# install.packages("tidyverse")
library(tidyverse)
q3_data <- data.frame(X = c(1,8,8,1),
                      Y = c(6,6,-3,-3))
ggplot(q3_data,aes(x = X,y = Y)) +
  geom_polygon(fill = "blue",alpha = 0.5,col = "black",lwd = 1.25) +
  geom_point(size = 3) +
  coord_equal() +
  theme_gray()

Question 4

What is \(\int 3x^2(2x^3 - 1) 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(3 * x^2 * (2 * x^3 - 1) ~ x)
anti_f <- antiD(f(x) ~ x)
anti_f
## function (x, C = 0) 
## x^3 * (x^3 - 1) + C