Skip to content

Instantly share code, notes, and snippets.

@hyuki0000
Created August 23, 2017 07:16
Show Gist options
  • Save hyuki0000/a3a3ea889acfa86c83769710c5ac6b69 to your computer and use it in GitHub Desktop.
Save hyuki0000/a3a3ea889acfa86c83769710c5ac6b69 to your computer and use it in GitHub Desktop.
N人のうち1人が100点でN-1人が0点であるとき、100点の人の偏差値
# N人のうち1人が100点でN-1人が0点であるとき、100点の人の偏差値
N = 15802 # 人数
μ = 100.0 / N # 平均
v = ((N-1) * (0-μ) ** 2 + 1 * (100-μ) ** 2) / N # 分散
σ = Math.sqrt(v) # 標準偏差
puts 50 + (100-μ) / σ * 10 # 100点の人の偏差値
# => 1307.0202862324857
@hyuki0000
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment