## Wednesday, March 14, 2018

### Egyptian estimates of PI

I saw a neat tweet on how the estimate the Egyptians used for PI.

This is all my speculation, and maybe a math history buff can enlighten me, but the D^2 dependence they should discover pretty naturally.   Including the constant before squaring is, I would argue, just as natural as having it outside the parentheses, so let's go with that for now.   So was there a nearby better fraction?   How well did the Egyptians do?   A brute force program should tell us.

We will use the ancient programming language C:

#include
#include
int main() {
double min_error = 10;
for (int denom = 1; denom < 10000; denom++) {
for (int num = 1; num < denom; num++) {
double approx = 2*double(num)/double(denom);
approx = approx*approx;
double error2 = M_PI-approx;
error2 = error2*error2;
if (error2 < min_error) {
min_error = error2;
printf("%d/%d %f\n", num, denom, 4*float(num*num)/float(denom*denom));
}
}
}
}

This produces output:

1/2 1.000000
2/3 1.777778
3/4 2.250000
4/5 2.560000
5/6 2.777778
6/7 2.938776
7/8 3.062500
8/9 3.160494
23/26 3.130177
31/35 3.137959
39/44 3.142562
109/123 3.141252
148/167 3.141597
4401/4966 3.141588
4549/5133 3.141589
4697/5300 3.141589
4845/5467 3.141589
4993/5634 3.141589
5141/5801 3.141590
5289/5968 3.141590
5437/6135 3.141590
5585/6302 3.141590
5733/6469 3.141590
5881/6636 3.141591
6029/6803 3.141591
6177/6970 3.141591
6325/7137 3.141591
6473/7304 3.141591
6621/7471 3.141591
6769/7638 3.141591
6917/7805 3.141592
7065/7972 3.141592
7213/8139 3.141592
7361/8306 3.141592
7509/8473 3.141592
7657/8640 3.141592
7805/8807 3.141592
7953/8974 3.141593
8101/9141 3.141593
8249/9308 3.141593
8397/9475 3.141593
8545/9642 3.141593

So 7/8 was already pretty good, and you need to get to 23/26 before you do any better!   I'd say the Egyptians did extremely well.

What if they had put the constants outside the parens?   How well could they have done?   We can change two of the lines above to:

double approx = 4*double(num)/double(denom);//approx = approx*approx;

and the printf to:

printf("%d/%d %f\n", num, denom, 4*float(num)/float(denom));

And we get:

1/2 2.000000
2/3 2.666667
3/4 3.000000
4/5 3.200000
7/9 3.111111
11/14 3.142857
95/121 3.140496
106/135 3.140741
117/149 3.140940
128/163 3.141104
139/177 3.141243
150/191 3.141361
161/205 3.141464
172/219 3.141552
183/233 3.141631
355/452 3.141593

So 7/9 is not bad!  And 11/14 even better.   So no clear winner here on whether the rational constant should be inside the parens or not.

ChenA said...

If you interested, around 464 AD, Zu Chongzhi calculate the approximate value of pi to 355/133。

rashmi chaudhary said...

Good Post. Thank you sharing.

Unknown said...

Great article. thank you for post.
website design san jose

Unknown said...

"Really Good Useful & informative blog. Really like to read this blog.
great article.The blog was really nice, I really found out about a lot of Awesome content. you can check these blog to get different types of knowledge"
anyblognews
universitycolleague
Interviewgyan
bestsites
makemoneyasfreelance

Avvy malhotra said...

check here new profile of escorts model
Escorts in lahore
Escort in lahore
Escort lahore
Escorts lahore
Lahore escorts
Lahore escort
Call girls lahore
Call girl lahore
Lahore Call girls
Lahore Call girl

rashmi chaudhary said...
Avvy malhotra said...

The era has been running and the acceleration is provided by the online services. Therefore the online might act as the catalyst to look for the top IAS institute in Delhi. The utility of online isfast and accurate.
Top IAS institute in Delhi
upsc coaching in Agra
UPSC coaching in Delhi

Goggly Life said...
emikhan said...

