Question 1

Evaluate the following limit.

\[\lim_{x \to 2} \frac{x^2 - 4}{x^2 - 2x}\]

# 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 <- (x^2 - 4) / (x^2 - 2 * x)
result <- lim(f,x,2)
result
## y: 2

Question 2

Graph the following coordinates to make a polygon.

\[A \space (4,1), B \space (3,2),\, C \space (4,5)\]

# 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
q2_data <- data.frame(Letter = LETTERS[1:3],
                      X = c(4,3,4),
                      Y = c(1,2,5))
ggplot(q2_data,aes(x = X,y = Y)) +
  geom_polygon(fill = "steelblue",alpha = 0.5,color = "black",lwd = 1.25) +
  geom_point(size = 3) +
  geom_text(aes(label = Letter),nudge_y = 0.3,nudge_x = 0.01,fontface = "bold") +
  theme_gray(base_size = 14)

Question 3

Each of the letters of the word PARALLELOGRAM are written on separate pieces of paper that are then folded, put in a hat, and mixed thoroughly. One piece of paper is chosen at random from the hat.

A. What is the probability it is a vowel?

# install.packages("tidyverse")
library(tidyverse)
Word1 <- str_split("PARALLELOGRAM","")[[1]] 
Vowels1 <- c("A","E","I","O","U")
Counter1 <- 0
N1 <- 1e5 # 100,000 trials
for (i in 1:N1) {
  Selection1 <- sample(x = Word1,size = 1,replace = T)
  if (Selection1 %in% Vowels1) {
    Counter1 <- Counter1 + 1
  }
}
Probability1 <- Counter1 / N1
cat("The probability it is a vowel is:",Probability1,"\n")
## The probability it is a vowel is: 0.38388

B. What is the probability it is NOT a vowel?

# install.packages("tidyverse")
library(tidyverse)
Word2 <- str_split("PARALLELOGRAM","")[[1]]
Vowels2 <- c("A","E","I","O","U")
Counter2 <- 0
N2 <- 1e5 # 100,000 trials
for (j in 1:N2) {
  Selection2 <- sample(x = Word2,size = 1,replace = T)
  if (!(Selection2 %in% Vowels2)) {
    Counter2 <- Counter2 + 1
  }
}
Probability2 <- Counter2 / N2
cat("The probability it is NOT a vowel is:",Probability2,"\n")
## The probability it is NOT a vowel is: 0.61551