Question 1:
Q1 <- seq(8, 100, 2)
Q1
## [1] 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44
## [20] 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82
## [39] 84 86 88 90 92 94 96 98 100
Question 2:
mean(1:99)
## [1] 50
Question 3:
z_score <- (25.77 - 23.54) / 2.442
z_score
## [1] 0.9131859
Question 4:
round(0.9131859, digits = 1)
## [1] 0.9
round(z_score, digits = 1)
## [1] 0.9
Question 5:
logfunction <- function(x,prime){
natural_log <- log(x)
common_log <- log10(x)
prime_cube_root <- prime^(1/3)
result <- (natural_log * common_log) / prime_cube_root
return(result)
}
number <- 32
primenumber <- 11
result <- logfunction(number, primenumber)
result
## [1] 2.345548
Question 6:
round(result, digits = 1)
## [1] 2.3
round( 2.345548, digits = 1)
## [1] 2.3
Question 7:
result_oddintegers <- function(x){
oddintegers <- seq(1, by =2, length.out = x )
squares <- oddintegers^2
return(squares)
}
result <- result_oddintegers(10)
result
## [1] 1 9 25 49 81 121 169 225 289 361