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();

    double pp = 0;

    for(int i=1; i<=n; i++){
      int count = 0;
      int m = i;
      while(m<k){
        m = m * 2;
        count +=1;
      }
      pp += 1/Math.pow(2, count);
    }

    System.out.println(pp*1/n);
  }
} 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();

    double pp = 0;

    for(int i=1; i<=n; i++){
      int count = 0;
      int m = i;
      while(m<k){
        m = m * 2;
        count +=1;
      }
      pp += 1/Math.pow(2, count);
    }

    System.out.println(pp*1/n);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();

    double pp = 0;

    for(int i=1; i<=n; i++){
      int count = 0;
      int m = i;
      while(m<k){
        m = m * 2;
        count +=1;
      }
      pp += 1/Math.pow(2, count);
    }

    System.out.println(pp*1/n);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();

    double pp = 0;

    for(int i=1; i<=n; i++){
      int count = 0;
      int m = i;
      while(m<k){
        m = m * 2;
        count +=1;
      }
      pp += 1/Math.pow(2, count);
    }

    System.out.println(pp*1/n);
  } 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 pp = 0; pp 0 for(int i=1; i<=n; i++){
      int count = 0;
      int m = i;
      while(m<k){
        m = m * 2;
        count +=1;
      }
      pp += 1/Math.pow(2, count);
    } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
      int count = 0;
      int m = i;
      while(m<k){
        m = m * 2;
        count +=1;
      }
      pp += 1/Math.pow(2, count);
    } {
      int count = 0;
      int m = i;
      while(m<k){
        m = m * 2;
        count +=1;
      }
      pp += 1/Math.pow(2, count);
    } int count = 0; count 0 int m = i; m i while(m<k){
        m = m * 2;
        count +=1;
      } m<k m k {
        m = m * 2;
        count +=1;
      } m = m * 2 m m * 2 m 2 count +=1 count 1 pp += 1/Math.pow(2, count) pp 1/Math.pow(2, count) 1 Math.pow(2, count) Math.pow Math 2 count System.out.println(pp*1/n) System.out.println System.out System System.out pp*1/n pp*1 pp 1 n 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 pp = 0;

    for(int i=1; i<=n; i++){
      int count = 0;
      int m = i;
      while(m<k){
        m = m * 2;
        count +=1;
      }
      pp += 1/Math.pow(2, count);
    }

    System.out.println(pp*1/n);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();

    double pp = 0;

    for(int i=1; i<=n; i++){
      int count = 0;
      int m = i;
      while(m<k){
        m = m * 2;
        count +=1;
      }
      pp += 1/Math.pow(2, count);
    }

    System.out.println(pp*1/n);
  }
} 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();

    double pp = 0;

    for(int i=1; i<=n; i++){
      int count = 0;
      int m = i;
      while(m<k){
        m = m * 2;
        count +=1;
      }
      pp += 1/Math.pow(2, count);
    }

    System.out.println(pp*1/n);
  }
}