Pi To help you remember just draw this diagram. Draw a circle, or use something circular like a plate. Measure around the edge (the circumference): I got 82 cm Measure across the circle (the diameter): I got 26 cm 82 cm / 26 cm = 3.1538... That is pretty close to π. Maybe if I measured more accurately? In fact π is approximately equal to: 3.14159265358979323846 The digits go on and on with no pattern. π has been calculated to over two quadrillion decimal places and still there is no pattern to the digits Example: You walk around a circle which has a diameter of 100m, how far have you walked? Distance walked = Circumference = π × 100m = 314.159...m = 314m (to the nearest m) Approximation A quick and easy approximation for π is 22/7 22/7 = 3.1428571... But as you can see, 22/7 is not exactly right.

In fact π is not equal to the ratio of any two numbers, which makes it an irrational number . A better approximation (but still not exact) is: 355/113 = 3.1415929... (think "113355", then divide the "355" by the "113") Remembering I usually just remember "3.14159", but you can also count the letters of: "May I have a large container of butter today" 3 1 4 1 5 9 2 6 5 To 100 Decimal Places Here is π with the first 100 decimal places: 3.14159265358979323846264338327950288 Tutoring Help: How To Calculate The Area Home > By Subject > Geometry > Area What is area? Area tells us the size of a shape or figure. It tells us the size of squares, rectangles, circles, triangles, other polygons, or any enclosed figure.

In the real world it tells us the size of pieces of paper, computer screens, rooms in houses, baseball fields, towns, cities, countries, and so on. Knowing the area can be very important. Think of getting a new carpet fitted in a room in your home. Knowing the area of the room will help make sure that the carpet you buy is big enough without having too much left over. Calculating Area Area is measured in squares (or square units). How many squares are in this rectangle? We can count the squares or we can take the length and width and use multiplication. The rectangle above has an area of 15 square units. The area of a rectangle is = length x width Examples of calculating the area of a rectangle Area = Length x Width Don't forget the wee 2 We write square sizes using a small 2 next to the unit. We write mm2, cm2, m2 , km2, cm2 We can say "63 millimeters squared" or " 63 square millimeters" We could use small squares to measure large areas. The only problem with this is that we would end up having to use very big numbers.

For example, a field might be measured at 5,000,000,000 square millimeters when 5,000 square meters would be a much easier size to say, write, and visualize. You will probably hear more units for measuring area; square inches, square feet, square yards, square miles, acres, hectares are all units used for measuring area. More Examples of Calculating Area of Rectangles Area = Length x Width Area = 7 km x 5 km = 35 km2 Area of a Square The length and width of a square are the same so we just need to multiply the length by the length. Area = Length x Length Area = 6 cm x 6 cm = 36 cm2 Area of a Circle The area of a circle = πr2 where r is the radius of the circle and π is the ratio of a circle's circumference to its diameter. π (pronounced "pie" and often written "Pi") is an infinite decimal with a common approximation of 3.14159.

You can find out more about Pi here Example of calculating the area of a circle Area = πr2 Answer rounded to 2 decimal places Explanation of the Area of a Circle Formula Take a circle and divide it into equally sized sectors and rearrange these as shown below. Notice how, as the sectors become smaller, the shape becomes more like a rectangle. Note: There is no limit to how small these sectors could be and to how closely they could resemble a rectangle when arranged. Assuming we know that the circumference of a circle is equal to 2πr we can add dimensions to the "rectangle" as shown below. Using the area of a rectangle area formula, area = width x height we can see how our circle, re-configured as a rectangle, can be shown to have an area that approximates to πr x r or πr2 Circle Sectors Rearranged Circle Sectors Rearranged - Starting to Look Like a Rectangle Area of Compound Shapes There are many cases where the calculation of a total area requires more than one area to be calculated followed by either an addition, subtraction, or some other combination of operations to find the required area.

Note: In the examples below the units of measurement are not shown and answers and the value of π (Pi) have been rounded to the nearest hundredth. Example: Simple Compound Shapes The area calculation example below is relatively simple. The shape can be seen as a triangle combined with a rectangle. Area of triangle part: ½ x (3.14 x 1.52) = 3.53 Total area = 18 - 3.53 = 14.47 Example: Decisions! Combine? Subtract It is common to have more than one way to calculate the final area. In the examples below the shape can be seen as two rectangles combined or as one large rectangle with a smaller rectangle "cut out" from the top right corner. There is no right or wrong method. We can calculate the areas of rectangles a and b and then add to get the area. area = (3 x 6) + (6 x 4) area = 18 + 24 = 42 Or we can calculate an "imaginary" rectangle, c, and subtract rectangle d from it to get the area.

area = (9 x 6) - (6 x 2) area = 54 - 12 = 42 50 Interesting Facts about Pi | FactRetriever.com 50 Interesting Facts about Pi By Karin Lehnardt, Senior Writer Published August 20, 2016 Pi is the most recognized mathematical constant in the world. Scholars often consider Pi the most important and intriguing number in all of mathematics.[5] The symbol for pi (π) has been used regularly in its mathematical sense only for the past 250 years.[3] Scientists in Carl Sagan’s novel Contact are able to unravel enough of pi to find hidden messages from the creators of the human race, allowing humans to access deeper levels of universal awareness.[4] In the Star Trek episode “Wolf in the Fold,” Spock foils the evil computer by commanding it to “compute to last digit the value of pi.”[4] The Great Pyramid at Giza seems to approximate pi Egyptologists and followers of mysticism have been fascinated for centuries by the fact that the Great Pyramid at Giza seems to approximate pi.

