The Naked Scientists
  • Login
  • Register
  • Podcasts
      • The Naked Scientists
      • eLife
      • Naked Genetics
      • Naked Astronomy
      • In short
      • Naked Neuroscience
      • Ask! The Naked Scientists
      • Question of the Week
      • Archive
      • Video
      • SUBSCRIBE to our Podcasts
  • Articles
      • Science News
      • Features
      • Interviews
      • Answers to Science Questions
  • Get Naked
      • Donate
      • Do an Experiment
      • Science Forum
      • Ask a Question
  • About
      • Meet the team
      • Our Sponsors
      • Site Map
      • Contact us

User menu

  • Login
  • Register
  • Home
  • Help
  • Search
  • Tags
  • Recent Topics
  • Login
  • Register
  1. Naked Science Forum
  2. On the Lighter Side
  3. That CAN'T be true!
  4. Is this the silliest way to calculate Pi?
« previous next »
  • Print
Pages: [1] 2   Go Down

Is this the silliest way to calculate Pi?

  • 21 Replies
  • 14264 Views
  • 0 Tags

0 Members and 1 Guest are viewing this topic.

Offline LeeE (OP)

  • Naked Science Forum King!
  • ******
  • 3382
  • Activity:
    0%
  • Thanked: 3 times
    • Spatial
Is this the silliest way to calculate Pi?
« on: 05/07/2009 13:06:41 »
I once mentioned in an old and long forgotten thread that Pi could be calculated using random numbers, and I've finally got around to coding something to try it out[;D]

Basically, you generate pairs of random x & y coordinates then use Pythagorus to see if the coordinate falls inside or outside a circle (I actually got it wrong in the earlier thread - it's the number of points that fall inside the circle divided by the total number of iterations, and not the number that fall outside the circle, as I'd said earlier.  To simply things I just used a quarter circle so I could just use values 0 < n < 1 and then multiplied the result by 4)

Anyway, after four runs of 10,000,000 iterations I got these results:

3.14275271428
3.14078311408
3.14159111416
3.14055391406

which gives a mean average of 3.141420214145.

Pretty poor results for the number of iterations, I think  [;D]
Logged
...And its claws are as big as cups, and for some reason it's got a tremendous fear of stamps! And Mrs Doyle was telling me it's got magnets on its tail, so if you're made out of metal it can attach itself to you! And instead of a mouth it's got four arses!
 



Offline Bored chemist

  • Naked Science Forum GOD!
  • *******
  • 31101
  • Activity:
    11%
  • Thanked: 1291 times
Is this the silliest way to calculate Pi?
« Reply #1 on: 05/07/2009 13:31:34 »
No, the silliest way to calculate pi is by dropping matches on a striped floor. If the width of the stripes is that same as the length of the matches then the probalility of a match landing entirely in one stripe (rather than crossing the line between two stripes) is related to pi, but I can't remember the relationship. Come to think of it, it might have been a tiled floor.
Logged
Please disregard all previous signatures.
 

Offline Don_1

  • Naked Science Forum King!
  • ******
  • 6889
  • Activity:
    0%
  • Thanked: 15 times
  • A stupid comment for every occasion.
    • Knight Light Haulage
Is this the silliest way to calculate Pi?
« Reply #2 on: 06/07/2009 10:35:40 »
The easiest way to calculate pi, is to look at the cooking instructions on the back.
Logged
If brains were made of dynamite, I wouldn't have enough to blow my nose.
 

Offline Chemistry4me

  • Naked Science Forum King!
  • ******
  • 7705
  • Activity:
    0%
  • Thanked: 2 times
Is this the silliest way to calculate Pi?
« Reply #3 on: 06/07/2009 11:05:17 »
Maybe for you!
Logged
 

Offline LeeE (OP)

  • Naked Science Forum King!
  • ******
  • 3382
  • Activity:
    0%
  • Thanked: 3 times
    • Spatial
Is this the silliest way to calculate Pi?
« Reply #4 on: 06/07/2009 15:25:52 »
Quote from: Bored chemist on 05/07/2009 13:31:34
No, the silliest way to calculate pi is by dropping matches on a striped floor. If the width of the stripes is that same as the length of the matches then the probalility of a match landing entirely in one stripe (rather than crossing the line between two stripes) is related to pi, but I can't remember the relationship. Come to think of it, it might have been a tiled floor.

