import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double sum = 0;
        for(int i = n; i > 0; i--) {
            int count = 0;
            int num = i;
            while(num < k) {
                num *= 2;
                count++;
            }
            double temp = 1;
            for(int j = 0; j < count; j++) {
                temp *= (0.5);
            }
            sum += temp;
        }
        double extra = 0;
        if(n > k) extra += (k/n);
        System.out.println(sum / n + extra);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double sum = 0;
        for(int i = n; i > 0; i--) {
            int count = 0;
            int num = i;
            while(num < k) {
                num *= 2;
                count++;
            }
            double temp = 1;
            for(int j = 0; j < count; j++) {
                temp *= (0.5);
            }
            sum += temp;
        }
        double extra = 0;
        if(n > k) extra += (k/n);
        System.out.println(sum / n + extra);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double sum = 0;
        for(int i = n; i > 0; i--) {
            int count = 0;
            int num = i;
            while(num < k) {
                num *= 2;
                count++;
            }
            double temp = 1;
            for(int j = 0; j < count; j++) {
                temp *= (0.5);
            }
            sum += temp;
        }
        double extra = 0;
        if(n > k) extra += (k/n);
        System.out.println(sum / n + extra);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double sum = 0;
        for(int i = n; i > 0; i--) {
            int count = 0;
            int num = i;
            while(num < k) {
                num *= 2;
                count++;
            }
            double temp = 1;
            for(int j = 0; j < count; j++) {
                temp *= (0.5);
            }
            sum += temp;
        }
        double extra = 0;
        if(n > k) extra += (k/n);
        System.out.println(sum / n + extra);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc double sum = 0; sum 0 for(int i = n; i > 0; i--) {
            int count = 0;
            int num = i;
            while(num < k) {
                num *= 2;
                count++;
            }
            double temp = 1;
            for(int j = 0; j < count; j++) {
                temp *= (0.5);
            }
            sum += temp;
        } int i = n; int i = n; i n i > 0 i 0 i-- i-- i {
            int count = 0;
            int num = i;
            while(num < k) {
                num *= 2;
                count++;
            }
            double temp = 1;
            for(int j = 0; j < count; j++) {
                temp *= (0.5);
            }
            sum += temp;
        } {
            int count = 0;
            int num = i;
            while(num < k) {
                num *= 2;
                count++;
            }
            double temp = 1;
            for(int j = 0; j < count; j++) {
                temp *= (0.5);
            }
            sum += temp;
        } int count = 0; count 0 int num = i; num i while(num < k) {
                num *= 2;
                count++;
            } num < k num k {
                num *= 2;
                count++;
            } num *= 2 num 2 count++ count double temp = 1; temp 1 for(int j = 0; j < count; j++) {
                temp *= (0.5);
            } int j = 0; int j = 0; j 0 j < count j count j++ j++ j {
                temp *= (0.5);
            } {
                temp *= (0.5);
            } temp *= (0.5) temp (0.5) sum += temp sum temp double extra = 0; extra 0 if(n > k) extra += (k/n); n > k n k extra += (k/n) extra (k/n) k n System.out.println(sum / n + extra) System.out.println System.out System System.out sum / n + extra sum / n sum n extra String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double sum = 0;
        for(int i = n; i > 0; i--) {
            int count = 0;
            int num = i;
            while(num < k) {
                num *= 2;
                count++;
            }
            double temp = 1;
            for(int j = 0; j < count; j++) {
                temp *= (0.5);
            }
            sum += temp;
        }
        double extra = 0;
        if(n > k) extra += (k/n);
        System.out.println(sum / n + extra);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double sum = 0;
        for(int i = n; i > 0; i--) {
            int count = 0;
            int num = i;
            while(num < k) {
                num *= 2;
                count++;
            }
            double temp = 1;
            for(int j = 0; j < count; j++) {
                temp *= (0.5);
            }
            sum += temp;
        }
        double extra = 0;
        if(n > k) extra += (k/n);
        System.out.println(sum / n + extra);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        double sum = 0;
        for(int i = n; i > 0; i--) {
            int count = 0;
            int num = i;
            while(num < k) {
                num *= 2;
                count++;
            }
            double temp = 1;
            for(int j = 0; j < count; j++) {
                temp *= (0.5);
            }
            sum += temp;
        }
        double extra = 0;
        if(n > k) extra += (k/n);
        System.out.println(sum / n + extra);
    }
}
