6 ms·
Pi from High School Maths
- wizzwizz4 6y agoThis is a very elegant approach. I have a project where I'm basically reconstructing mathematics from many different sets of first principles in an attempt to give the computer "intuition" about mathematics (intuition à la expert systems, not machine learning), and this has opened my eyes to a lot of elegant, useful sources of intuition (and not just about geometry).
- aesh2Xa1 6y ago> and this has opened my eyes to a lot of elegant, useful sources of intuition (and not just about geometry). Would you care to compile and share them?
- wizzwizz4 6y agoIt's hard to compile intuition; seeing that one diagram unlocked an entire category of possibilities that I hadn't spotted before, and I can feel that they're now accessible (and always were, but I hadn't looked). It's hard to enumerate them. Basically, a lot of things can be thought of as something vaguely geometric, and then enumerated discretely using some method of enumeration (e.g. a grid) to form an approximation to the value, which is a known bound. It feels like the general idea can be used for things other than approximating real values (something to do with property membership and graphs?) but I can't give any concrete examples of that. One of the ideas I got from this, which I think was what spurred me to write that comment, was doing it in reverse. You can think of certain discrete systems as being, in some nebulous way stronger than a bound, inextricably linked to a continuous function. Kind of like Pisot–Vijayaraghavan numbers,[0] but more so. There was something about the resource requirements of an algorithm and applying this technique to compiler optimisation, but that's an incomplete thought. Lots of things. [0]: https://en.wikipedia.org/wiki/Pisot%E2%80%93Vijayaraghavan_number https://en.wikipedia.org/wiki/Pisot%E2%80%93Vijayaraghavan_n...
- nayuki 6y agoI haven't figured out how to compute π efficiently yet. But computing e with proper error bounds is feasible with high-school-level algebra: https://www.nayuki.io/page/approximating-eulers-number-correctly https://www.nayuki.io/page/approximating-eulers-number-corre...
- zamadatix 6y agoThere are equally simple (and similar) ways to compute pi decently quick enough but they are a bit harder to derive imo.
- deleted 6y ago[deleted]
- m4r35n357 6y agoI love playing "spot the programming language" . . .
- marcodiego 6y agoI imagine that a good exercise for children who can already reason about proportionality is to calculate pi experimentally. You can basically make a few experiments to illustrate that the perimeter of a circle is proportional to its radius and then ask them to calculate the perimeter another circle knowing only its radius.
- tkgally 6y agoThis reminds me of a problem that was on the entrance examination to the University of Tokyo in 2003: “Prove that the ratio of a circle’s circumference to its diameter is greater than 3.05.” The problem was believed to have been posed as a protest against the dumbing down of the government-mandated curriculum, as elementary school children in Japan were being taught to use 3 as a substitute for pi in some calculations [1]. The elegance of the problem is that test-takers were unlikely ever to have encountered it before and that various creative solutions are, it seems, possible. [1] https://ja.wikipedia.org/wiki/円周率は3 https://ja.wikipedia.org/wiki/円周率は3
- koolba 6y agoWhat disgrace if a math program would use 3 as an estimate for pi? Not even 22/7?!
- wizzwizz4 6y ago3 is no more of a disgrace than 22/7, in my book.
- angelgcuartero 6y agoWait... --> https://en.wikipedia.org/wiki/Indiana_Pi_Bill https://en.wikipedia.org/wiki/Indiana_Pi_Bill
- TrackerFF 6y agoI get the feeling that using 3 for pi, is mostly beneficial when speed and volume/throughput is more important than precision. I.e - doing 100 problems with Pi = 3 probably doesn't even require a calculator, whereas doing the same problems with a decimal approximation will require students to pull out their calculators, and therefore students can do more problems in a shorter time, using pi = 3. This would certainly make sense in countries where rote learning is the king, and students are pretty much churning through problems. Or, it could be that the vast majority of people will never need the use of an accurate pi value, and it's more beneficial to make them remember some easy value like 3, rather than a confusing decimal or fraction. The people that are going to use pi in any serious manner, will obviously know its value and derivation.
- leephillips 6y agoI made this for my students a while ago, approximating π with similar ideas: https://lee-phillips.org/pidaydarts/ https://lee-phillips.org/pidaydarts/ I think it was my first Svelte application. We did the paper airplane version in class, which was fun.
- molticrystal 6y agoBuffon's needle problem[0] remains my favorite way to calculate pi. You drop readily available sticks such as matches or toothpicks on top of parallel lines at least slightly wider than the sticks. In a Monte Carlo fashion, pi will emerge. An interactive example is available[1]. pi is approximately: (2 x the stick length * the number dropped) divided by (the distance between lines * sticks crossing a line) [0] https://en.wikipedia.org/wiki/Buffon%27s_needle_problem https://en.wikipedia.org/wiki/Buffon%27s_needle_problem [1] https://ogden.eu/pi/ https://ogden.eu/pi/
- schoen 6y agoAnother Monte Carlo angle: import random n=1000000 print(4.*sum(random.random()**2 + random.random()**2 < 1 for i in range(n))/n) Both this version and the Buffon's Needle version are a lot less efficient than the version in this article, because the article's version is making educated guesses about where the boundary is, while the randomized versions are making uneducated guesses. :-)