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 ans=0;
    for(int i = 1;i<=n;i++){
      int pt = i;
      for(int j = 0;;j++){
        if(pt>=k){
          ans += Math.pow(0.5,j);
          break;
        }else{
          pt = pt*2;
        }
        
      }
    }
    ans = ans/n;
    System.out.println(String.format("%.10f", ans));
  }
} 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 ans=0;
    for(int i = 1;i<=n;i++){
      int pt = i;
      for(int j = 0;;j++){
        if(pt>=k){
          ans += Math.pow(0.5,j);
          break;
        }else{
          pt = pt*2;
        }
        
      }
    }
    ans = ans/n;
    System.out.println(String.format("%.10f", ans));
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    double ans=0;
    for(int i = 1;i<=n;i++){
      int pt = i;
      for(int j = 0;;j++){
        if(pt>=k){
          ans += Math.pow(0.5,j);
          break;
        }else{
          pt = pt*2;
        }
        
      }
    }
    ans = ans/n;
    System.out.println(String.format("%.10f", ans));
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    double ans=0;
    for(int i = 1;i<=n;i++){
      int pt = i;
      for(int j = 0;;j++){
        if(pt>=k){
          ans += Math.pow(0.5,j);
          break;
        }else{
          pt = pt*2;
        }
        
      }
    }
    ans = ans/n;
    System.out.println(String.format("%.10f", ans));
  } 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 ans=0; ans 0 for(int i = 1;i<=n;i++){
      int pt = i;
      for(int j = 0;;j++){
        if(pt>=k){
          ans += Math.pow(0.5,j);
          break;
        }else{
          pt = pt*2;
        }
        
      }
    } int i = 1; int i = 1; i 1 i<=n i n i++ i++ i {
      int pt = i;
      for(int j = 0;;j++){
        if(pt>=k){
          ans += Math.pow(0.5,j);
          break;
        }else{
          pt = pt*2;
        }
        
      }
    } {
      int pt = i;
      for(int j = 0;;j++){
        if(pt>=k){
          ans += Math.pow(0.5,j);
          break;
        }else{
          pt = pt*2;
        }
        
      }
    } int pt = i; pt i for(int j = 0;;j++){
        if(pt>=k){
          ans += Math.pow(0.5,j);
          break;
        }else{
          pt = pt*2;
        }
        
      } int j = 0; int j = 0; j 0 j++ j++ j {
        if(pt>=k){
          ans += Math.pow(0.5,j);
          break;
        }else{
          pt = pt*2;
        }
        
      } {
        if(pt>=k){
          ans += Math.pow(0.5,j);
          break;
        }else{
          pt = pt*2;
        }
        
      } if(pt>=k){
          ans += Math.pow(0.5,j);
          break;
        }else{
          pt = pt*2;
        } pt>=k pt k {
          ans += Math.pow(0.5,j);
          break;
        } ans += Math.pow(0.5,j) ans Math.pow(0.5,j) Math.pow Math 0.5 j break; {
          pt = pt*2;
        } pt = pt*2 pt pt*2 pt 2 ans = ans/n ans ans/n ans n System.out.println(String.format("%.10f", ans)) System.out.println System.out System System.out String.format("%.10f", ans) String.format String "%.10f" ans 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 ans=0;
    for(int i = 1;i<=n;i++){
      int pt = i;
      for(int j = 0;;j++){
        if(pt>=k){
          ans += Math.pow(0.5,j);
          break;
        }else{
          pt = pt*2;
        }
        
      }
    }
    ans = ans/n;
    System.out.println(String.format("%.10f", ans));
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    double ans=0;
    for(int i = 1;i<=n;i++){
      int pt = i;
      for(int j = 0;;j++){
        if(pt>=k){
          ans += Math.pow(0.5,j);
          break;
        }else{
          pt = pt*2;
        }
        
      }
    }
    ans = ans/n;
    System.out.println(String.format("%.10f", ans));
  }
} 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 ans=0;
    for(int i = 1;i<=n;i++){
      int pt = i;
      for(int j = 0;;j++){
        if(pt>=k){
          ans += Math.pow(0.5,j);
          break;
        }else{
          pt = pt*2;
        }
        
      }
    }
    ans = ans/n;
    System.out.println(String.format("%.10f", ans));
  }
}