import java.util.*;
import java.util.stream.*;

public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int K = in.nextInt();
    double sum = 0;
    for (int i = 1; i <= N; i++) {
      if (K <= i) {
        sum++;
        continue;
      }
      int value = i, p = 1;
      while (value < (K + 1) / 2) {
        value *= 2;
        p++;
      }
      sum += Math.pow(0.5, p);
    }
    System.out.println(sum / N);
  }
} import java.util.*; util.* java import java.util.stream.*; stream.* java.util public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int K = in.nextInt();
    double sum = 0;
    for (int i = 1; i <= N; i++) {
      if (K <= i) {
        sum++;
        continue;
      }
      int value = i, p = 1;
      while (value < (K + 1) / 2) {
        value *= 2;
        p++;
      }
      sum += Math.pow(0.5, p);
    }
    System.out.println(sum / N);
  }
} Main public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int K = in.nextInt();
    double sum = 0;
    for (int i = 1; i <= N; i++) {
      if (K <= i) {
        sum++;
        continue;
      }
      int value = i, p = 1;
      while (value < (K + 1) / 2) {
        value *= 2;
        p++;
      }
      sum += Math.pow(0.5, p);
    }
    System.out.println(sum / N);
  } main {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int K = in.nextInt();
    double sum = 0;
    for (int i = 1; i <= N; i++) {
      if (K <= i) {
        sum++;
        continue;
      }
      int value = i, p = 1;
      while (value < (K + 1) / 2) {
        value *= 2;
        p++;
      }
      sum += Math.pow(0.5, p);
    }
    System.out.println(sum / N);
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int K = in.nextInt(); K in.nextInt() in.nextInt in double sum = 0; sum 0 for (int i = 1; i <= N; i++) {
      if (K <= i) {
        sum++;
        continue;
      }
      int value = i, p = 1;
      while (value < (K + 1) / 2) {
        value *= 2;
        p++;
      }
      sum += Math.pow(0.5, p);
    } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
      if (K <= i) {
        sum++;
        continue;
      }
      int value = i, p = 1;
      while (value < (K + 1) / 2) {
        value *= 2;
        p++;
      }
      sum += Math.pow(0.5, p);
    } {
      if (K <= i) {
        sum++;
        continue;
      }
      int value = i, p = 1;
      while (value < (K + 1) / 2) {
        value *= 2;
        p++;
      }
      sum += Math.pow(0.5, p);
    } if (K <= i) {
        sum++;
        continue;
      } K <= i K i {
        sum++;
        continue;
      } sum++ sum continue; int value = i value i p = 1; p 1 while (value < (K + 1) / 2) {
        value *= 2;
        p++;
      } value < (K + 1) / 2 value (K + 1) / 2 (K + 1) K 1 2 {
        value *= 2;
        p++;
      } value *= 2 value 2 p++ p sum += Math.pow(0.5, p) sum Math.pow(0.5, p) Math.pow Math 0.5 p System.out.println(sum / N) System.out.println System.out System System.out sum / N sum N String[] args args public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int K = in.nextInt();
    double sum = 0;
    for (int i = 1; i <= N; i++) {
      if (K <= i) {
        sum++;
        continue;
      }
      int value = i, p = 1;
      while (value < (K + 1) / 2) {
        value *= 2;
        p++;
      }
      sum += Math.pow(0.5, p);
    }
    System.out.println(sum / N);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int K = in.nextInt();
    double sum = 0;
    for (int i = 1; i <= N; i++) {
      if (K <= i) {
        sum++;
        continue;
      }
      int value = i, p = 1;
      while (value < (K + 1) / 2) {
        value *= 2;
        p++;
      }
      sum += Math.pow(0.5, p);
    }
    System.out.println(sum / N);
  }
} Main
import java.util.*;
import java.util.stream.*;

public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int K = in.nextInt();
    double sum = 0;
    for (int i = 1; i <= N; i++) {
      if (K <= i) {
        sum++;
        continue;
      }
      int value = i, p = 1;
      while (value < (K + 1) / 2) {
        value *= 2;
        p++;
      }
      sum += Math.pow(0.5, p);
    }
    System.out.println(sum / N);
  }
}