The vertical height of the pyramid has the same relationship to the perimeter of its base as the radius of a circle has to its circumference.[4] We can never truly measure the circumference or the area of a circle because we can never truly know the value of pi. Pi is an irrational number, meaning its digits go on forever in a seemingly random sequence.[6] Darren Aronofsky’s fascinating movie π (Pi: Faith in Chaos) shows how the main character’s attempt to find simple answers about pi (and, by extension, the universe) drives him mad. The film won the Directing Award at the 1988 Sundance Film Festival.[9] In the Greek alphabet, π (piwas) is the sixteenth letter. In the English alphabet, p is also the sixteenth letter.[4] The letter π is the first letter of the Greek word “periphery” and “perimeter.” The symbol π in mathematics represents the ratio of a circle’s circumference to its diameter.

In other words, π is the number of times a circle’s diameter will fit around its circumference.[1] If the circumference of the earth were calculated using π rounded to only the ninth decimal place, an error of no more than one quarter of an inch in 25,000 miles would result.[8] In 1995, Hiroyoki Gotu memorized 42,195 places of pi and is considered the current pi champion. Some scholars speculate that Japanese is better suited than other languages for memorizing sequences of numbers.[1] The first 144 digits of pi add up to 666 (which many scholars say is “the mark of the Beast”). And 144 = (6+6) x (6+6).[4] The defense attorney and an FBI agent argued about the value of pi during the O.J. Simpson trial (Vicki L. Miller / Shutterstock.com) During the famed O.J.

Simpson trial, there were arguments between defense attorney Robert Blasier and an FBI agent about the actual value of pi, seemingly to reveal flaws in the FBI agent’s intellectual acumen.[4] A mysterious 2008 crop circle in Britain shows a coded image representing the first 10 digits of pi.[2] Ludolph van Ceulen (1540-1610) spent most of his life calculating the first 36 digits of pi (which were named the Ludolphine Number). According to legend, these numbers were engraved on his now lost tombstone.[3] William Shanks (1812-1882) worked for years by hand to find the first 707 digits of pi.

Unfortunately, he made a mistake after the 527th place and, consequently, the following digits were all wrong.[3] In 2002, a Japanese scientist found 1.24 trillion digits of pi using a powerful computer called the Hitachi SR 8000, breaking all previous records.[5] Pi is the secret code in Alfred Hitchcock’s Torn Curtain and in The Net starring Sandra Bullock.[4] Since there are 360 degrees in a circle and pi is intimately connected with the circle, some mathematicians were delighted to discover that the number 360 is at the 359th digit position of pi.[4] Umberto Eco’s famed book Foucault’s Pendulum associates the mysterious pendulum in the novel with the intrigue of pi.[4] Pi has been studied by the human race for almost 4,000 years. By 2000 B.C., Babylonians established the constant circle ratio as 3-1/8 or 3.125.

The ancient Egyptians arrived at a slightly different value of 3-1/7 or 3.143.[1] One of the earliest known records of pi was written by an Egyptian scribe named Ahmes (c. 1650 B.C.) on what is now known as the Rhind Papyrus. He was off by less than 1% of the modern approximation of pi (3.141592).[12] The Rhind Papyrus (c.

1650 B.C.) was the first attempt to calculate pi by “squaring the circle,” which is to measure the diameter of a circle by building a square inside the circle.[12] The “squaring the circle” method of understanding pi has fascinated mathematicians because traditionally the circle represents the infinite, immeasurable, and even spiritual world while the square represents the manifest, measurable, and comprehensive world.[5] Computing pi is a stress test for a computer—a kind of “digital cardiogram.”[4] Givenchy markets a cologne named Pi A Givenchy men’s cologne named Pi is marketed as highlighting the sexual appeal of intelligent and visionary men.[7] In 1888, a Indiana country doctor named Edwin Goodwin claimed he had been “supernaturally taught” the exact measure of the circle and even had a bill proposed in the Indiana legislature that would copyright his mathematical findings.

The bill never became law thanks to a mathematical professor in the legislature who pointed out that the method resulted in an incorrect value of pi.[4] The first million decimal places of pi consist of 99,959 zeros, 99,758 1s, 100,026 2s, 100,229 3s, 100,230 4s, 100,359 5s, 99,548 6s, 99,800 7s, 99,985 8s, and 100,106 9s.[1] The Bible alludes to pi in 1 Kings 7:23 where it describes the altar inside Solomon’s temple: “And he made a molten sea of ten cubits from brim to brim . . .

and a line of thirty cubits did compass it round about.” Some scholars interpret this to mean that the value of pi is 3.[11] Pi was first rigorously calculated by one of the greatest mathematicians of the ancient world, Archimedes of Syracuse (287-212 B.C.). Archimedes was so engrossed in his work that he did not notice that Roman soldiers had taken the Greek city of Syracuse. When a Roman soldier approached him, he yelled in Greek “Do not touch my circles!” The Roman soldier simply cut off his head and went on his business.[6] A refined value of pi was obtained by the Chinese much earlier than in the West. The Chinese had two advantages over most of the world: they used decimal notations and they used a symbol for zero. European mathematicians would not use a symbolic zero until the late Middle Ages through contact with Indian and Arabic thinkers.[6] Al-Khwarizmi, who lived in Baghdad around A.D. 800, worked on a value of pi calculated to four digits: 3.1416.

