double[] asswght(int R[], int RMax, int s) {
        double P[] = new double[s];
        double sum = 0;
        for (int i = 0; i < R.length; i++) {
            sum += R[i];
        }
        for (int i = 0; i < s; i++) {
            P[i] = (RMax - R[i] + 1) / ((double) (RMax + 1) * s - sum);
        }
        return P;
    }