![](/img/trans.png)
[英]How can I fit a randomly generated number to a custom “bell curve” distribution?
[英]How to score objects in an array on a bell curve from 1 to 10 in increments of 0.5 only with the bell curve generated around a variable mean
我有一個對象數組,每個對象看起來像這樣:
{
name: "John Doe",
score: ""
}
數組中有多個此類對象,該數組實際上是按照從好到壞的順序排列的,因此在一個看起來像這樣的數組中:
[{name: "John Doe", score: ""}, {name: "Jane Doe", score: ""}, ..., {name: "Adam Smith", score: ""}]
約翰·多伊(John Doe)將是所有人中得分最高的,而亞當·史密斯(Adam Smith)將是得分最低的。
目的是獲取平均分和其他必要的東西(例如標准差)作為輸入,並在鍾形曲線上對數組中的每個人進行得分,在該均值周圍,分數將增加0.5,因此它們將分別變為1、1.5、2、2.5,.. 。,9.5、10。這應該適用於多達數百個元素的大型數組。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.