News for hackers. Stuff that matters.
Re:Pi from High School Maths by tkgally on Tuesday February 09, 2021 @09:00AM (#26077493)
This 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

Re:Pi from High School Maths by gizmo686 on Wednesday February 10, 2021 @12:30AM (#26085989)
I wonder why they chose 3.05 instead of just 3.

The best I could come up with is related to a student using the inscribed n-gon method for computing a lower bound.

The two obvious choices for an inscribed n-gon are a 6-gon and a 12-gon.

Computing their perimeters involves computing cos(pi/3) or cos(pi/6) respectivly.

Both of these are generally found the same way. By bisecting an equalateral triangle, you get a right angle triangle with angles pi/3 and pi/6, from which sin/cos/tan can easily be read.

Once you have the relevent cos, it is straightforward trig and algebra to find

With a 6-gon: pi>3

With a 12-gon: pi>6sqrt(2-sqrt(3))

Using a calculator, the 12-gon lower bound is pi>3.1058...

Computing by hand (which I did), you end up having enough wiggle room to get away with some further approximations; but still need to go through some somewhat tedious computation.

Maybe they were concerned that some students solution for pi>3 that I didn't, but as far as I have been able to see, the extra .05 just makes the problem more messy.

Re:Pi from High School Maths by koolba on Tuesday February 09, 2021 @09:30AM (#26077860)
What disgrace if a math program would use 3 as an estimate for pi? Not even 22/7?!
Re:Pi from High School Maths by TrackerFF on Wednesday February 10, 2021 @02:57AM (#26086613)
I 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.

Re:Pi from High School Maths by wizzwizz4 on Tuesday February 09, 2021 @09:46AM (#26078058)
3 is no more of a disgrace than 22/7, in my book.
Re:Pi from High School Maths by angelgcuartero on Tuesday February 09, 2021 @10:18AM (#26078424)
Re:Pi from High School Maths by 908B64B197 on Tuesday February 09, 2021 @01:01PM (#26080589)
> as elementary school children in Japan were being taught to use 3 as a substitute for pi in some calculations

That's robbing them of getting an (intuitive) understanding of a whole class of numbers. And limits too!

Re:Pi from High School Maths by ajsnigrutin on Tuesday February 09, 2021 @09:46PM (#26085245)
pi=3 is a totally usefull approximation for when the students are old enough to know, when pi=3 is good enough. Definitely not elementary school.
Re:Pi from High School Maths by tkgally on Tuesday February 09, 2021 @11:39PM (#26085797)
According to the Japanese Wikipedia article I cited above, children were not taught that pi equals 3; rather, children who had not yet learned how to calculate with decimals were told that they could use 3 as a rough approximation for pi when calculating by hand.

This minor change in the official curriculum came at a time when the Japanese government was trying to de-emphasize rote memorization and promote critical thinking in school education. Because that policy also reduced class hours and the amount of material covered, it was widely criticized for supposedly dumbing down school education. The notion that children were being taught “pi = 3” was an exaggeration, but it resonated with other objections to educational policy and apparently led the university to pose that problem on its entrance exam in protest.

I still think it's an interesting problem. I wonder how far I could have gotten with it if, at the age of 18 or 19, I had encountered it on an exam and had just twenty or thirty minutes to try to come up with a proof.

Re:Pi from High School Maths by 908B64B197 on Wednesday February 10, 2021 @11:14AM (#26091095)
Ah! That's more nuanced. Sadly I do not speak Japanese so I didn't read the original source.

> I wonder how far I could have gotten with it if, at the age of 18 or 19, I had encountered it on an exam and had just twenty or thirty minutes to try to come up with a proof.

It's a nice one. Especially because since pi shows up in so many places there are multiple ways of doing it.

Re:Pi from High School Maths by wizzwizz4 on Tuesday February 09, 2021 @07:26AM (#26076686)
This 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).
Re:Pi from High School Maths by aesh2Xa1 on Tuesday February 09, 2021 @08:26AM (#26077170)
> 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?

Re:Pi from High School Maths by wizzwizz4 on Tuesday February 09, 2021 @10:05AM (#26078275)
It'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_n...

Re:Pi from High School Maths by nayuki on Tuesday February 09, 2021 @11:48AM (#26079622)
I 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-corre...
Re:Pi from High School Maths by zamadatix on Tuesday February 09, 2021 @10:31PM (#26085462)
There are equally simple (and similar) ways to compute pi decently quick enough but they are a bit harder to derive imo.
Re:Pi from High School Maths by marcodiego on Tuesday February 09, 2021 @08:25AM (#26077161)
I 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.

Re:Pi from High School Maths by molticrystal on Tuesday February 09, 2021 @12:02PM (#26079811)
Buffon'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

[1] https://ogden.eu/pi/

Re:Pi from High School Maths by schoen on Tuesday February 09, 2021 @08:24PM (#26084788)
Another 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. :-)
Re:Pi from High School Maths by leephillips on Tuesday February 09, 2021 @11:04AM (#26079075)
I made this for my students a while ago, approximating π with similar ideas:

https://lee-phillips.org/pidaydarts/

I think it was my first Svelte application.

We did the paper airplane version in class, which was fun.