import java.util.*; import java.io.*; public class AnalyseSat { private static double log2(double x){ return Math.log(x)/Math.log(2.0); } private static double psat(int k){return 1.0 - 1.0/Math.pow(2.0,(double)k);} // // probability a clause of length k is satisfied // private static double entropy(int k,int l){ double p = psat(k); return (double)l * p * log2(p) * -1.0; } public static void main(String[] args) { int n = Integer.parseInt(args[0]); // boolean variables int k = Integer.parseInt(args[1]); // literals in a clause int lLo = Integer.parseInt(args[2]); // smallest number of clauses int lHi = Integer.parseInt(args[3]); // largest number of clauses for (int l=lLo;l<=lHi;l++) System.out.println(l +" "+ k +" "+ entropy(k,l)); } }