[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Report] Adjusted Legitimate Go Game Space
At 05:03 PM 4/30/99 -0700, Mousheng Xu wrote:
>Dear All,
>zillion (10^9) universes. Hey, go for it. :)
Sorry, "zillion" should be "billion".
As an apology, the jave source code is attached below.
______________________________________________________________
import java.math.*;
import java.io.*;
import java.util.*;
public class GoSpace {
GoSpace() {
}
//t: number of stones on board
public static double illegitimatePercentage(int t, int boardSize) {
//hill = log(p/(1-p))
double hill = 4.4 * t / boardSize + 0.0075 * t - 3.2;
double power = Math.pow(10, hill);
double result = power/(1 + power);
// System.out.println("illegitimate%: t = " + t + " result = " +
result);
return result;
}
//x: num of stones on board
public static double numOfConfigs(int x, int boardSize) {
double result = Calc.composition(boardSize, x) * Math.pow(2, x);
// System.out.println("numOfConfigs: x = " + x + " result = " +
result);
return result;
}
//x: num of stones on board
public static double legitimateConfigs(int x, int boardSize) {
double result = GoSpace.numOfConfigs(x, boardSize) *
(1 - GoSpace.illegitimatePercentage(x, boardSize));
// System.out.println("legitimateConfigs: x = " + x + " result = " +
result);
return result;
}
public static void main(String args[]) {
for(int size = 2; size <= 19; size++) {
double sum = 0;
for(int i = 0; i <= size * size; i++) {
sum += GoSpace.legitimateConfigs(i, size*size);
}
double originalSum = Math.pow(3, size * size);
System.out.println(size + "\t" + sum + "\t" +
originalSum + "\t" + sum/originalSum);
}
}
}
________________________________________
Mousheng Xu
Associate Computational Scientist
Chiroscience R & D
1725 220th SE
Bothell, WA 98021
Phone: (425)489-8034
Fax: (425)415-8250