posted by [identity profile] atreic.livejournal.com at 12:30pm on 20/11/2013
> I know nothing about monte carlo - is there a dummy's guide to what it is
> and why it's not exact?

What I meant by a Monte Carlo approach is a random approach. Pete's
program actually modelled the problem as if for real - it chose a
bunch of Octonauts _at random_, checked whether they included one of
each of the five desired kinds, and then did that over and over again
in a loop and tracked what proportion of the trials were successful.

So it's inexact simply because it depends on randomness - if he'd been
really unlucky, his program might have just happened to get one of
every kind of Octonaut in every trial by sheer luck, or get none of
them on any occasion. The best you can say about the accuracy of the
Monte Carlo approach is that there's a _high probability_ of the
experimental result being near to the exact value, and it clusters
more closely the more trials you do.

(But its great virtue is that if you can live with that uncertainty in
the output, it's able to model problems of arbitrary complexity, long
after it becomes intractable to do the maths analytically or to
iterate over absolutely all possibilities!)
 
posted by [identity profile] atreic.livejournal.com at 12:31pm on 20/11/2013

Oh, of course. He rolled lots of dice, and although that's a good way of
working out probability, it's not a great way, because you could just be
really lucky at rolling dice.
 
posted by [identity profile] pete stevens at 02:17pm on 20/11/2013
Hmm. My program isn't terminating - it will run until power failure if it keeps being unlucky.

But on the being lucky/unlucky. I ran 16k full trials. So the probability of coming out with the answer 5 is (5/8 . 4/8 . 3/8 . 2/8 . 1/8)^16384 which is 120 * 2^-245760 which is well below the Heisenberg limit of 6.6 * 10^-34 at which point you probably need to start worrying about the correct type of octonaut spontaneously popping into existence without having to visit Tescos.

Incidentally in 64k trails (65536) the worse results were 86, 83 and 81 purchases to get the full set.

May

SunMonTueWedThuFriSat
  1
 
2 3
 
4
 
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30
 
31