1. I began by assigning the values to their variables, then evaluating each expression and assigning to z, and displaying z
x <- 1.1
a <- 2.2
b <- 3.3

#Expressions
z <- x^(a^b)
print(z)
## [1] 3.61714
z <- (x^a)^b
print(z)
## [1] 1.997611
z <- (3*x^3+2*x^2+1)
print(z)
## [1] 7.413
vector_a <- c(1:8,7:1)
print(vector_a)
##  [1] 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1
temp_vec <- c(1:5)
vector_b <- rep(temp_vec,times=temp_vec)
print(vector_b)
##  [1] 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
temp_vec2 <- c(5:1)
vector_c <- rep(temp_vec2,times=temp_vec)
print(vector_c)
##  [1] 5 4 4 3 3 3 2 2 2 2 1 1 1 1 1
  1. I assigned the variables their values by picking them out of the vector I created. I found r using the Pythagorean theorem and then used inverse sin to find theta.
vector <- runif(2)

x <- vector[1]
print(x)
## [1] 0.1794057
y <- vector[2]
print(y)
## [1] 0.3037999
r <- (x^2 + y^2)^(1/2) 
print(r)
## [1] 0.3528183
theta <- asin(y/r)
print(theta)
## [1] 1.037363
  1. Noahs arc
queue <- c("sheep", "fox", "owl", "ant") 
print(queue)
## [1] "sheep" "fox"   "owl"   "ant"
queue <- c(queue,"serpent")
print(queue)
## [1] "sheep"   "fox"     "owl"     "ant"     "serpent"
queue <- queue[2:5]
print(queue)
## [1] "fox"     "owl"     "ant"     "serpent"
queue <- c("donkey",queue)
print(queue)
## [1] "donkey"  "fox"     "owl"     "ant"     "serpent"
queue <- queue[1:4]
print(queue)
## [1] "donkey" "fox"    "owl"    "ant"
queue <- queue[c(1,2,4)]
print(queue)
## [1] "donkey" "fox"    "ant"
queue <- c(queue[1:2],"aphid",queue[3])
print(queue)
## [1] "donkey" "fox"    "aphid"  "ant"
which(queue=="aphid")
## [1] 3
  1. I used the subset function here to include all numbers that cannot be divided evenly (defined as having a remainder not equal to 0) by 2, 3, or 7.
math_vector <- c(1:100)

math_final <- subset(math_vector, (math_vector%%2 != 0) & (math_vector%%3 !=0) & (math_vector%%7 != 0))
print(math_final)
##  [1]  1  5 11 13 17 19 23 25 29 31 37 41 43 47 53 55 59 61 65 67 71 73 79 83 85
## [26] 89 95 97