online-algorithm

Online algorithm for calculating standard deviation

▼魔方 西西 提交于 2019-12-29 07:12:22
问题 Normally, I have a more technical problem but I will simplify it for you with an example of counting balls. Assume I have balls of different colors and one index of an array (initialized to all 0's) reserved for each color. Every time I pick a ball, I increment the corresponding index by 1. Balls are picked randomly and I can only pick one ball at a time. My sole purpose is to count number of balls for every color, until I run out of balls. I would like to calculate standard deviation of the

Online algorithm for calculating standard deviation

半世苍凉 提交于 2019-11-29 08:06:49
Normally, I have a more technical problem but I will simplify it for you with an example of counting balls. Assume I have balls of different colors and one index of an array (initialized to all 0's) reserved for each color. Every time I pick a ball, I increment the corresponding index by 1. Balls are picked randomly and I can only pick one ball at a time. My sole purpose is to count number of balls for every color, until I run out of balls. I would like to calculate standard deviation of the number of balls of different colors, while I am counting them . I do not want to calculate it by having