0
$\begingroup$

I wrote this short code

r = RandomReal[NormalDistribution[15, 1], 10000];
N[Mean[r], 3]
15.0012
N[StandardDeviation[r], 3]
1.00667
N[(StandardDeviation[r]/Sqrt[10000]), 3]
0.0100667

My problem is, the function N is returning me the correct amount o significant digits i want.

$\endgroup$

marked as duplicate by Szabolcs, Thies Heidecke, Johu, Community Sep 28 '18 at 21:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ You want Round[] for this. RandomReal[] already returns machine precision results, so any alteration by N[] will not work. $\endgroup$ – J. M. is away Sep 28 '18 at 19:04

Browse other questions tagged or ask your own question.