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();
    sc.close();
    double a = 0;
    int n1 = n;
    int ki = k;
    double kd = (double) k;
    double rate = 1;
    for (int i =0;i<k;i++){
      if (n1 == 0){
        break; 
      }else if (n1 >= ki){
        a += ((double)n1-(double)ki+1.0)*rate;
        n1 = ki-1;
      }
      kd = kd/2;
      ki = (int)Math.ceil(kd);
      rate = rate/2;
    }
    System.out.println(a/n);
  }
} 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();
    sc.close();
    double a = 0;
    int n1 = n;
    int ki = k;
    double kd = (double) k;
    double rate = 1;
    for (int i =0;i<k;i++){
      if (n1 == 0){
        break; 
      }else if (n1 >= ki){
        a += ((double)n1-(double)ki+1.0)*rate;
        n1 = ki-1;
      }
      kd = kd/2;
      ki = (int)Math.ceil(kd);
      rate = rate/2;
    }
    System.out.println(a/n);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    sc.close();
    double a = 0;
    int n1 = n;
    int ki = k;
    double kd = (double) k;
    double rate = 1;
    for (int i =0;i<k;i++){
      if (n1 == 0){
        break; 
      }else if (n1 >= ki){
        a += ((double)n1-(double)ki+1.0)*rate;
        n1 = ki-1;
      }
      kd = kd/2;
      ki = (int)Math.ceil(kd);
      rate = rate/2;
    }
    System.out.println(a/n);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    sc.close();
    double a = 0;
    int n1 = n;
    int ki = k;
    double kd = (double) k;
    double rate = 1;
    for (int i =0;i<k;i++){
      if (n1 == 0){
        break; 
      }else if (n1 >= ki){
        a += ((double)n1-(double)ki+1.0)*rate;
        n1 = ki-1;
      }
      kd = kd/2;
      ki = (int)Math.ceil(kd);
      rate = rate/2;
    }
    System.out.println(a/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 sc.close() sc.close sc double a = 0; a 0 int n1 = n; n1 n int ki = k; ki k double kd = (double) k; kd (double) k double rate = 1; rate 1 for (int i =0;i<k;i++){
      if (n1 == 0){
        break; 
      }else if (n1 >= ki){
        a += ((double)n1-(double)ki+1.0)*rate;
        n1 = ki-1;
      }
      kd = kd/2;
      ki = (int)Math.ceil(kd);
      rate = rate/2;
    } int i =0; int i =0; i 0 i<k i k i++ i++ i {
      if (n1 == 0){
        break; 
      }else if (n1 >= ki){
        a += ((double)n1-(double)ki+1.0)*rate;
        n1 = ki-1;
      }
      kd = kd/2;
      ki = (int)Math.ceil(kd);
      rate = rate/2;
    } {
      if (n1 == 0){
        break; 
      }else if (n1 >= ki){
        a += ((double)n1-(double)ki+1.0)*rate;
        n1 = ki-1;
      }
      kd = kd/2;
      ki = (int)Math.ceil(kd);
      rate = rate/2;
    } if (n1 == 0){
        break; 
      }else if (n1 >= ki){
        a += ((double)n1-(double)ki+1.0)*rate;
        n1 = ki-1;
      } n1 == 0 n1 0 {
        break; 
      } break; if (n1 >= ki){
        a += ((double)n1-(double)ki+1.0)*rate;
        n1 = ki-1;
      } n1 >= ki n1 ki {
        a += ((double)n1-(double)ki+1.0)*rate;
        n1 = ki-1;
      } a += ((double)n1-(double)ki+1.0)*rate a ((double)n1-(double)ki+1.0)*rate ((double)n1-(double)ki+1.0) (double)n1-(double)ki (double)n1 (double)ki 1.0 rate n1 = ki-1 n1 ki-1 ki 1 kd = kd/2 kd kd/2 kd 2 ki = (int)Math.ceil(kd) ki (int)Math.ceil(kd) Math.ceil Math kd rate = rate/2 rate rate/2 rate 2 System.out.println(a/n) System.out.println System.out System System.out a/n a 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();
    sc.close();
    double a = 0;
    int n1 = n;
    int ki = k;
    double kd = (double) k;
    double rate = 1;
    for (int i =0;i<k;i++){
      if (n1 == 0){
        break; 
      }else if (n1 >= ki){
        a += ((double)n1-(double)ki+1.0)*rate;
        n1 = ki-1;
      }
      kd = kd/2;
      ki = (int)Math.ceil(kd);
      rate = rate/2;
    }
    System.out.println(a/n);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    sc.close();
    double a = 0;
    int n1 = n;
    int ki = k;
    double kd = (double) k;
    double rate = 1;
    for (int i =0;i<k;i++){
      if (n1 == 0){
        break; 
      }else if (n1 >= ki){
        a += ((double)n1-(double)ki+1.0)*rate;
        n1 = ki-1;
      }
      kd = kd/2;
      ki = (int)Math.ceil(kd);
      rate = rate/2;
    }
    System.out.println(a/n);
  }
} 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();
    sc.close();
    double a = 0;
    int n1 = n;
    int ki = k;
    double kd = (double) k;
    double rate = 1;
    for (int i =0;i<k;i++){
      if (n1 == 0){
        break; 
      }else if (n1 >= ki){
        a += ((double)n1-(double)ki+1.0)*rate;
        n1 = ki-1;
      }
      kd = kd/2;
      ki = (int)Math.ceil(kd);
      rate = rate/2;
    }
    System.out.println(a/n);
  }
}