The term “algorithm” derives from his name, and his text Kitab al-Jabr wal-Muqabala (The Book of Completion Concerning Calculating by Transposition and Reduction) gives us the word “algebra” (from al-Jabr, which means “completion” or “restoration”).[3] Ancient mathematicians tried to compute pi by inscribing polygons with more and more sides that would more closely approach the area of a circle. Archimedes used a 96-sided polygon. Chinese mathematician Liu Hui inscribed a 192-sided polygon and then a 3,072-sided polygon to calculate pi to 3.14159. Tsu Ch’ung and his son inscribed polygons with as many as 24,576 sides to calculate pi (the result had only an 8-millionth of 1% difference from the now accepted value of pi).[6] Even comedians find value in the number pi Comedian John Evans once quipped: “What do you get if you divide the circumference of a jack-o’-lantern by its diameter?

Pumpkin π.”[4] William Jones (1675-1749) introduced the symbol “π” for pi in 1706, and it was later popularized by Leonhard Euler (1707-1783) in 1737.[3] The π symbol came into standard use in the 1700s, the Arabs invented the decimal system in A.D.

1000, and the equal sign (=) appeared in 1557.[5] Before the π symbol was used, mathematicians would describe pi in round-about ways such as “quantitas, in quam cum multipliectur diameter, proveniet circumferential,” which means “the quantity which, when the diameter is multiplied by it, yields the circumference.”[3] Leonardo da Vinci (1452-1519) and artist Albrecht Durer (1471-1528) both briefly worked on “squaring the circle,” or approximating pi.[4] There are no occurrences of the sequence 123456 in the first million digits of pi—but of the eight 12345s that do occur, three are followed by another 5. The sequence 012345 occurs twice and, in both cases, it is followed by another 5.[7] Some scholars claim that humans are programmed to find patterns in the world because it’s the only way we can give meaning to the world and ourselves.

Hence, the obsessive search to find patterns in π.[5] The father of calculus (meaning “pebble used in counting” from calx or “limestone”), Isaac Newton calculated pi to at least 16 decimal places.[12] Pi is also referred to as the “circular constant,” “Archimedes’ constant,” or “Ludolph’s number.”[4] In the seventeenth century, pi was freed from the circle and applied also to curves, such as arches and hypocycloids, when it was found that their areas could also be expressed in terms of pi. In the twentieth century, pi has been used in many areas, such as number theory, probability, and chaos theory.[1] The first six digits of pi (314159) appear in order at least six times among the first 10 million decimal places of pi.[8] Albert Einstein was born on Pi Day (3/14/1879) ”Pi Day” is celebrated on March 14 (which was chosen because it resembles 3.14).

The official celebration begins at 1:59 p.m., to make an appropriate 3.14159 when combined with the date.

Albert Einstein was born on Pi Day (3/14/1879) in Ulm Wurttemberg, Germany.[4] Thirty-nine decimal places of pi suffice for computing the circumference of a circle girding the known universe with an error no greater than the radius of a hydrogen atom.[8] John Donne’s (1572-1631) poem “Upon the Translations of the Psalms by Sir Philip Sidney, and the Countess of Pembroke, His Sister” condemns attempts to find an exact value of pi, or to “square a circle,” which Donne views as an attempt to rationalize God:[11] Eternal God—for whom who ever dare Seek new expressions, do the circle square, And thrust into straight corners of poor wit Thee, who art cornerless and infinite— - John Donne Many mathematicians claim that it is more correct to say that a circle has an infinite number of corners than to view a circle as being cornerless.[5] Plato (427-348 B.C.) supposedly obtained for his day a fairly accurate value for pi: √2 + √3 = 3.146.[1] A website titled “The Pi-Search

 Page” finds a person’s birthday and other well known numbers in the digits of pi.[10] Pinnable Facts References 1 Arndt, Jörg and Christoph Haenel.

Pi Unleashed. Trans. Catriona and David Lischka. New York, NY: Springer-Verlag Berlin Heidelberg, 2001. python - how to write program for area for circle and square - Stack Overflow how to write program for area for circle and square up vote -2 down vote favorite Write a program that asks the user to enter two values: an integer choice and a real number x. If choice is 1, compute and display the area of a circle of radius x. If choice is 2, compute and display the are of a square with sides of length x. If choice is neither 1, nor 2, will display the text Invalid choice. so im guessing this is broken into 2 parts? all i can think of so far is having a choice(input) function and defining what pi and area and so on are. but i keep getting errors. what am i doing wrong?

choice = input ('Enter Choice:') choice_1 = int (choice) if (choice_1==1): radius = (int) print('Enter x:',radius) pi = 3.14159 area = ( radius ** 2 ) * pi print ( 'The Area is=' , area ) choice_2= (choice) if (choice_2==2): side= (int) print('enter X:' side*side) While you've got the actual calculations right, there are some problems with how you're receiving input. You start out well: choice = input ('Enter Choice:') But then do this: choice_1 = int (choice) That's not wrong, but there's no need for a new variable name. You could just as well do choice = int(choice). You then go on: if (choice_1==1): radius = (int) The if statement is okay (although the parentheses are not necessary), but the body of it is a bit strange. I don't know what you're trying to achieve there, but it's almost certainly not doing what you want. What you'll probably want to do is remove the current body of the if statement and indent a bunch of the following code.

