Degrees of Freedom: ddof=0 vs ddof=1
Xem dạng PDF
Gửi bài giải
Điểm:
100,00
Giới hạn thời gian:
2.0s
Giới hạn bộ nhớ:
256M
Tác giả:
Dạng bài
Ngôn ngữ cho phép
Python
Task
Given n values, compute the population std (ddof=0) and sample std (ddof=1), plus their ratio sample_std / pop_std. If pop_std = 0, output 0 0 1.
Input
- Line 1: integer
n - Line 2:
nspace-separated floats
Output
Three space-separated floats: pop_std sample_std ratio
Example
Input:
4
2 4 4 4
Output:
0.8164965809 0.9428090416 1.154700538
Scaffolding
def ddof_compare(x: list[float]) -> tuple: ...
Notes
Track M: the ratio equals sqrt(n / (n-1)). Use ddof=0 for z-scores; ddof=1 when estimating population std from a sample.
Bình luận