Questions
Questions

STAT0004_25-26 Monday Dec 8th ICA - ALL GROUPS (12:10-12:50)

Multiple choice

100 students take an exam and each gets an integer mark between 0 and 100, but 10 of the 100 students are absent on the day and receive a 0. The marks are stored in an R variable called marks and you are interested in calculating the average mark of the students that DID take the exam. Which of the following expressions can be used to compute this? For this question, you can assume that none of the students who attended the exam received a 0.

Options
A.a. mean(marks[marks > 0])
B.b. mean(marks[marks != 0])
C.c. mean(marks>0)
D.d. mean(marks[marks>=0])
E.e. sum(marks) / sum(marks > 0)
F.f. sum(marks[marks > 0]) / sum(marks > 0)
Question Image
View Explanation

View Explanation

Verified Answer
Please login to view
Step-by-Step Analysis
Question restatement: There are 100 students, with 10 absent who receive 0. The vector marks contains these 0s for absentees and positive integers for attendees. We want the average mark of the students who DID take the exam. None of the attending students received a 0. Option a: mean(marks[marks > 0]). This selects all marks strictly greater than 0 and computes their mean. Since only attendees have positive marks (absentees are 0), this is ......Login to view full explanation

Log in for full answers

We've collected over 50,000 authentic exam questions and detailed explanations from around the globe. Log in now and get instant access to the answers!

Similar Questions

More Practical Tools for Students Powered by AI Study Helper

Join us and instantly unlock extensive past papers & exclusive solutions to get a head start on your studies!