Sounds interesting - I'll have to have a think about it.
Logged
...And its claws are as big as cups, and for some reason it's got a tremendous fear of stamps! And Mrs Doyle was telling me it's got magnets on its tail, so if you're made out of metal it can attach itself to you! And instead of a mouth it's got four arses!
 



Offline RD

  • Naked Science Forum GOD!
  • *******
  • 9094
  • Activity:
    0%
  • Thanked: 163 times
Is this the silliest way to calculate Pi?
« Reply #5 on: 06/07/2009 20:36:44 »
Quote from: Bored chemist on 05/07/2009 13:31:34
... Come to think of it, it might have been a tiled floor.

You were right first time: it's stripes ... http://en.wikipedia.org/wiki/Buffon%27s_needle
« Last Edit: 06/07/2009 20:39:49 by RD »
Logged
 

lyner

  • Guest
Is this the silliest way to calculate Pi?
« Reply #6 on: 06/07/2009 23:23:43 »
Quote from: Don_1 on 06/07/2009 10:35:40
The easiest way to calculate pi, is to look at the cooking instructions on the back.


I think that would be 2pi, if it's a circular pie. Just to add confusion.
Logged
 

Offline Bored chemist

  • Naked Science Forum GOD!
  • *******
  • 31101
  • Activity:
    11%
  • Thanked: 1291 times
Is this the silliest way to calculate Pi?
« Reply #7 on: 07/07/2009 15:03:11 »
Quote from: RD on 06/07/2009 20:36:44
Quote from: Bored chemist on 05/07/2009 13:31:34
... Come to think of it, it might have been a tiled floor.

You were right first time: it's stripes ... http://en.wikipedia.org/wiki/Buffon%27s_needle
Thanks.
I knew about the mathematical result. I didn't know that anyone had been daft enough to try it
"Mario Lazzarini, an Italian mathematician, performed the Buffon's needle experiment in 1901. Tossing a needle 3408 times, he attained the well-known estimate 355/113 for π".
Logged
Please disregard all previous signatures.
 

Offline RD

  • Naked Science Forum GOD!
  • *******
  • 9094
  • Activity:
    0%
  • Thanked: 163 times
Is this the silliest way to calculate Pi?
« Reply #8 on: 07/07/2009 20:56:06 »
Quote from: Bored chemist on 07/07/2009 15:03:11
"Mario Lazzarini, an Italian mathematician, performed the Buffon's needle experiment in 1901.
 Tossing a needle 3408 times, he attained the well-known estimate 355/113 for π".

What a prodigious tosser  [:)]
« Last Edit: 07/07/2009 20:59:37 by RD »
Logged
 



Offline LeeE (OP)

  • Naked Science Forum King!
  • ******
  • 3382
  • Activity:
    0%
  • Thanked: 3 times
    • Spatial
Is this the silliest way to calculate Pi?
« Reply #9 on: 07/07/2009 23:17:46 »
Quote from: RD on 06/07/2009 20:36:44
Quote from: Bored chemist on 05/07/2009 13:31:34
... Come to think of it, it might have been a tiled floor.

You were right first time: it's stripes ... http://en.wikipedia.org/wiki/Buffon%27s_needle

Ta for the link.  Although it seems sillier on first hearing it's actually a much more efficient method than one I was trying, so I think the random x/y coordinate pairs system is still the silliest.
Logged
...And its claws are as big as cups, and for some reason it's got a tremendous fear of stamps! And Mrs Doyle was telling me it's got magnets on its tail, so if you're made out of metal it can attach itself to you! And instead of a mouth it's got four arses!
 

Offline Don_1

  • Naked Science Forum King!
  • ******
  • 6889
  • Activity:
    0%
  • Thanked: 15 times
  • A stupid comment for every occasion.
    • Knight Light Haulage
Is this the silliest way to calculate Pi?
« Reply #10 on: 10/07/2009 07:59:08 »
Quote from: sophiecentaur on 06/07/2009 23:23:43
Quote from: Don_1 on 06/07/2009 10:35:40
The easiest way to calculate pi, is to look at the cooking instructions on the back.


I think that would be 2pi, if it's a circular pie. Just to add confusion.

You mean Pi2?
Logged
If brains were made of dynamite, I wouldn't have enough to blow my nose.
 

