Random numbers on Numbers

Hello there,

I am trying to generate random numbers on Number for Mac, distributed around a mean with a given st. deviation. But there is no function i can find that allows me to do that like on Excel! Any solution about that?
It seems i can only generate random numbers evenly distributed.


Thank you

MacBook Pro (13-inch Mid 2012), iOS 10.3

Posted on Mar 31, 2017 3:09 AM

Reply
5 replies

Apr 1, 2017 12:44 PM in response to tommytao23

Hi Tommy,


This seems to do the job:

User uploaded file

Enter the formula in B2, fill down for as many rows as you want samples in your set. The set shown has 1000 'samples'.


Syntax for NORMINV:


NORMINV(probability, average, stdev)


Details on the function (also supported in MS Excel, and recommended for this purpose in at least one Youtube posted video) are available in the Function Browser, which opens in the right sidebar when you enter = in a cell.


Regards,

Barry


PS: Realized after posting I had neglected to include the COUNTIFS formula in column D.

Enter in D2, Fill down for 10 rows:

COUNTIFS(B,">"&10×(ROW()−2),B,"<="&10×(ROW()−1))

B.

Apr 2, 2017 2:08 AM in response to tommytao23

Hi Tommy,


Column D is a frequency distribution table used as a rough check on whether the generated values in column B resembled a normal distribution.


The formula counts the values in each 10 point range whose top value is listed in column C.

Not necessary, but it could provide a graph showing the distribution:

User uploaded file

If you want to see the effect of repeated calculations of the values, include the frequency table and the graph. then format one of the unused cells on the table as a checkbox. Toggling the checkbox will recalculate the table, and the changes will be immediately reflected in the chart, The chart is an X-Y scatter chart. The only changes I made in the chart as produced automatically were to spcify that the data points be connected with a curve, increase the number of steps in the X axis from the default 4 to 10, and to compress the height of the chart by pulling the top boundary downward.


Regards,

Barry

Mar 31, 2017 5:40 AM in response to Yellowbox

Dear Ian,

I find your reply very helpful, but as you know when you apply a normal distribution usually the values are more spread than 1 standard deviation, they might also be higher or lower that 2xSTDEV or 3xSTDEV. Obviously with lower probability... and this method you advise doesn't let me get to my point.

Moreover using your method you just create an evenly distribution between two values, while i have to get more values around the mean, they must not be equiprobable.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Random numbers on Numbers

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.