title: Estimating pi from darts being thrown at a SPHERICAL dartboard (python)
body: <p>The familiar code for estimating pi is as follows:</p>
  <pre><code>import math,random
  random.seed(777)
  j = pie = 1
  while True:
      pie = pie + math.trunc(random.random()**2 + random.random()**2)
      if j%100000==0: print(4*(1-float(pie)/float(j)))
      j = j + 1
  print('done')
  </code></pre>
  <p>which emulates darts being thrown at a two-dimensional dartboard.
  But when you try to elevate to a three-dimensional dartboard with:</p>
  <pre><code>import math,random
  random.seed(777)
  j = pie = 1
  while True:
      pie = pie + math.trunc(random.random()**2 + random.random()**2 + random.random()**2)
      if j%100000==0: print((3.0/4.0)*8.0*(1-float(pie)/float(j)))
      j = j + 1
  print('done')
  </code></pre>
  <p>you get something other than pi.</p>