5
votes
2answers
448 views

How many decimal places are needed for incremental average calculation?

If using the following formula to incrementally calculate average value: $$m_n = m_{n-1} + \frac{a_{n}-m_{n-1}}{n}$$ And the number of decimal places to where you can save $m_n$ is limited to $d$ ...
2
votes
4answers
452 views

Get `n` random values between 2 numbers having average `x`

I want to get n random numbers(e.g n=16)(whole numbers) between 1 to 5(including both) so that average is x. x can be any value between (1, 1.5, 2, 2.5, 3, 3.5, 4, ...