print('Enter x:',radius) This will print out Enter x: followed by radius, which you just set to the int function (probably not what you want. Instead, you probably want to prompt the user and receive their input: radius = input('Enter x: ') And then convert it to a float: radius = float(radius) Back to your code. pi = 3.14159 is valid and correct, but there is no need to assign pi in your own code; just import it from math: from math import pi Then you've got these two lines: area = ( radius ** 2 ) * pi print ( 'The Area is=' , area ) You've got no problem there; those should work fine. Your code continues: choice_2= (choice) This is not useful. Just use choice; you don't need a new variable. if (choice_2==2): side= (int) The if statement, here, too, is correct, but its body, too, is senseless. Again, you probably want to prompt the user to enter something and then convert it to a float.

At the end, you've got: print('enter X:' side*side) First of all, you're missing a comma. Second of all, you're outputting the area after enter X:, which doesn't make that much sense. That said, you did get the calculation right. 1 Telling someone that something "doesn't make much sense" doesn't correct their misunderstanding. It doesn't make sense to you, but I'm fairly certain it made sense to the OP (i.e., if the computer reads the words 'enter x' it means to prompt the user for input--which we both know is incorrect thinking). Explaining why it "doesn't make sense" would be more helpful. – Dave Jarvis Sep 16 '12 at 0:15 up vote 2 down vote There are a number of issues with the code.

Here is a working example of what I believe you want to accomplish: #!/usr/bin/python pi = 3.14159265 choice = input('Enter Choice [1 or 2]:') choice = int (choice) if choice == 1: radius = input('Enter x:') area = ( radius ** 2 ) * pi print 'The Area is=', area if choice == 2: side = input('Enter x:') area = side ** 2 print 'The Area is=', area There are a number of problems with the code you've presented: indentation, variables, inputs, and outputs. There are a number of improvements that can be made as well (such as removing duplicate statements). The code I've given above will accomplish what you want to do. So let's go through the errors to get a deeper understanding. Indentation First, Python programs should be indented properly. This means that lines following a conditional logic (such as an if statement) should be tabbed. The indentation is called a "block" statement. Only those lines that are indented will be evaluated (executed) if the given condition is met (e.g., the user supplied 1 or 2 as a value).

Variables The choice_1 and choice_2 variables are not necessary. Logistically, you want to tell the reader of your source code that the user's input should be rounded to a whole integer. The extra variables are superfluous -- you can reuse the choice variable. Inputs The input function is used to assign the value of whatever the user typed to the variable on the left-hand-side of the expression. Examples: choice = input ('Enter choice:') radius = input( 'Enter x:' ) side = input( 'Enter x:' ) These input statements appear on the screen. The user types in a number and the value of that number is put inside the corresponding variable. Outputs The print statement is used to display a value on the screen. In your code, you had combined a text string ('Enter x') with a print statement. The computer cannot "know" that 'Enter x' means that the user must type in a value. Just like the computer does not know that 'Barney' is the name of a purple dinosaur. up vote 0 down vote A few things. If that is how your script is indented, it's not going to work, period.

Indenting is core to python, and you need to understand that before you'll get anything substantial working. If the input is an integer, it will be automatically converted using input(). You're only asking for input once, so don't both creating two variables. choice = input('Enter choice: ') If should be using an if-elif-else statement here. Use control structures to your advantage: if choice == 1: radius = input('Enter radius: ') print('Area of circle is ', (radius ** 2) * 3.14159) elif choice == 2: side = input('Enter side length: ') print('Areas of square is ', side*side) That's simplified, what you're trying to acheive. Other than that, you shouldn't do side= (int) or radius = (int). You're assigning a type of int to the variable, when you should be getting a value from input. You'll find very quickly that there are no operators that support multiplication of type and type. Fun and interesting facts about Pi 70 facts, take your time! Custom Search 1) Pi is the number of times a circle's diameter will fit around its circumference.

2) Most people would say that a circle has no corners, but it is more accurate to say that it has an infinite number of corners. 3) The sequence of digits in Pi so far passed all known tests for randomness. 4) Here are the first 100 decimal places of Pi 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679 5) The fraction (22 / 7) is a well used number for Pi. It is accurate to 0.04025%.

6) Another fraction used as an approximation to Pi is (355 / 113) which is accurate to 0.00000849% 7) A more accurate fraction of Pi is(104348 / 33215). This is accurate to 0.00000001056%. 8) Pi occurs in hundreds of equations in many sciences including those describing the DNA double helix, a rainbow, ripples spreading from where a raindrop fell into water, superstrings, general relativity, normal distribution, distribution of primes, geometry problems, waves, navigation.... 9) There is no zero in the first 31 digits of Pi. 10) Pi is irrational. An irrational number is a number that cannot be expressed in the form (a / b) where a and b are integers. 11) It is not known if Pi is normal. No one has proved that Pi isn't normal, so people generally assume that it is. 12) Pi is a transcendental number.

(Transcendental means= Not capable of being determined by any combination of a finite number of equations with rational integral coefficients.) 13)In 1991, the Chudnovsky brothers in New York, using their computer, m zero, calculated pi to two billion two hundred sixty million three hundred twenty one thousand three hundred sixty three digits (2, 260, 321, 363). They halted the program that summer. 14) The Babylonians found the first known value for Pi in around 2000BC -They used (25/8). 15) The Bible uses a value of Pi of 3. Here is a verse from I Kings 7,23: And he made a molten sea, ten cubits from one brim to the other: it was round all about, and his height was five cubits: and a line of thirty cubits did compass it about. 16) The first person to use the Greek letter Piwas Welshman William Jones in 1706. He used it as an abbreviation for the periphery of a circle with unit diameter. Euler adopted the symbol and it quickly became a standard notation.

