import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    double sum = 0;
    for(int i=1; i<=N; i++){
      int ans = i;
      int cnt = 0;
      while(ans<K){
        ans *= 2;
        cnt++;
      }
      sum += Math.pow(0.5, cnt)/N;
    }
    System.out.println(sum);
  }
}
                                    
     import java.util.*; util.* java class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    double sum = 0;
    for(int i=1; i<=N; i++){
      int ans = i;
      int cnt = 0;
      while(ans<K){
        ans *= 2;
        cnt++;
      }
      sum += Math.pow(0.5, cnt)/N;
    }
    System.out.println(sum);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    double sum = 0;
    for(int i=1; i<=N; i++){
      int ans = i;
      int cnt = 0;
      while(ans<K){
        ans *= 2;
        cnt++;
      }
      sum += Math.pow(0.5, cnt)/N;
    }
    System.out.println(sum);
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    double sum = 0;
    for(int i=1; i<=N; i++){
      int ans = i;
      int cnt = 0;
      while(ans<K){
        ans *= 2;
        cnt++;
      }
      sum += Math.pow(0.5, cnt)/N;
    }
    System.out.println(sum);
  } 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 sum = 0; sum 0 for(int i=1; i<=N; i++){
      int ans = i;
      int cnt = 0;
      while(ans<K){
        ans *= 2;
        cnt++;
      }
      sum += Math.pow(0.5, cnt)/N;
    } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
      int ans = i;
      int cnt = 0;
      while(ans<K){
        ans *= 2;
        cnt++;
      }
      sum += Math.pow(0.5, cnt)/N;
    } {
      int ans = i;
      int cnt = 0;
      while(ans<K){
        ans *= 2;
        cnt++;
      }
      sum += Math.pow(0.5, cnt)/N;
    } int ans = i; ans i int cnt = 0; cnt 0 while(ans<K){
        ans *= 2;
        cnt++;
      } ans<K ans K {
        ans *= 2;
        cnt++;
      } ans *= 2 ans 2 cnt++ cnt sum += Math.pow(0.5, cnt)/N sum Math.pow(0.5, cnt)/N Math.pow(0.5, cnt) Math.pow Math 0.5 cnt N System.out.println(sum) System.out.println System.out System System.out sum String[] args args
import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    double sum = 0;
    for(int i=1; i<=N; i++){
      int ans = i;
      int cnt = 0;
      while(ans<K){
        ans *= 2;
        cnt++;
      }
      sum += Math.pow(0.5, cnt)/N;
    }
    System.out.println(sum);
  }
}
                                    
    
