import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String[] line = stdin.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int k = Integer.parseInt(line[1]);
        
        double sum = 0;
        for (int dice = 1; dice <= n; dice++) {
            int i = dice;
            int c = 1;
            while (i < k) {
                c *= 2;
                i *= 2;
            }
            sum += 1.0d / (n * c);
        }
        
        System.out.println(sum);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String[] line = stdin.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int k = Integer.parseInt(line[1]);
        
        double sum = 0;
        for (int dice = 1; dice <= n; dice++) {
            int i = dice;
            int c = 1;
            while (i < k) {
                c *= 2;
                i *= 2;
            }
            sum += 1.0d / (n * c);
        }
        
        System.out.println(sum);
    }
} Main public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String[] line = stdin.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int k = Integer.parseInt(line[1]);
        
        double sum = 0;
        for (int dice = 1; dice <= n; dice++) {
            int i = dice;
            int c = 1;
            while (i < k) {
                c *= 2;
                i *= 2;
            }
            sum += 1.0d / (n * c);
        }
        
        System.out.println(sum);
    } main {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String[] line = stdin.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int k = Integer.parseInt(line[1]);
        
        double sum = 0;
        for (int dice = 1; dice <= n; dice++) {
            int i = dice;
            int c = 1;
            while (i < k) {
                c *= 2;
                i *= 2;
            }
            sum += 1.0d / (n * c);
        }
        
        System.out.println(sum);
    } BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); stdin new BufferedReader(new InputStreamReader(System.in)) String[] line = stdin.readLine().split(" "); line stdin.readLine().split(" ") stdin.readLine().split stdin.readLine() stdin.readLine stdin " " int n = Integer.parseInt(line[0]); n Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 int k = Integer.parseInt(line[1]); k Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 double sum = 0; sum 0 for (int dice = 1; dice <= n; dice++) {
            int i = dice;
            int c = 1;
            while (i < k) {
                c *= 2;
                i *= 2;
            }
            sum += 1.0d / (n * c);
        } int dice = 1; int dice = 1; dice 1 dice <= n dice n dice++ dice++ dice {
            int i = dice;
            int c = 1;
            while (i < k) {
                c *= 2;
                i *= 2;
            }
            sum += 1.0d / (n * c);
        } {
            int i = dice;
            int c = 1;
            while (i < k) {
                c *= 2;
                i *= 2;
            }
            sum += 1.0d / (n * c);
        } int i = dice; i dice int c = 1; c 1 while (i < k) {
                c *= 2;
                i *= 2;
            } i < k i k {
                c *= 2;
                i *= 2;
            } c *= 2 c 2 i *= 2 i 2 sum += 1.0d / (n * c) sum 1.0d / (n * c) 1.0d (n * c) n c System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String[] line = stdin.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int k = Integer.parseInt(line[1]);
        
        double sum = 0;
        for (int dice = 1; dice <= n; dice++) {
            int i = dice;
            int c = 1;
            while (i < k) {
                c *= 2;
                i *= 2;
            }
            sum += 1.0d / (n * c);
        }
        
        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String[] line = stdin.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int k = Integer.parseInt(line[1]);
        
        double sum = 0;
        for (int dice = 1; dice <= n; dice++) {
            int i = dice;
            int c = 1;
            while (i < k) {
                c *= 2;
                i *= 2;
            }
            sum += 1.0d / (n * c);
        }
        
        System.out.println(sum);
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String[] line = stdin.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int k = Integer.parseInt(line[1]);
        
        double sum = 0;
        for (int dice = 1; dice <= n; dice++) {
            int i = dice;
            int c = 1;
            while (i < k) {
                c *= 2;
                i *= 2;
            }
            sum += 1.0d / (n * c);
        }
        
        System.out.println(sum);
    }
}