Offline Chemistry4me

  • Naked Science Forum King!
  • ******
  • 7705
  • Activity:
    0%
  • Thanked: 2 times
Is this the silliest way to calculate Pi?
« Reply #11 on: 10/07/2009 09:03:46 »
Quote from: Don_1 on 10/07/2009 07:59:08
You mean Pi2?
Get rational.
Logged
 

Offline Don_1

  • Naked Science Forum King!
  • ******
  • 6889
  • Activity:
    0%
  • Thanked: 15 times
  • A stupid comment for every occasion.
    • Knight Light Haulage
Is this the silliest way to calculate Pi?
« Reply #12 on: 10/07/2009 09:26:54 »
I see you know your onions.
Logged
If brains were made of dynamite, I wouldn't have enough to blow my nose.
 



Offline Chemistry4me

  • Naked Science Forum King!
  • ******
  • 7705
  • Activity:
    0%
  • Thanked: 2 times
Is this the silliest way to calculate Pi?
« Reply #13 on: 10/07/2009 09:27:50 »
Are you for real?
Logged
 

Offline Don_1

  • Naked Science Forum King!
  • ******
  • 6889
  • Activity:
    0%
  • Thanked: 15 times
  • A stupid comment for every occasion.
    • Knight Light Haulage
Is this the silliest way to calculate Pi?
« Reply #14 on: 10/07/2009 09:39:24 »
I am a little old and crusty.
Logged
If brains were made of dynamite, I wouldn't have enough to blow my nose.
 

Offline Chemistry4me

  • Naked Science Forum King!
  • ******
  • 7705
  • Activity:
    0%
  • Thanked: 2 times
Is this the silliest way to calculate Pi?
« Reply #15 on: 10/07/2009 09:41:10 »
You want a Nobel Peas Pie?
Logged
 

Offline Chemistry4me

  • Naked Science Forum King!
  • ******
  • 7705
  • Activity:
    0%
  • Thanked: 2 times
Is this the silliest way to calculate Pi?
« Reply #16 on: 10/07/2009 09:45:38 »
Or some more PUN-kin-PI?
Logged
 



Offline Don_1

  • Naked Science Forum King!
  • ******
  • 6889
  • Activity:
    0%
  • Thanked: 15 times
  • A stupid comment for every occasion.
    • Knight Light Haulage
Is this the silliest way to calculate Pi?
« Reply #17 on: 10/07/2009 09:47:07 »
"Chef, why have you put toadstools in the steak pie?"

All together now!

"Because there wasn't mushroom."
Logged
If brains were made of dynamite, I wouldn't have enough to blow my nose.
 

Offline Chemistry4me

  • Naked Science Forum King!
  • ******
  • 7705
  • Activity:
    0%
  • Thanked: 2 times
Is this the silliest way to calculate Pi?
« Reply #18 on: 10/07/2009 09:54:01 »
No! Why did you have to a salt the pie puns?
Logged
 

Offline Don_1

  • Naked Science Forum King!
  • ******
  • 6889
  • Activity:
    0%
  • Thanked: 15 times
  • A stupid comment for every occasion.
    • Knight Light Haulage
Is this the silliest way to calculate Pi?
« Reply #19 on: 10/07/2009 09:59:01 »
I'm feeling a little 'Cobersty' at the moment, so I might look back over some past threads and cut & pastry them here.
Logged
If brains were made of dynamite, I wouldn't have enough to blow my nose.
 



  • Print
Pages: [1] 2   Go Up
« previous next »
Tags:
 
There was an error while thanking
Thanking...
  • SMF 2.0.15 | SMF © 2017, Simple Machines
    Privacy Policy
    SMFAds for Free Forums
  • Naked Science Forum ©

Page created in 0.799 seconds with 70 queries.

  • Podcasts
  • Articles
  • Get Naked
  • About
  • Contact us
  • Advertise
  • Privacy Policy
  • Subscribe to newsletter
  • We love feedback

Follow us

cambridge_logo_footer.png

©The Naked Scientists® 2000–2017 | The Naked Scientists® and Naked Science® are registered trademarks created by Dr Chris Smith. Information presented on this website is the opinion of the individual contributors and does not reflect the general views of the administrators, editors, moderators, sponsors, Cambridge University or the public at large.