17) The old memory champion was Hideaki Tomoyori, born Sep. 30, 1932. In Yokohama, Japan, Hideaki recited pi from memoryto 40,000 places in 17 hrs. 21 min. including breaks totaling 4 hrs. 15min. on 9-10 of March in 1987 at the Tsukuba University Club House. 18) The Pi memory champion is Hiroyoki Gotu, who memorised an amasing 42,000 digits. 19) The area of a circle is *r2. 19a) The circumference is *d 20) Pi is the 16th letter of the Greek alphabet. 21) Definition of Pi- A transcendental number, approximately 3.14159, represented by the symbol 3, that expresses the ratio of the circumference to the diameter of a circle and appears as a constant in many mathematical expressions. 22) Satan doesn't appear in Pi to quick, the first time 666 appears is at position 2440.

23) Pi can be expressed as a quotient in many combinations--Check this out for size! Numerator (764 digits): 9 occurs 600,017,038 times. This shows NO unusual deviation from expected 'random' behaviour. 47) It is easy to prove that if you have a circle that fits exactly inside a square, then * = 4 x (Area of circle) / (Area of square) 48) Pi does not have to be written in decimal (base 10) notation (3.14159265....). Here it is in binary (base 2) notation: 11.0010010000111111011010101000100010000101101000110000100011010011 You can do lots more stuff with Pi when it is in binary format - like drawing weird pictures of it, or even listening to it.

As Pi has an infinite number of places, it is quite possible that any message you liked could be heard somewhere in Pi. It has even been suggested it contains the VOICE OF GOD. In Carl Sagan's book 'Contact' the places of Pi are found to contain a message from the beings that built the universe. 49) Half the circumference of a circle with radius 1 is exactly Pi. The area inside that circle is also exactly Pi ! 50) It is impossible to 'square the circle'. i.e: You can't draw a square with the same area as a circle using standard / Euclidean straight-edge and compass construction in a finite number of steps. The Greeks were obsessed with trying to do this. 51) Pi is a 'transcendental' number. This means that it is not the solution to any finite polynomial (eg: lots of numbers added in a series) with whole number coefficients. This is why it is impossible to square the circle. 52) In around 200 BC Archimedes found that Pi was between (223/71) and (22/7). His error was no more than 0.008227 %.

