Consider the following vectors representing the number of
three-pointers made and attempted by a basketball player in five games:
Three-Pointers Made: c(4, 5, 3, 6, 7) Three-Pointers Attempted: c(9, 10,
8, 11, 12) Calculate the three-point shooting percentage for each game
and select the correct average three-point shooting percentage for the
five games.
The three-point shooting percentage for each game is
approximately:
44.4% 50% 37.5% 55.6% 58.3%
The average three-point shooting percentage for the five games is
approximately 49%.
# Define the vectors
three_pointers_made <- c(4, 5, 3, 6, 7)
three_pointers_attempted <- c(9, 10, 8, 11, 12)
# Calculate the three-point shooting percentage for each game
three_point_percentage <- three_pointers_made / three_pointers_attempted * 100
# Calculate the average three-point shooting percentage for the five games
average_three_point_percentage <- mean(three_point_percentage)
#Lets Print for results
cat("Three-Point Percentage per game:", three_point_percentage, "\n")
Three-Point Percentage per game: 44.44444 50 37.5 54.54545 58.33333
cat("Average Three-Point Percentage of all:", average_three_point_percentage, "\n")
Average Three-Point Percentage of all: 48.96465
LS0tCnRpdGxlOiAiUiBOb3RlYm9vayAxNCIKb3V0cHV0OiBodG1sX25vdGVib29rCi0tLQoKCkNvbnNpZGVyIHRoZSBmb2xsb3dpbmcgdmVjdG9ycyByZXByZXNlbnRpbmcgdGhlIG51bWJlciBvZiB0aHJlZS1wb2ludGVycyBtYWRlIGFuZCBhdHRlbXB0ZWQgYnkgYSBiYXNrZXRiYWxsIHBsYXllciBpbiBmaXZlIGdhbWVzOgpUaHJlZS1Qb2ludGVycyBNYWRlOiBjKDQsIDUsIDMsIDYsIDcpIFRocmVlLVBvaW50ZXJzIEF0dGVtcHRlZDogYyg5LCAxMCwgOCwgMTEsIDEyKQpDYWxjdWxhdGUgdGhlIHRocmVlLXBvaW50IHNob290aW5nIHBlcmNlbnRhZ2UgZm9yIGVhY2ggZ2FtZSBhbmQgc2VsZWN0IHRoZSBjb3JyZWN0IGF2ZXJhZ2UgdGhyZWUtcG9pbnQgc2hvb3RpbmcgcGVyY2VudGFnZSBmb3IgdGhlIGZpdmUgZ2FtZXMuCgpUaGUgdGhyZWU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