package arr; import java.util.Arrays; import java.util.Random; public class F { public static Random rng = new Random(); public static void randomise(double probs[]) { randomise(probs, true); } public static void randomise(double probs[], boolean normalise) { double z = 0; for (int i = 0; i < probs.length; ++i) { probs[i] = 1e2 + rng.nextDouble(); if (normalise) z += probs[i]; } if (normalise) for (int i = 0; i < probs.length; ++i) probs[i] /= z; } public static void uniform(double probs[]) { for (int i = 0; i < probs.length; ++i) probs[i] = 1.0 / probs.length; } public static void l1normalize(double [] a){ double sum=0; for(int i=0;i m) { m = probs[i]; mi = i; } } return mi; } }