He did this by approximating a circle as a 96 sided polygon. 53) The volume of a sphere is 4/3*r3 and its surface area is 4/*r2. 54) The circle is the shape with the least perimeter length to area ratio (for a given shape area). Centuries ago mathematicians were also philosophers. They considered the circle to be the 'perfect' shape because of this. The sphere is the 3D shape with the least surface area to volume ratio (for a given volume) 55) Pi is of course the ratio of a circle's circumference to its diameter. If we bring everything up one dimension to get a '3D value for Pi'...

The ratio of a sphere's surface area to the area of the circle seen if you cut the sphere in half is EXACTLY 4 56) The following are all NEARLY Pi: 101/2 Cube root of 31 666/212 10/* (97 + 9/22)1/4 9/5 + (9/5)1/2 (19 (7)1/2) / 16 1.1 x 1.2 x 1.4 x 1.7 (296/167) 2 57) Kochansky found that Pi is NEARLY a root of the equation 9x4 - 240x2 + 1492 58) Ludolph Van Ceulen (1540 - 1610) spent most of his life working out Pi to 35 decimal places.

Pi is sometimes known as Ludolph's Constant 59) If you approximate the circle with a radius of 1 as a 100 sided polygon, then its area is only accurate to 1 decimal place or 0.0658% 60) At position 763 there are six nines in a row. This is known as the Feynman Point 61) Pi in base Pi is 10 62) All permutations of 3 arbitrary digits appear somewhere in Pi 63) Starting with the conventional 5-by-5 magic square, and then substituting the nth digit of pi for each number n in the square, we obtain a new array of numbers. The sum of the numbers in every column is duplicated by a sum of numbers in every row. 64) Write the letters of the English alphabet, in capitals, clockwise around a circle, and cross-out the letters that have right-left symmetry, A, H, I, M, etc.

The letters that remain group themselves in sets of 3, 1, 4, 1, 6" 65) The sequence 314159 re-appears in the decimal expansion of Pi at place176451. This sequence appears 7 times in the first 10 million places (not including right at the start) 66) If you approximate the circle as a square then the value you get for Pi is about 10% out. It just goes to show that you shouldn't approximate the circle as a square. Well you wouldn't make square wheels would you? 67) 2 Pi in radians form is 360 degrees. Therefore Pi radians is 180 degrees and 1/2 Pi radians is 90 degrees. 68) Pi day is celebrated on March 14 at the Exploratorium in San Francisco (March 14 is 3/14) at 1:59 PST which is 3.14159. 69) All the digits of Pi can never be fully known.

70) Here's a Pi limerick: Three point one four one five nine two Its been around forever - its not new It appears everywhere In here and in there Its irrational I know but its true ! How do you find the square root of Pi? Here is the answer! There is a method called the binary search method that will find the square root of any number N. You'll need a calculator to do this method. The first step is to pick a value you know to be too small the be the square root of Pi. Call this value S (for small guess). The next step is to pick a value you know to be too large to be the square root of Pi. Call this value L (for large value). Then since Pi = 3.14159.... we'll say S = 1, and L = 2. S = 1 L = 2 Then find S^2 and L^2 (S and L squared): S^2 = 1 L^2 = 4 Which of these values is farther away from Pi? S^2 is farther away from Pi then L^2, so replace S with the average of S and L.

Now we have: S = 1.5 L = 2 S^2 = 2.25 L^2 = 4 Replace the small value again since its square is farther away. S = 1.75 L = 2 S^2 = 3.0625 L^2 = 4 Replace the large value now: S = 1.75 L = 1.875 S^2 = 3.0625 L^2 = 3.515625 Replace the large value again: S = 1.75 L = 1.8125 Goes to: S^2 = 3.0625 L^2 = 3.28515625 At which point we know to replace the large value again since its square is farther away then the small value's square. So S = 1.75 L = 1.78125 At this point we know the square root of Pi lies between 1.75 and 1.78125.

Continuing this process we can get finer and finer bounds for the value of the sqaure root of Pi. After a while we will see that the square root of Pi equals 1.77245.... Since Pi is irrational we can never get an exact answer and we have to settle for an approximation. Ancient values for Pi tell the creations of numbers and world Ancient values for Pi Among the eight written mathematical documents that survive from ancient Egypt , only two refer to circles, the Rhind Mathematical Papyrus and the Moscow Mathematical Papyrus, and only the Rhind does so clearly. Five of the 84 example problems in the Rhind deal with the volumes of cylindrical granaries and use a simple rule of thumb for computing the area of the circular base. That rule was easy to use for beginners and apparently close enough for the intended application: take the diameter of the circle, subtract its ninth part, and square the result. Although those problems do not mention any constant nor relate the diameter of a circle to its circumference, translated into modern terms the results from that method amount to a value for pi of 3 1/6 = 3.1667.

This approximation is 0.8% too high compared with the 3.14159... in our pocket calculators, but it is said to be the best that survives in writing from the pre- Hellenic world [1] . Indeed, the corresponding values on several ancient Mesopotamian tablets are even worse. Otto Neugebauer, long one of the leading researchers in the area of premodern science, described in his classic 1957 book ï¿½The Exact Sciences in Antiquityï¿½: ï¿½... only a very crude approximation for the area of a circle is known so far [from Mesopotamia ], corresponding to the use of 3 for p. Several problems concerning circular segments and similar figures are not yet fully understood and it seems to me quite possible that better approximations of p were known and used in cases where the rough approximation would lead to obviously wrong results. (...) After completion of the manuscript, new discoveries were made.

(...) [One still unpublished tablet seems to imply] the approximation p = 3 1/8 [= 3.125], thus confirming finally my expectation that the comparison of the circumference of the regular hexagon with the circumscribed circle must have led to a better approximation of p than 3.ï¿½ [2] The then still unpublished tablet Neugebauer mentioned does not seem to have made it into print quickly because Andrï¿½ Pichot, another prominent scholar in this field, still wrote in 1991: ï¿½The Mesopotamian formulae [for circle area and circumference] used p = 3 which is a rather poor approximation compared with the very accurate value for the square root of 2 [previously presented as correct to one part in almost two million]. (...) The value of p = 3 appears on several tablets which also give the circumference of the circle as six times the radius. This derives without doubt from equating the circumference around a circle of radius r with the circumference of a hexagon having a side length of r which explains also the division of the circle into 360 degrees.

In addition, there is at least one tablet with values for various circle arcs, chords, secants, etc., but it is hard to interpret.ï¿½ [3] The earliest improvement over the value implied in the Rhind Papyrus is currently credited to the Greek Archimedes of Syracuse who lived from about 287 to 212 BCE. He fenced in the range of pi between 3 10/71 and 3 1/7, or 0.024% below and 0.040% above the correct result. The method Archimedes used to achieve this result is simple. He reasoned that the circumference of a regular convex polygon inscribed into a circle is smaller than that of the surrounding circle, and that the sides of any such polygon drawn around the circle must add up to a greater circumference. He could also see that polygons with more sides hugged the circle closer than those with fewer, and that their circumferences came therefore closer to that of the circle between them. Archimedes started with hexagons in and around his circle.

Hexagons are easy to dissect into triangles for computing the lengths of their sides because these sides are all equal, and they yield the crude circumference- to- diameter ratio of 3 we saw above on the Babylonian tablets. Then he doubled the number of polygon sides and calculated the dimensions of the new triangles which now had half the previous center angles, and he repeated this process until he arrived at the polygon pair with 96 sides which gave the above result [4] . This procedure is called the ï¿½method of exhaustionï¿½ because it exhausts the difference between the circumferences of the polygons and that of the circle with its ever closer approximations. The only mathematical tools required for it are the so-called ï¿½Theorem of Pythagorasï¿½, about the sum of the squares over the sides of a right- angled triangle, and the ability to extract square roots. Both these tools were available in the ancient Near East long before Pythagoras. Already the Old Babylonians of king Hammurabiï¿½s time (1792 to 1750 BCE) [5] were familiar with the contents of that theorem.

They may not have explicitly formulated it in modern terms or spelled out its derivation on any of the few surviving tablets, but they used it routinely to solve questions of the type: ï¿½A beam of length 30 stands against a wall. The upper end has slipped down a distance 6. How far did the lower end move?ï¿½ [6] The writers of these questions answered them more than a thousand years before Pythagoras, and the Kahun Papyrus from Middle Kingdom Egypt hints that their contemporaries along the Nile were aware of the relationships in that mis- attributed theorem, too [7] . As to the computing of roots, various ancients regularly solved quadratic and even cubic equations [8] . For instance, a scribe from the First Dynasty of Babylon worked out the square root of two to within 0.000047 per cent of the correct value. Similarly, the Berlin Papyrus from Egyptï¿½s late Middle Kingdom (about 1800 BCE) contains a second degree equation; its author clearly knew how to find square roots although, like Archimedes, he did not describe his method for doing so.

Doubling the number of polygon sides again and again allows anyone with the same basic knowledge to compute the value of pi to any desired accuracy, depending only on that personï¿½s patience and on the amount of time s/he cares to set aside for the repetitive calculations. Archimedes probably had better things to do than to tediously hunt for additional digits of the circle constant that were of no practical or theoretical value whatsoever. Refining pi any further had clearly no ï¿½ Eureka ï¿½ value. Some of Archimedesï¿½ successors, however, continued where he had left off. One of them, Ludolph van Ceulen (1539 to 1610), professor of mathematics and military science at the Dutch of Leyden , spent several decades to nail down the first 35 decimal places of pi and so attached his first name to that ratio for a while in German- speaking countries. Similarly, the Japanese mathematician Takebe (ï¿½ 1722) started with an octagon and subdivided his polygons until they had 1,024 sides. This produced p to 41 decimals.

Such relentless efforts may have given a new meaning to the term ï¿½method of exhaustionï¿½, but they did not develop any new mathematics for these stunts. They all still used the same old approach as Archimedes [9] . Even many thousands of such computing steps would have presented no obstacle to ancient people who consistently piled up many millions of baked bricks or hewn stone blocks for symbolic reasons. If they had any motivation to do so, some determined Egyptian mathematician could easily have computed pi with great precision, greater than in the formula for granary contents from the Rhind Papyrus learnerï¿½s manual, or than in Archimedesï¿½ result. Some well placed number researchers might even have delegated that tedious chore to their otherwise under- occupied assistant priests to give them something useful to do. These, in turn, would have found their task probably more entertaining, despite the endless repetitions, than watching the TV programs available back then. In any case, the booty quantities on Narmer's mace approximate three simple combinations of pi with phi.

The quantities of 120,000 prisoners and 400,000 oxen do not tell us how good the values for these constants known to the mace designer were because these quantities are rounded. However, the total of 1,942,000 items for pi divided by phi shows that the product of his combined errors for both constants was only about 0.02 per cent, or in the same range as Archimedesï¿½ error for pi alone. Continue reading about early mathematics , and why these constants on Narmer's mace are less of an anachronism than some academics declare them to be, or return directly to that mace and examine the astronomical constants embedded in its ratios. Constants | Storing Information: Variables and Constants in C | InformIT Storing Information: Variables and Constants in C Learn More Buy Constants Like a variable, a constant is a data storage location used by your program. Unlike a variable, the value stored in a constant can't be changed during program execution.

C has two types of constants, each with its own specific uses: Literal Constants Symbolic Constants Literal Constants A literal constant is a value that is typed directly into the source code wherever it is needed. Here are two examples: int count = 20; float tax_rate = 0.28; The 20 and the 0.28 are literal constants. The preceding statements store these values in the variables count and tax_rate. Note that one of these constants contains a decimal point, whereas the other does not. The presence or absence of the decimal point distinguishes floating-point constants from integer constants. A literal constant written with a decimal point is a floating-point constant and is represented by the C compiler as a double-precision number. Floating-point constants can be written in standard decimal notation, as shown in these examples: 123.456 0.019 100. Note that the third constant, 100., is written with a decimal point even though it's an integer (that is, it has no fractional part). The decimal point causes the C compiler to treat the constant as a double-precision value. Without the decimal point, it is treated as an integer constant.

Floating-point constants also can be written in scientific notation. You might recall from high school math that scientific notation represents a number as a decimal part multiplied by 10 to a positive or negative power. Scientific notation is particularly useful for representing extremely large and extremely small values. In C, scientific notation is written as a decimal number followed immediately by an E or e and the exponent: 1.23E2 4.08 times 10 to the 6th power, or 4,080,000 0.85e4 0.85 times 10 to the 4th power, or 0.000085 A constant written without a decimal point is represented by the compiler as an integer number. Integer constants can be written in three different notations: A constant starting with any digit other than 0 is interpreted as a decimal integer (that is, the standard base-10 number system). Decimal constants can contain the digits 0 through 9 and a leading minus or plus sign.

(Without a leading minus or plus, a constant is assumed to be positive.) A constant starting with the digit 0 is interpreted as an octal integer (the base-8 number system). Octal constants can contain the digits 0 through 7 and a leading minus or plus sign. A constant starting with 0x or 0X is interpreted as a hexadecimal constant (the base-16 number system). Hexadecimal constants can contain the digits 0 through 9, the letters A through F, and a leading minus or plus sign. NOTE See Appendix C, "Working with Binary and Hexadecimal Numbers," for a more complete explanation of decimal and hexadecimal notation. Symbolic Constants A symbolic constant is a constant that is represented by a name (symbol) in your program. Like a literal constant, a symbolic constant can't change. Whenever you need the constant's value in your program, you use its name as you would use a variable name. The actual value of the symbolic constant needs to be entered only once, when it is first defined. Symbolic constants have two significant advantages over literal constants, as the following example shows. Suppose that you're writing a program that performs a variety of geometrical calculations. The program frequently needs the value ?

(3.14) for its calculations. (You might recall from geometry class that ? is the ratio of a circle's circumference to its diameter.) For example, to calculate the circumference and area of a circle with a known radius, you could write circumference = 3.14 * (2 * radius); area = 3.14 * (radius)*(radius); The asterisk (*) is C's multiplication operator and is covered on Day 4. Thus, the first of these statements means "Multiply 2 times the value stored in the variable radius, and then multiply the result by 3.14. Finally, assign the result to the variable named circumference." If, however, you define a symbolic constant with the name PI and the value 3.14, you could write circumference = PI * (2 * radius); area = PI * (radius)*(radius); The resulting code is clearer. Rather than puzzling over what the value 3.14 is for, you can see immediately that the constant PI is being used. The second advantage of symbolic constants becomes apparent when you need to change a constant.

Continuing with the preceding example, you might decide that for greater accuracy your program needs to use a value of PI with more decimal places: 3.14159 rather than 3.14. If you had used literal constants for PI, you would have to go through your source code and change each occurrence of the value from 3.14 to 3.14159. With a symbolic constant, you need to make a change only in the place where the constant is defined. The rest of your code would not need to be changed. Defining Symbolic Constants C has two methods for defining a symbolic constant: the #define directive and the const keyword. The #define directive is used as follows: #define CONSTNAME literal This creates a constant named CONSTNAME with the value of literal. literal represents a literal constant, as described earlier. CONSTNAME follows the same rules described earlier for variable names. By convention, the names of symbolic constants are uppercase. This makes them easy to distinguish from variable names, which by convention are lowercase.

For the previous example, the required #define directive for a constant called PI would be #define PI 3.14159 Note that #define lines don't end with a semicolon (;). #defines can be placed anywhere in your source code, but the defined constant is in effect only for the portions of the source code that follow the #define directive. Most commonly, programmers group all #defines together, near the beginning of the file and before the start of the main() function. How a #define Works The precise action of the #define directive is to instruct the compiler as follows: "In the source code, replace CONSTNAME with literal." The effect is exactly the same as if you had used your editor to go through the source code and make the changes manually. Note that #define doesn't replace instances of its target that occur as parts of longer names, within double quotes, or as part of a program comment. For example, in the following code, the instances of PI in the second and third lines would not get changed: #define PI 3.14159 /* You have defined a constant for PI.

*/ #define PIPETTE 100 NOTE The #define directive is one of C's preprocessor directives, and it is discussed more fully on Day 21, "Advanced Compiler Use." Defining Constants with the const Keyword The second way to define a symbolic constant is with the const keyword. const is a modifier that can be applied to any variable declaration. A variable declared to be const can't be modified when the program is executed. A value is initialized at the time of declaration and is then prohibited from being changed. Here are some examples: const int count = 100; const float pi = 3.14159; const long debt = 12000000, float tax_rate = 0.21; const affects all variables on the declaration line. In the last line, debt and tax_rate are symbolic constants. As a side note, you should notice that in this example, debt was declared as a long and tax_rate was declared as a float. If your program tries to modify a const variable, the compiler generates an error message. The following code would generate an error: const int count = 100; count = 200; /* Does not compile!

