Jump to content

Unit circle/Circle length/Bisection/Program/Exercise

From Wikiversity

We consider the unit circle, i.e.

{(xy)x2+y2=1}2.

We put P0=(10) and P1=(01), and we define recursively the sequence Pn (in the plane) by

Qn=12(P0+Pn1)

(that is, Qn is the bisection point of the line segment between P0 and Pn1), and Pn is the intersection point of the half-line through (00) and Qn and the circle. We consider the lengths dn=d(P0,Pn) as an approximation for the length of the circle arc between P0 and Pn, and therefore

xn=2ndn

is an approximation for the length of the half circle arc (that is, π). Since in the computation of the points Pn and the lengths dn, square roots occure (due to the Pythagorean theorem), we can approximate these by rational numbers only with certain errors.

Write a computer-program (in pseudocode), which computes and prints a sequence yn of approximations (n1) for xn. In the computation of yn, all square roots, which are used in the computation of xn, shall be computed with n steps of Heron's method, starting with the initial value 1. Also, the program shall use better and better approximations for the auxiliary points, the computation of yn requires that better and better approximations for P2,,Pn are determined.

    • The computer has as many memory units as needed, which can contain rational numbers.
    • The natural numbers are provided in a data base (they do not have to be computed).
    • It can write the content of a memory unit into another memory unit.
    • It can do the arithmetic operations (addition, subtraction, multiplication, division by a number 0) on rational numbers and write the result in another memory unit.
    • It can compare the content of memory units and can, depending on the outcome, switch to a certain program line.
    • It can print contents of memory units and it can print given texts.

The program shall run to infinity and write down the approximations y1,y2,y3,....