题目
题目

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

多项选择题

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.

选项
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)
题目图片
查看解析

查看解析

标准答案
Please login to view
思路分析
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

登录即可查看完整答案

我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。

类似问题

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!