Oktay Mercimek, EMAT 6690

 

Estimating PI Number Using Excel (Version 2)

In this Write-up I will try to find an estimate for Pi value using Excel.

We all heard that pi is a number that is approximately 3.14... but we didn't learn how to find it.

We know area of the circle is Therefore .

When we draw the circle, we know the radius of the circle. We usually calculate area assuming we know the pi value.

What if we don't know it?

To find the Pi value, we will construct very simple Excel file.

Assume we have a circle with radius r and centered at (0,0) then we know that x-axis and y-axis divides circle into 4 equal area.

Therefore finding area of the quarter part of the circle will be enough to estimate area of all circle.

Assume that we divided the blue segment into K piece of equal parts. Then every part have length.

Then points on the x-axis are .

Assume that we found points on the quarter circle with these x coordinates.

We can easily create these X values on the excel. For this option we need an r value, How many partition (K) we want is also a problem.

for my example I will choose r=100 and K=10000.

I entered "100" to B1 cell and "10000" to B2 in my excel file then "=B1/B2" to cell B4, which will be our w value.

we know is 0 , then I entered "0" to cell D1, is w, then D2 is B$4, is 2w then D3 is "=D2+B$4".  then we can copy this cell down until D10000. CircleAdvanced1.xls.

b values are easy to find after we create a values. We know that for every point (a,b) that is on the circle, . Then .

Therefore .

Then and so on.

We can create this formula by SQRT function in the Excel. Enter "=SQRT(B$1^2-D1^2)" to E1 and copy it down until E10000. CircleAdvanced2.xls.

We created both a and b values on he circle, We need to find a way to calculate the area of the circle. First way that comes to my mind is creating trapezoids using these points. this will result in situation like this

All of them have same thickness which is . For first trapezoid area is , second one is   and so on.

Therefore we can find areas of these trapezoids in the F column by entering "=(E1+E2)/2*B$4" to F1. Then we can copy it until F10000.

When you copy it to the cell F10000, it becomes "=(E10000+E10001)/2*B$4" , but we don't have E10001 value. In fact E10001 cell must be 0 because the point . Then we can enter "0" to E10001.

After we find the areas in F column we can take the sum of these values by entering "=SUM(F1:F10000)" to cell F10003.

The value in F10003 will be area of quarter circle. So entering "4*F10003" to F10004 gives us the area of whole circle.

Now we can apply our idea that by entering "=F10004/(B1^2)" to cell F 10006.

My version of Excel gives 3.141591478 and this value is true up to 3.14159. CircleAdvanced3.xls.

Turn Back to Main Page.

 

Key words:

Estimate,  pi, excel