boooeee
Dart Fener
- Joined
- Aug 14, 2002
- Messages
- 2,671
1. For each positive integer, calculate the number of ways it can be expressed as the sum of the square of any two integers. Denote the number of ways for a given number n to be P
. You can use positive or negative integers in the sum. And, the order of the sum matters. In other words, 1^2 + 2^ 2 and 2^2 + 1^2 should be counted as two ways of expressing 5. Here are the first few examples:
1 = 1^2 + 0^2
1 = 0^2 + 1^2
1 = (-1)^2 + 0^2
1 = 0^2 + (-1)^2
2 = 1^2 + 1^2
2 = (-1)^2 + 1^2
2 = 1^2 + (-1)^2
2 = (-1)^2 + (-1)^2
There are no ways of expressing 3 as the sum of two squared integers.
So, P(1) = 4, P(2) = 4, and P(3) = 0. Continue this process for each number and calculate the average of P
. For example, the average for the first three numbers is ( 4 + 4 + 0 ) / 3 = 2.666666….
As you add more and more numbers to your list, this average approaches Pi. In other words ( P(1) + P(2) + …. + P(N))/N approaches Pi as N approaches infinity.
2. Select two positive integers at random. If the two integers contain a common divisor, assign a value of 0 to this trial. If they do not contain a common divisor, assign a value of 1 to this trial. Repeat this process multiple times for new pairs of randomly selected positive integers. After N trials, add up the number of trials in which the two random numbers did not have a common divisor. Call this number m. Divide N by m. Multiply N/m by 6 and take the square root. As N approaches infinity, this number, (6N/m)^(1/2), approaches Pi. Another way of saying this is that the chances of any two random integers not containing a common divisor is 6/(Pi^2)
Who knows other horribly inefficient ways of approximating Pi?
1 = 1^2 + 0^2
1 = 0^2 + 1^2
1 = (-1)^2 + 0^2
1 = 0^2 + (-1)^2
2 = 1^2 + 1^2
2 = (-1)^2 + 1^2
2 = 1^2 + (-1)^2
2 = (-1)^2 + (-1)^2
There are no ways of expressing 3 as the sum of two squared integers.
So, P(1) = 4, P(2) = 4, and P(3) = 0. Continue this process for each number and calculate the average of P
As you add more and more numbers to your list, this average approaches Pi. In other words ( P(1) + P(2) + …. + P(N))/N approaches Pi as N approaches infinity.
2. Select two positive integers at random. If the two integers contain a common divisor, assign a value of 0 to this trial. If they do not contain a common divisor, assign a value of 1 to this trial. Repeat this process multiple times for new pairs of randomly selected positive integers. After N trials, add up the number of trials in which the two random numbers did not have a common divisor. Call this number m. Divide N by m. Multiply N/m by 6 and take the square root. As N approaches infinity, this number, (6N/m)^(1/2), approaches Pi. Another way of saying this is that the chances of any two random integers not containing a common divisor is 6/(Pi^2)
Who knows other horribly inefficient ways of approximating Pi?