Cannot reassign or alter */ /* the value of a constant. */ What are the practical differences between symbolic constants created with the #define directive and those created with the const keyword? The differences have to do with pointers and variable scope. Pointers and variable scope are two very important aspects of C programming, and you will learn about them on Day 9, "Understanding Pointers," and Day 12. Now take a look at a program that demonstrates variable declarations and the use of literal and symbolic constants. Listing 3.2 prompts the you to enter your weight and year of birth. It then calculates and displays the your weight in grams and your age in the year 2010. You can enter, compile, and run this program using the procedures explained on Day 1, "Getting Started with C." NOTE Most C programmers today use const instead of #define when declaring constants.

Listing 3.2 const.cA program that demonstrates the use of variables and constants 1: /* Demonstrates variables and constants */ 2: #include <stdio.h> 3: 4: /* Define a constant to convert from pounds to grams */ 5: #define GRAMS_PER_POUND 454 6: 7: /* Define a constant for the start of the next century */ 8: const int TARGET_YEAR = 2010; 9: 10: /* Declare the needed variables */ 11: long weight_in_grams, weight_in_pounds; 12 int year_of_birth, age_in_2010; 13: 14: int main( void ) 15: { 16: /* Input data from user */ 17: 18: printf("Enter your weight in pounds: "); 19: scanf("%d", &weight_in_pounds); 20: printf("Enter your year of birth: "); 21: scanf("%d", &year_of_birth); 22: 23: /* Perform conversions */ 24: 25: weight_in_grams = weight

