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 answer = 0;
    for(double i=1;i<=n;i++){
      double coinCnt =0;
      coinCnt=Math.ceil((Math.log(k)/Math.log(2))-(Math.log(i)/Math.log(2)));
      if(coinCnt<=0){
        coinCnt=0;
      }
      answer += 1/Math.pow(2,coinCnt);
    }
    System.out.println(answer*(1/n));
  }
} 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 answer = 0;
    for(double i=1;i<=n;i++){
      double coinCnt =0;
      coinCnt=Math.ceil((Math.log(k)/Math.log(2))-(Math.log(i)/Math.log(2)));
      if(coinCnt<=0){
        coinCnt=0;
      }
      answer += 1/Math.pow(2,coinCnt);
    }
    System.out.println(answer*(1/n));
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    double n = sc.nextDouble();
    double k = sc.nextDouble();
    double answer = 0;
    for(double i=1;i<=n;i++){
      double coinCnt =0;
      coinCnt=Math.ceil((Math.log(k)/Math.log(2))-(Math.log(i)/Math.log(2)));
      if(coinCnt<=0){
        coinCnt=0;
      }
      answer += 1/Math.pow(2,coinCnt);
    }
    System.out.println(answer*(1/n));
  } main {
    Scanner sc = new Scanner(System.in);
    double n = sc.nextDouble();
    double k = sc.nextDouble();
    double answer = 0;
    for(double i=1;i<=n;i++){
      double coinCnt =0;
      coinCnt=Math.ceil((Math.log(k)/Math.log(2))-(Math.log(i)/Math.log(2)));
      if(coinCnt<=0){
        coinCnt=0;
      }
      answer += 1/Math.pow(2,coinCnt);
    }
    System.out.println(answer*(1/n));
  } 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 answer = 0; answer 0 for(double i=1;i<=n;i++){
      double coinCnt =0;
      coinCnt=Math.ceil((Math.log(k)/Math.log(2))-(Math.log(i)/Math.log(2)));
      if(coinCnt<=0){
        coinCnt=0;
      }
      answer += 1/Math.pow(2,coinCnt);
    } double i=1; double i=1; i 1 i<=n i n i++ i++ i {
      double coinCnt =0;
      coinCnt=Math.ceil((Math.log(k)/Math.log(2))-(Math.log(i)/Math.log(2)));
      if(coinCnt<=0){
        coinCnt=0;
      }
      answer += 1/Math.pow(2,coinCnt);
    } {
      double coinCnt =0;
      coinCnt=Math.ceil((Math.log(k)/Math.log(2))-(Math.log(i)/Math.log(2)));
      if(coinCnt<=0){
        coinCnt=0;
      }
      answer += 1/Math.pow(2,coinCnt);
    } double coinCnt =0; coinCnt 0 coinCnt=Math.ceil((Math.log(k)/Math.log(2))-(Math.log(i)/Math.log(2))) coinCnt Math.ceil((Math.log(k)/Math.log(2))-(Math.log(i)/Math.log(2))) Math.ceil Math (Math.log(k)/Math.log(2))-(Math.log(i)/Math.log(2)) (Math.log(k)/Math.log(2)) Math.log(k) Math.log Math k Math.log(2) Math.log Math 2 (Math.log(i)/Math.log(2)) Math.log(i) Math.log Math i Math.log(2) Math.log Math 2 if(coinCnt<=0){
        coinCnt=0;
      } coinCnt<=0 coinCnt 0 {
        coinCnt=0;
      } coinCnt=0 coinCnt 0 answer += 1/Math.pow(2,coinCnt) answer 1/Math.pow(2,coinCnt) 1 Math.pow(2,coinCnt) Math.pow Math 2 coinCnt System.out.println(answer*(1/n)) System.out.println System.out System System.out answer*(1/n) answer (1/n) 1 n 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 answer = 0;
    for(double i=1;i<=n;i++){
      double coinCnt =0;
      coinCnt=Math.ceil((Math.log(k)/Math.log(2))-(Math.log(i)/Math.log(2)));
      if(coinCnt<=0){
        coinCnt=0;
      }
      answer += 1/Math.pow(2,coinCnt);
    }
    System.out.println(answer*(1/n));
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    double n = sc.nextDouble();
    double k = sc.nextDouble();
    double answer = 0;
    for(double i=1;i<=n;i++){
      double coinCnt =0;
      coinCnt=Math.ceil((Math.log(k)/Math.log(2))-(Math.log(i)/Math.log(2)));
      if(coinCnt<=0){
        coinCnt=0;
      }
      answer += 1/Math.pow(2,coinCnt);
    }
    System.out.println(answer*(1/n));
  }
} 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 answer = 0;
    for(double i=1;i<=n;i++){
      double coinCnt =0;
      coinCnt=Math.ceil((Math.log(k)/Math.log(2))-(Math.log(i)/Math.log(2)));
      if(coinCnt<=0){
        coinCnt=0;
      }
      answer += 1/Math.pow(2,coinCnt);
    }
    System.out.println(answer*(1/n));
  }
}