The BBP formula is good for exctracting a small set of digits without precomputing them. But if you want to actually compute pi, use other formulas. Good example: the world record holder program y-cruncher (google it) uses Chudnovsky formula.
Your friend may know many digits of Pi...but nobody knows "half" of them. Because there is an infinite number of digits of pi...it never ends! People have calculated something like a trillion digits but there are always more...
That's a lot more than I know! I used to know it to 13 places...but I never needed more than 6 for anything I ever calculated :) That's an impressive length you have memorized there though!
i like it very much, can you create a project that calculated pi to an infinite number of digits after the decimal point and each figure separate stores in a list ?
I wish I knew how to do that! I have been trying to find an algorithm that does that for years. No success, unfortunately. This one kind of does that in that each term of the series gives another digit of pi...but it gives results in base 16 :)
I'd love to know the algorithm they use to churn out all those digits...I came across one once that would compute the digits in base 16 - but then how do you convert that huge base 16 fraction to base 10?
An interesting thing about this technique is that if you look at it carefully, you will see the last part of the equation is a multiplier of (1/16)^n...that means that each term gives you exactly one digit of pi - in base 16! So, you could just run the rest of the equation through a loop and store the results in a list and generate pi digits to any desired accuracy. Only...the result will be in base 16, not base 10!
It actually is giving you 15 significant digits in only 10 iterations. It stopped at 10 because that's all I programmed...if you ran it more you would get more digits...BUT - the variables in Scratch have limited accuracy and can't hold much more than 15 significant digits so it won't do you any good unless you build your own storage structure somehow - maybe using a list?
I'm working on calculating pi with more integers... But in order to do so, I first had to teach scratch how to divide to a specified amount of decimal places. Teaching scratch how to divide was hard at first, but then I looked at how us normal humans do long division, and wrote down the steps. Then, I put it into scratch code. I've also taught scratch how to add in the format that I'm using. (lists, for really big numbers!!!!) Currently, scratch has only 1 decimal place. I made it infinite.
Well, that's cool that you've built your own number representation to any precision you want! Amazing. However, Scratch carries far better than 1 decimal place of accuracy. It is true that it only SHOWS one decimal in it's results...but internally, the numbers are represented more accuratly. You can show this by multiplying the answers by 1000 or 10000 and looking at the results.
just to let anyone know, einstein is not as smart as you think. E=mc(2) is not a formula. it is a algabreic expression so he is not knowing what E(2) is.
Uh, yes it is. It means that Energy=Mass x Speed of Light Squared. Say Einstein knew the energy and mass of an object. He could take energy, divide it by mass, and take the square root to find the speed of light.
E=mc2...pi...four score n, seven years ago... god i luv learning but im kinda getting sick of itt cuz the year's almost ova but at least im gonna get to go to this special camp from my school to walk (and talk!) it all off. :) but anyway cool i could have never figured this out on my own i mean just cuz im a computer geek doesn't mean i'm a complete wiz at math.
Sounds like you're ready for a vacation! I'm more of a math geek myself - I know enough programming to make the math work. Most of my math is nothing too fancy, with the exception of Perpetual Slinky where I actually got to use a tiny bit of Calculus!
I have a uestion, P2S. Is there a block inScratch that multiplies numbers to the power of (^). I'm doing a advanced project using a new block I discovered from another's project. It is called abs. I've seen it before, sso I'm testing with it. I'm trying to make a number, and mabye I'll then use algebra...but, the main question is, is there a ^ brick in Scratch?
Hey! I figured out a way to do it using the functions they give you. x^n = e^( n * ln(x)). So if 'x' is your number and 'n' is the power you want to raise it to, take the Natural Log (ln) of 'x', multiply that by 'n' then use that as a power on Euler's Constant (e^). That's a really ugly way to do it but it seems to work.
I am sorry to say that there is not. That is pretty strange when you consider that they give you functions for Natural Logarithm (ln) and Eulers Constant raised to a power (e^) which are functions much less commonly used then the simple 'raised to a power' function. I don't know why it is not included.
Amazing work. I was going to try this myself, but you got there first! Great job. For those who are interested, this method is unique in that it can compute any arbitrary digit without computing the previous digits.
75zx - No, I didn't figure out the formula...I just wrote the project that calculates values from it. Pi day is March 14 because it's the 14th day of the 3rd month so 3/14. The value of Pi is starts with the digits 3.14 so thats why 3/14 is Pi day.
PlanetX - The authors of the formula are three people named Bailey, Borwein, and Plouffe (last names). I don't know their first names. You should download it to look at the coding, it is really very simple. Thanks for the idea of slowing it down a bit...I'll do that.
woah. now that you explained that to me, i can see how amazing that formula is. do you know who came up with it? also, this is just a suggustion, i think you should make it go a bit slower, so you can see how the number changes by the end, because i thought it went to fast when i watched it
If you want to learn more about series equations, try this website:
http://mathrocks.thebernas.net/IntMath3/SequencesSeries/pages/arithseries/arithseriessig.htm
PlanetX - This formula is an infinite series...to get the exact answer you would have to set the value of n to 0,1,2,3 ... all the way to infinity and add up different pieces (that sideways M symbol is called sigma and it means this is a series formula). Each time you change n you get a different "term", which just means piece of the formula. Even though you would have to add up an infinite number of terms to get an exact answer, you can see here that you get a pretty close answer after only adding up 10 terms - it "converges" on the final answer quickly.
Comments
You need to be logged in to post comments
Add a Comment
So Weird I Know 260 Digits of Pi
You must have an impressive memory!
(view all replies)it glitches if you press scratch more than once
all i know is 3.141592653589793238462643383279502884197169399375105820974944592307816406286280382534211706798214
I think that is more than enough, for most practical purposes :)
The BBP formula is good for exctracting a small set of digits without precomputing them. But if you want to actually compute pi, use other formulas. Good example: the world record holder program y-cruncher (google it) uses Chudnovsky formula.
Thanks! I'll take a look at that.
3.14159265358979323846264338327950288419716939937510 That's not too bad.
Yayz hard math problem! math is a great thing. :)
Very true :)
@The_Master_Gamer I know up to 21 digits 3.141592653589893238462
That ought to be enough for just about any practical calculation that you might want to do :)
I know 3.1415926535897932384626433832795
That's a lot of digits! More accuracy than you will probably ever need :)
(view all replies)All I know is 3.1415926
All I know is 3.14
(view all replies)That's more than enough, for most purposes :)
This person in our school memorised 100 digits of pi. I think it was for charity.
(view all replies)I'v memorized almost 180.
A kid in my class memorised 235. :O
I see you know the magic word :)
Yeah, sines are simply the ratios of one of the sides of a right triangle to the hypotenuse :)
(view all replies)All I know is 3.14159265358979323846264338
I'm pretty sure that is more than you will ever need :)
(view all replies)all I know is 3.14
Your friend may know many digits of Pi...but nobody knows "half" of them. Because there is an infinite number of digits of pi...it never ends! People have calculated something like a trillion digits but there are always more...
(view all replies)That's all you need, for most calculations :)
(view all replies)Pi! Yummy! 3.1415926535897932384626433832795028841971693993751058 is all that I know
that's THE EXACT SAME AMOUNT i've memorized!
Sorry, I don't think it's as simple as changing the formula and getting digits base 10. That would be cool if that worked though.
(view all replies)That's a lot more than I know! I used to know it to 13 places...but I never needed more than 6 for anything I ever calculated :) That's an impressive length you have memorized there though!
(view all replies)Pi day isnt very important to me, because I wasnt born in the world to do maths.
You should be a bit more open to math. There is tons of cool stuff in it.
How do you know? Maybe you just haven't found the right teacher yet :)
i like it very much, can you create a project that calculated pi to an infinite number of digits after the decimal point and each figure separate stores in a list ?
I wish I knew how to do that! I have been trying to find an algorithm that does that for years. No success, unfortunately. This one kind of does that in that each term of the series gives another digit of pi...but it gives results in base 16 :)
Nice project. I learnt a lot.
ππππ
Very fast way of calculating pi. It is nice to see intermediate answers.
Thanks...yeah, I was amazed with this technique when I read about it. It converges very quickly!
I have pi to 10000 places in the description of my pi gallery
I'd love to know the algorithm they use to churn out all those digits...I came across one once that would compute the digits in base 16 - but then how do you convert that huge base 16 fraction to base 10?
Great! If I ever need that kind of accuracy, I'll know where to go :)
Very nice :). I made a pi calculator that isn't as good, but it works: (link to project)
nice project!
can this go more than only 10 decimal places, or is that all u programed it to do.
An interesting thing about this technique is that if you look at it carefully, you will see the last part of the equation is a multiplier of (1/16)^n...that means that each term gives you exactly one digit of pi - in base 16! So, you could just run the rest of the equation through a loop and store the results in a list and generate pi digits to any desired accuracy. Only...the result will be in base 16, not base 10!
(view all replies)It actually is giving you 15 significant digits in only 10 iterations. It stopped at 10 because that's all I programmed...if you ran it more you would get more digits...BUT - the variables in Scratch have limited accuracy and can't hold much more than 15 significant digits so it won't do you any good unless you build your own storage structure somehow - maybe using a list?
(view all replies)Hee Hee! I like the name!
I'm working on calculating pi with more integers... But in order to do so, I first had to teach scratch how to divide to a specified amount of decimal places. Teaching scratch how to divide was hard at first, but then I looked at how us normal humans do long division, and wrote down the steps. Then, I put it into scratch code. I've also taught scratch how to add in the format that I'm using. (lists, for really big numbers!!!!) Currently, scratch has only 1 decimal place. I made it infinite.
Well, that's cool that you've built your own number representation to any precision you want! Amazing. However, Scratch carries far better than 1 decimal place of accuracy. It is true that it only SHOWS one decimal in it's results...but internally, the numbers are represented more accuratly. You can show this by multiplying the answers by 1000 or 10000 and looking at the results.
(view all replies)just to let anyone know, einstein is not as smart as you think. E=mc(2) is not a formula. it is a algabreic expression so he is not knowing what E(2) is.
Uh, yes it is. It means that Energy=Mass x Speed of Light Squared. Say Einstein knew the energy and mass of an object. He could take energy, divide it by mass, and take the square root to find the speed of light.
awsumm..
E=mc2...pi...four score n, seven years ago... god i luv learning but im kinda getting sick of itt cuz the year's almost ova but at least im gonna get to go to this special camp from my school to walk (and talk!) it all off. :) but anyway cool i could have never figured this out on my own i mean just cuz im a computer geek doesn't mean i'm a complete wiz at math.
Sounds like you're ready for a vacation! I'm more of a math geek myself - I know enough programming to make the math work. Most of my math is nothing too fancy, with the exception of Perpetual Slinky where I actually got to use a tiny bit of Calculus!
Okay, how does this formula work because I am not following. Yeesh, cats these days, never showing there work.
Well, this is a Series equation. You can learn about those in Wikipedia probably better than I can describe it here.
(view all replies)I have a uestion, P2S. Is there a block inScratch that multiplies numbers to the power of (^). I'm doing a advanced project using a new block I discovered from another's project. It is called abs. I've seen it before, sso I'm testing with it. I'm trying to make a number, and mabye I'll then use algebra...but, the main question is, is there a ^ brick in Scratch?
Hey! I figured out a way to do it using the functions they give you. x^n = e^( n * ln(x)). So if 'x' is your number and 'n' is the power you want to raise it to, take the Natural Log (ln) of 'x', multiply that by 'n' then use that as a power on Euler's Constant (e^). That's a really ugly way to do it but it seems to work.
(view all replies)I am sorry to say that there is not. That is pretty strange when you consider that they give you functions for Natural Logarithm (ln) and Eulers Constant raised to a power (e^) which are functions much less commonly used then the simple 'raised to a power' function. I don't know why it is not included.
sweet!! I love this!
i get it home made pi
pie
lol homemade pi yum i want to eat my _ ||
I love Knowlage!
I love math!
Woah!Thats awesome!
Sorry pieclip, you are wrong.
good but pi=3.1415962 not 3.1415926
actually pi~3.1415926
that's not right hazelleafkitty... but o well
3.141592635 are the only numbers of pi that i can remember! happy pi day X3
it is ...653... not ...635...
Yes, that is truly amazing! However, it will give you the digits in base 16......
do you need to convert each answer seperately?
Amazing work. I was going to try this myself, but you got there first! Great job. For those who are interested, this method is unique in that it can compute any arbitrary digit without computing the previous digits.
you beat my pi calculator by a light year
wow
YOUR VERY VERY VERY VERY VERY VERY VERY STILL SMART
75zx - No, I didn't figure out the formula...I just wrote the project that calculates values from it. Pi day is March 14 because it's the 14th day of the 3rd month so 3/14. The value of Pi is starts with the digits 3.14 so thats why 3/14 is Pi day.
WOW DID YOU FIGER THAT ALL OUT IN YOUR HEAD AND WATS PI DAY???????????????
Thanks!
i like it better this way. now you can really see the change. great job on this project!
Reworked the project so all the intermediate answers are also shown - it's easier to see how the digits change with each iteration this way.
PlanetX - The authors of the formula are three people named Bailey, Borwein, and Plouffe (last names). I don't know their first names. You should download it to look at the coding, it is really very simple. Thanks for the idea of slowing it down a bit...I'll do that.
also, how did you manage to program it?
woah. now that you explained that to me, i can see how amazing that formula is. do you know who came up with it? also, this is just a suggustion, i think you should make it go a bit slower, so you can see how the number changes by the end, because i thought it went to fast when i watched it
Weird, it works.
I will look at that site...
Nice project! Pi is so cool. Hehe, I love all numbers. :)
If you want to learn more about series equations, try this website: http://mathrocks.thebernas.net/IntMath3/SequencesSeries/pages/arithseries/arithseriessig.htm
PlanetX - You can see the limits of the series at the bottom and top of the Sigma symbol.
PlanetX - This formula is an infinite series...to get the exact answer you would have to set the value of n to 0,1,2,3 ... all the way to infinity and add up different pieces (that sideways M symbol is called sigma and it means this is a series formula). Each time you change n you get a different "term", which just means piece of the formula. Even though you would have to add up an infinite number of terms to get an exact answer, you can see here that you get a pretty close answer after only adding up 10 terms - it "converges" on the final answer quickly.
what does it mean by terms?