_in_pounds * GRAMS_PER_POUND; 26: age_in_2010 = TARGET_YEAR - year_of_birth; 27: 28: /* Display results on the screen */ 29: 30: printf("\nYour weight in grams = %ld", weight_in_grams); 31: printf("\nIn 2010 you will be %d years old\n", age_in_2010); 32: 33: return 0; 34: } Enter your weight in pounds: 175 Enter your year of birth: 1965 Your weight in grams = 79450 In 2010 you will be 45 years old This program declares the two types of symbolic constants in lines 5 and 8.

In line 5, a constant is used to make the value 454 more understandable. Because it uses GRAMS_PER_POUND, line 25 is easy to understand. Lines 11 and 12 declare the variables used in the program. Notice the use of descriptive names such as weight_in_grams. You can tell what this variable is used for. Lines 18 and 20 print prompts on-screen. The printf() function is covered in greater detail later. To allow the user to respond to the prompts, lines 19 and 21 use another library function, scanf(), which is covered later. scanf() gets information from the screen. For now, accept that this works as shown in the listing. Later, you will learn exactly how it works. Lines 25 and 26 calculate the user's weight in grams and his or her age in the year 2010. These statements and others are covered in detail in tomorrow's chapter. To finish the program, lines 30 and 31 display the results for the user. DO use constants to make your programs easier to read. DON'T try to assign a value to a constant after it has already been initialized.

Question: The number followed by .14159, fully known as pi, used to calculate the circumference and area of a circle?
Answer: 3