Thought Experiment

8 views
Skip to first unread message

Edmund Chattoe-Brown

unread,
Dec 29, 2020, 2:17:30 AM12/29/20
to netlog...@googlegroups.com
Dear All,

Can I ask that you don't try this until you have made an intuitive estimate!

Suppose a procedure gets called about 12000 times in a single simulation "run" and there is a fixed probability of something happening each time it is called. How much variation would you expect in the actual percentage of times "the thing" happens across runs? For example, imagine the event was supposed to happen 10% of the time, what is the largest and smallest actual percentage you would expect? 9.9% and 10.1%? 9% and 11%?

Now try it using any simple piece of code you have to hand where the relevant procedure is called "a lot".

Thoughts?

Edmund

--
Edmund Chattoe-Brown
edmundcha...@fastmail.fm

Michael Tamillow

unread,
Dec 29, 2020, 8:03:09 AM12/29/20
to Edmund Chattoe-Brown, netlog...@googlegroups.com
That’s easy Edmund, it’s called the binomial distribution, and it converges towards a normal distribution as n goes to infinity. The mean of the normal distribution is p * n, and the standard deviation is sqrt( n * p * (1-p)).

Therefore, to find out how often an even that extreme occurs you can simple find the z score using those metrics i.e. and event of 11% or greater with p = 10% is:

Z = (1320 - 1200) / sqrt( 12000 * .1 * .9) = 120/32.863 = 3.65

A corresponding probability of this is .99974 (use a lookup table - But you could do this all with a CDF) which means greater than 11% happens with probabality .00026 or .026% of the time.

I highly recommend learning probability theory. It’s amazing how useful it is.

Sent from my iPhone

> On Dec 29, 2020, at 1:17 AM, Edmund Chattoe-Brown <edmundcha...@fastmail.fm> wrote:
>
> Dear All,
> --
> You received this message because you are subscribed to the Google Groups "netlogo-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/dbe8b525-0cb2-428b-bcbf-dfd2d9c7065b%40www.fastmail.com.

IQBAL ADJALI

unread,
Dec 29, 2020, 9:58:55 AM12/29/20
to Edmund Chattoe-Brown, netlog...@googlegroups.com
Hi Edmund,


This sounds like a case for a Binomial distribution of 'something' happening with a success probability p=0.1, over N=12000 trials (assuming independence between trials). The binomial probability mass formula:

f(x,N,p)=NCx p^x (1p)^(N−x)


allows the probability distribution (as a function of successful trials) to be drawn. There are lots of online calculators that can be used to graph the binomial distribution. For example the one at: https://keisan.casio.com/exec/system/1180573198 (screenshot attached). From the plotted distribution (well approximated by a Normal for N=12000) the most likely outcome x~1200 (corresponding to 10%) occurs with probability ~ 1.2%, while the minimum and maximum expected are 1100 and 1300 (corresponding to 9.2% and 10.8% respectively for a typical simulation run).

The cumulative probability can also be estimated for outcomes between given lower and upper bounds; for example just by visual inspection it can be estimated that virtually all simulation runs will result in a success probability between 9.2% and 10.8%.

Happy new year!


Iqbal



--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-users+unsub...@googlegroups.com.
2020-12-29_14h01_26.png
Reply all
Reply to author
Forward
0 new messages