import java.util.*;

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

      double n = sc.nextDouble();
      double k = sc.nextDouble();

      double ans = 0;

      for(int i=1;i<=n;i++){
        int xn = 0;
        while(i*(Math.pow(2,xn))<k){
          xn++;
        }
        ans += (1/n)*(Math.pow(0.5,xn));
        xn = 0;
      }


      System.out.println(ans);

    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);

      double n = sc.nextDouble();
      double k = sc.nextDouble();

      double ans = 0;

      for(int i=1;i<=n;i++){
        int xn = 0;
        while(i*(Math.pow(2,xn))<k){
          xn++;
        }
        ans += (1/n)*(Math.pow(0.5,xn));
        xn = 0;
      }


      System.out.println(ans);

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

      double n = sc.nextDouble();
      double k = sc.nextDouble();

      double ans = 0;

      for(int i=1;i<=n;i++){
        int xn = 0;
        while(i*(Math.pow(2,xn))<k){
          xn++;
        }
        ans += (1/n)*(Math.pow(0.5,xn));
        xn = 0;
      }


      System.out.println(ans);

    } main {
      Scanner sc = new Scanner(System.in);

      double n = sc.nextDouble();
      double k = sc.nextDouble();

      double ans = 0;

      for(int i=1;i<=n;i++){
        int xn = 0;
        while(i*(Math.pow(2,xn))<k){
          xn++;
        }
        ans += (1/n)*(Math.pow(0.5,xn));
        xn = 0;
      }


      System.out.println(ans);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double n = sc.nextDouble(); n sc.nextDouble() sc.nextDouble sc double k = sc.nextDouble(); k sc.nextDouble() sc.nextDouble sc double ans = 0; ans 0 for(int i=1;i<=n;i++){
        int xn = 0;
        while(i*(Math.pow(2,xn))<k){
          xn++;
        }
        ans += (1/n)*(Math.pow(0.5,xn));
        xn = 0;
      } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
        int xn = 0;
        while(i*(Math.pow(2,xn))<k){
          xn++;
        }
        ans += (1/n)*(Math.pow(0.5,xn));
        xn = 0;
      } {
        int xn = 0;
        while(i*(Math.pow(2,xn))<k){
          xn++;
        }
        ans += (1/n)*(Math.pow(0.5,xn));
        xn = 0;
      } int xn = 0; xn 0 while(i*(Math.pow(2,xn))<k){
          xn++;
        } i*(Math.pow(2,xn))<k i*(Math.pow(2,xn)) i (Math.pow(2,xn)) Math.pow Math 2 xn k {
          xn++;
        } xn++ xn ans += (1/n)*(Math.pow(0.5,xn)) ans (1/n)*(Math.pow(0.5,xn)) (1/n) 1 n (Math.pow(0.5,xn)) Math.pow Math 0.5 xn xn = 0 xn 0 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);

      double n = sc.nextDouble();
      double k = sc.nextDouble();

      double ans = 0;

      for(int i=1;i<=n;i++){
        int xn = 0;
        while(i*(Math.pow(2,xn))<k){
          xn++;
        }
        ans += (1/n)*(Math.pow(0.5,xn));
        xn = 0;
      }


      System.out.println(ans);

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

      double n = sc.nextDouble();
      double k = sc.nextDouble();

      double ans = 0;

      for(int i=1;i<=n;i++){
        int xn = 0;
        while(i*(Math.pow(2,xn))<k){
          xn++;
        }
        ans += (1/n)*(Math.pow(0.5,xn));
        xn = 0;
      }


      System.out.println(ans);

    }
} Main
import java.util.*;

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

      double n = sc.nextDouble();
      double k = sc.nextDouble();

      double ans = 0;

      for(int i=1;i<=n;i++){
        int xn = 0;
        while(i*(Math.pow(2,xn))<k){
          xn++;
        }
        ans += (1/n)*(Math.pow(0.5,xn));
        xn = 0;
      }


      System.out.println(ans);

    }
}
