Ken picked a number and multiplied it by 9. Use ‘divisibility rules’ to determine which number CANNOT be the result of this multiplication.
A. 7011
B. 7126
C. 7137
D. 7209
# 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
q1_data <- data.frame(Choice = LETTERS[1:4],
Number = c(7011,7126,7137,7209))
correct_answer <- q1_data %>%
filter(Number %% 9 != 0) %>%
pull(Choice)
cat("The correct answer is:",correct_answer,"\n")
## The correct answer is: B
The data below shows the weights of 100 parcels that the courier delivered last Monday. Construct a bar graph of the data and determine how many parcels weighed 8 pounds or more.
# install.packages("tidyverse")
library(tidyverse)
q2_data <- data.frame(Weight = 4:11,
Frequency = c(2,18,15,30,22,16,6,1))
parcels8 <- q2_data %>%
filter(Weight >= 8) %>%
select(Frequency) %>%
sum()
ggplot(q2_data,aes(x = factor(Weight),y = Frequency)) +
geom_col() +
labs(title = "100 Parcel Weight Data",
caption = paste("There are",parcels8,"parcels that weighed 8 pounds or more."),
x = "x",
y = "y") +
theme_gray()