import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);


        int N = sc.nextInt();
        int K = sc.nextInt();

        System.out.println(solve(N, K));
    }

    public static double solve(int N, int K) {
        double sum = 0;
        double prob = (double)1/N;

        for (int i=1; i<=N; i++) {
            if (i>= K) {
                sum += 1;
                continue;
            }

            sum += Math.pow(0.5, count2(K, i));
        }

        return sum * prob;
   }

   private static int count(int K, int n) {
        int count = (int)Math.ceil((Math.log(K) - Math.log(n)) / Math.log(2.0));
        if (count <= 0) {
            count = 1;
        }

        return count;
   }
   
   private static int count2(int K, int n) {
        for (int i=0;;i++) {
            if (n >= K) return i;
            
            n *= 2;
       }
   }
} import java.util.Scanner; Scanner 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();

        System.out.println(solve(N, K));
    }

    public static double solve(int N, int K) {
        double sum = 0;
        double prob = (double)1/N;

        for (int i=1; i<=N; i++) {
            if (i>= K) {
                sum += 1;
                continue;
            }

            sum += Math.pow(0.5, count2(K, i));
        }

        return sum * prob;
   }

   private static int count(int K, int n) {
        int count = (int)Math.ceil((Math.log(K) - Math.log(n)) / Math.log(2.0));
        if (count <= 0) {
            count = 1;
        }

        return count;
   }
   
   private static int count2(int K, int n) {
        for (int i=0;;i++) {
            if (n >= K) return i;
            
            n *= 2;
       }
   }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);


        int N = sc.nextInt();
        int K = sc.nextInt();

        System.out.println(solve(N, K));
    } main {
        Scanner sc = new Scanner(System.in);


        int N = sc.nextInt();
        int K = sc.nextInt();

        System.out.println(solve(N, K));
    } 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 System.out.println(solve(N, K)) System.out.println System.out System System.out solve(N, K) solve N K String[] args args public static double solve(int N, int K) {
        double sum = 0;
        double prob = (double)1/N;

        for (int i=1; i<=N; i++) {
            if (i>= K) {
                sum += 1;
                continue;
            }

            sum += Math.pow(0.5, count2(K, i));
        }

        return sum * prob;
   } solve {
        double sum = 0;
        double prob = (double)1/N;

        for (int i=1; i<=N; i++) {
            if (i>= K) {
                sum += 1;
                continue;
            }

            sum += Math.pow(0.5, count2(K, i));
        }

        return sum * prob;
   } double sum = 0; sum 0 double prob = (double)1/N; prob (double)1/N (double)1 N for (int i=1; i<=N; i++) {
            if (i>= K) {
                sum += 1;
                continue;
            }

            sum += Math.pow(0.5, count2(K, i));
        } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
            if (i>= K) {
                sum += 1;
                continue;
            }

            sum += Math.pow(0.5, count2(K, i));
        } {
            if (i>= K) {
                sum += 1;
                continue;
            }

            sum += Math.pow(0.5, count2(K, i));
        } if (i>= K) {
                sum += 1;
                continue;
            } i>= K i K {
                sum += 1;
                continue;
            } sum += 1 sum 1 continue; sum += Math.pow(0.5, count2(K, i)) sum Math.pow(0.5, count2(K, i)) Math.pow Math 0.5 count2(K, i) count2 K i return sum * prob; sum * prob sum prob int N N int K K private static int count(int K, int n) {
        int count = (int)Math.ceil((Math.log(K) - Math.log(n)) / Math.log(2.0));
        if (count <= 0) {
            count = 1;
        }

        return count;
   } count {
        int count = (int)Math.ceil((Math.log(K) - Math.log(n)) / Math.log(2.0));
        if (count <= 0) {
            count = 1;
        }

        return count;
   } int count = (int)Math.ceil((Math.log(K) - Math.log(n)) / Math.log(2.0)); count (int)Math.ceil((Math.log(K) - Math.log(n)) / Math.log(2.0)) Math.ceil Math (Math.log(K) - Math.log(n)) / Math.log(2.0) (Math.log(K) - Math.log(n)) Math.log(K) Math.log Math K Math.log(n) Math.log Math n Math.log(2.0) Math.log Math 2.0 if (count <= 0) {
            count = 1;
        } count <= 0 count 0 {
            count = 1;
        } count = 1 count 1 return count; count int K K int n n private static int count2(int K, int n) {
        for (int i=0;;i++) {
            if (n >= K) return i;
            
            n *= 2;
       }
   } count2 {
        for (int i=0;;i++) {
            if (n >= K) return i;
            
            n *= 2;
       }
   } for (int i=0;;i++) {
            if (n >= K) return i;
            
            n *= 2;
       } int i=0; int i=0; i 0 i++ i++ i {
            if (n >= K) return i;
            
            n *= 2;
       } {
            if (n >= K) return i;
            
            n *= 2;
       } if (n >= K) return i; n >= K n K return i; i n *= 2 n 2 int K K int n n public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);


        int N = sc.nextInt();
        int K = sc.nextInt();

        System.out.println(solve(N, K));
    }

    public static double solve(int N, int K) {
        double sum = 0;
        double prob = (double)1/N;

        for (int i=1; i<=N; i++) {
            if (i>= K) {
                sum += 1;
                continue;
            }

            sum += Math.pow(0.5, count2(K, i));
        }

        return sum * prob;
   }

   private static int count(int K, int n) {
        int count = (int)Math.ceil((Math.log(K) - Math.log(n)) / Math.log(2.0));
        if (count <= 0) {
            count = 1;
        }

        return count;
   }
   
   private static int count2(int K, int n) {
        for (int i=0;;i++) {
            if (n >= K) return i;
            
            n *= 2;
       }
   }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);


        int N = sc.nextInt();
        int K = sc.nextInt();

        System.out.println(solve(N, K));
    }

    public static double solve(int N, int K) {
        double sum = 0;
        double prob = (double)1/N;

        for (int i=1; i<=N; i++) {
            if (i>= K) {
                sum += 1;
                continue;
            }

            sum += Math.pow(0.5, count2(K, i));
        }

        return sum * prob;
   }

   private static int count(int K, int n) {
        int count = (int)Math.ceil((Math.log(K) - Math.log(n)) / Math.log(2.0));
        if (count <= 0) {
            count = 1;
        }

        return count;
   }
   
   private static int count2(int K, int n) {
        for (int i=0;;i++) {
            if (n >= K) return i;
            
            n *= 2;
       }
   }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);


        int N = sc.nextInt();
        int K = sc.nextInt();

        System.out.println(solve(N, K));
    }

    public static double solve(int N, int K) {
        double sum = 0;
        double prob = (double)1/N;

        for (int i=1; i<=N; i++) {
            if (i>= K) {
                sum += 1;
                continue;
            }

            sum += Math.pow(0.5, count2(K, i));
        }

        return sum * prob;
   }

   private static int count(int K, int n) {
        int count = (int)Math.ceil((Math.log(K) - Math.log(n)) / Math.log(2.0));
        if (count <= 0) {
            count = 1;
        }

        return count;
   }
   
   private static int count2(int K, int n) {
        for (int i=0;;i++) {
            if (n >= K) return i;
            
            n *= 2;
       }
   }
}