Tends to infinity

Only maths… nothing else

  • April 2024
    M T W T F S S
    1234567
    891011121314
    15161718192021
    22232425262728
    2930  
  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 8 other subscribers
  • you are

    • 1,290 th visitors on this page

Archive for the ‘Probability’ Category

How you can determine a value of pi,the mathematical wonder.

Posted by tendstoinfinity on January 23, 2011

“PI” is one of the beauty mathematics has given the world. can you find the value of this mathematics marvel.
first I am giving a simple sentence which will help you to memorize the value of \pi to13 places of decimal. Simply you have to count the number of letters in the following sentence.
Why I want 2 learn calculate pi, for I have a large spherical shape
\pi = 3.1415923141595
But have you ever thought how we can calculate the value?

We want to find the area of a circular region of radius 1cm. Obviously we can easily find it out by the formula

“Area of the circular region =\pi.r^{2} “so the area of our region will be \pi

Now can we use a little bit of “probability theory” and the above to determine the value \pi.

Suppose we throw a tiny particle in square of side 2 units in which a circle of radius 1 unit is inscribed(see the fig. below) What is the probability that the particle will fall inside the circle, it is supposed that falling of the stone at every point of square is equally likely.

Required probability = area of circular region/area of square region

=\dfrac{\pi}{4}

Suppose the stone falls 75 times  in the circular space and 25 times in the empty space in hundred throws. So by definition of probability will be \dfrac{75}{100}. These two values should be equal.

i.e \dfrac{75}{100}\dfrac{\pi}{4}

We can calculate the value for \pi from this. Surely the value will be more accurate if we throw the stone a great number of times. Obviously the experiment will take a lot of time. So we want to speed it up. we construct a mathematical model of the above experiment. considering a quadrant of the circle (you can use b’coz circle is symmetric) we will have the same effect. so we are taking only the 1st quadrant of  \Re^{2}. let the stone falls on an arbitrary point P(x,y) in the the part of the square in 1st quadrant,surely 0\leq x\leq1 and 0\leq y\leq1. If  x^{2}+y^{2}\leq1 then the point will be inside the quadrant of circle otherwise exterior to the circle.

this is the mathematical model of the experiment. Now instead of performing the actual experiment we can calculate the results of the experiments directly using pen and paper, all we need a set of random numbers between 0 and 1. but it is very tough to calculate all these manually. instead use a computer programme. you can use any computer programming language. I have used the C programming language. copy the following and compile and run in any C compiler.

C programme for calculate the pi

#include<stdio.h>

#include<conio.h>

#include<stdlib.h>

double pi()

{

long int z;

double x,y,P,N,n=0,b=0,a;

printf(“How many times you want to throw?\n”);

scanf(“%ld”,&z);

for(N=1;N<=z;N++)

{

x=rand();

x=x/32767.0;

y=rand();

y=y/32767.0;

a=(x*x)+(y*y);

if(a>1)

b=b+1;

else

n=n+1;

}

N=N-1;

P=(n/N)*4;

return P;

}

void main()

{

double p;

clrscr();

p=pi();

printf(“\n Value of pi is %lf”,p);

getch();

}

you can throw as many times as you wish. hope this is working on your machine. Good day.

Posted in Probability | Leave a Comment »