Welcome to pinnacle Escorts organisation in Lahore Lahore is one of the fine cities in the global and it's miles the 2d largest town in Pakistan and as properly the Capital of Punjabi province. Lahore Escorts is the fifth biggest city in South Asia and 26th inside the global. Lahore is a favourite tourist destination because the tradition of Lahore Escorts constantly drawn to foreigners. Lahore is a most effective of Pakistan’s most interesting and unique towns and is second best to Karachi in length. The town is factually the primary town of Punjab and is regularly stated too Because of cultural hub of Pakistan, with fairly some thrilling fascinations to satisfaction the informal vacationer. people come to Lahore only for amusing and leisure and we're an escort based totally agency in Lahore.

http://www.lahorecallgirls.com/

emikhan said...
emikhan said...
Software Development said...
Software Development said...
Pakistan Escorts Services said...

In this escorts Provider agency, you will profit vip escorts in lahore. VIP Escorts is one of the most trusted escorts Provider Group and one of the biggest Escorts Agency in Lahore. Here are the valid Profiles of our Hottest and High-level Escorts in Lahore for our dexterously-ordered Customers. Our focus is to boost your relationship on the high level in imitation of our VIP Model Escorts in Lahore. In our Website, you can profit your hands approaching the order of the exact Profiles and recommend of our all Escorts in Lahore. All our New Hiring Lahore Escorts are regularly updating. There are countless Escorts in Lahore classified according to facilities. Here you can pick Lahore escorts for full Services of Escorts in Lahore. There are plus many adult models drama their facilities in our agency as Escorts in Lahore. Enjoy your time subsequent to ardent Escorts in Lahore according to your intent.

Indian Escorts in Malaysia

Indian Call Girls in Malaysia

Miss kajal said...

VIP Call Girls in Dehradun, Call 7351972006 for our escorts service & book Stunning Dehradun escorts for making love & enjoyment.

rishikesh escort service

mussoorie escorts

ana said...

Class College Education training Beauty teaching university academy lesson teacher master student spa manager skin care learn eyelash extensions tattoo spray

daythammynet
daythammynet
daythammynet
daythammynet
daythammynet
daythammynet
daythammynet
daythammynet
daythammynet

Lahore VIP Girls said...

Lahore Escorts is probably the best office all over in Lahore. Our office is giving new and high school young ladies inconsistently. Their bodies are hot and delicate like an infant. Escorts in Lahore Escorts in Lahore young ladies are the most excellent and they have strong figures. Their countenances and eyes are tempting. online calling girlLahore Call Girls lahore sex lahore girls Call Girls In Lahore lahore girls for night lahore girls whatsapp Lahore Escort need girlfriend in lahore best hotels in lahore Escort In Pakistan Lahore Sex lhr xxx bahria town lahore pics Sex In Lahore scott solace premium review 2 number girl lahore saxy cal pakistan escot hottest pakistani models karachi girls photos Call Girls In Pakistan karachi beautiful girls pakistani Pakistani Girls Hot sexy girls in pakistan pakistan escot call grill pakistan lahore sex girl in lahore High Class Call Girl lahore pakistan xnxx girls supplier in lahore lahore hira mandi contact numbers 00 92 312 48 98 88 2

Lahore VIP Girls said...

Lahore Escorts is probably the best office all over in Lahore. Our office is giving new and high school young ladies inconsistently. Their bodies are hot and delicate like an infant. Escorts in Lahore Escorts in Lahore young ladies are the most excellent and they have strong figures. Their countenances and eyes are tempting. online calling girlLahore Call Girls lahore sex lahore girls Call Girls In Lahore lahore girls for night lahore girls whatsapp Lahore Escort need girlfriend in lahore best hotels in lahore Escort In Pakistan Lahore Sex lhr xxx bahria town lahore pics Sex In Lahore scott solace premium review 2 number girl lahore saxy cal pakistan escot hottest pakistani models karachi girls photos Call Girls In Pakistan karachi beautiful girls pakistani Pakistani Girls Hot sexy girls in pakistan pakistan escot call grill pakistan lahore sex girl in lahore High Class Call Girl lahore pakistan xnxx girls supplier in lahore lahore hira mandi contact numbers 00 92 312 48 98 88 2