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 result = 0;
    int now = 0;

    for (int i = 1; i <= n; i++) {

      now = i;
      int count = 0;

      while (now < k) {
        now *= 2;
        count++;
      }

      result += Math.pow(0.5, count) / n;
    }

    System.out.println(result);
  }
} 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 result = 0;
    int now = 0;

    for (int i = 1; i <= n; i++) {

      now = i;
      int count = 0;

      while (now < k) {
        now *= 2;
        count++;
      }

      result += Math.pow(0.5, count) / n;
    }

    System.out.println(result);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int k = sc.nextInt();

    double result = 0;
    int now = 0;

    for (int i = 1; i <= n; i++) {

      now = i;
      int count = 0;

      while (now < k) {
        now *= 2;
        count++;
      }

      result += Math.pow(0.5, count) / n;
    }

    System.out.println(result);
  } main {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int k = sc.nextInt();

    double result = 0;
    int now = 0;

    for (int i = 1; i <= n; i++) {

      now = i;
      int count = 0;

      while (now < k) {
        now *= 2;
        count++;
      }

      result += Math.pow(0.5, count) / n;
    }

    System.out.println(result);
  } 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 result = 0; result 0 int now = 0; now 0 for (int i = 1; i <= n; i++) {

      now = i;
      int count = 0;

      while (now < k) {
        now *= 2;
        count++;
      }

      result += Math.pow(0.5, count) / n;
    } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {

      now = i;
      int count = 0;

      while (now < k) {
        now *= 2;
        count++;
      }

      result += Math.pow(0.5, count) / n;
    } {

      now = i;
      int count = 0;

      while (now < k) {
        now *= 2;
        count++;
      }

      result += Math.pow(0.5, count) / n;
    } now = i now i int count = 0; count 0 while (now < k) {
        now *= 2;
        count++;
      } now < k now k {
        now *= 2;
        count++;
      } now *= 2 now 2 count++ count result += Math.pow(0.5, count) / n result Math.pow(0.5, count) / n Math.pow(0.5, count) Math.pow Math 0.5 count n System.out.println(result) System.out.println System.out System System.out result 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 result = 0;
    int now = 0;

    for (int i = 1; i <= n; i++) {

      now = i;
      int count = 0;

      while (now < k) {
        now *= 2;
        count++;
      }

      result += Math.pow(0.5, count) / n;
    }

    System.out.println(result);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int k = sc.nextInt();

    double result = 0;
    int now = 0;

    for (int i = 1; i <= n; i++) {

      now = i;
      int count = 0;

      while (now < k) {
        now *= 2;
        count++;
      }

      result += Math.pow(0.5, count) / n;
    }

    System.out.println(result);
  }
} 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 result = 0;
    int now = 0;

    for (int i = 1; i <= n; i++) {

      now = i;
      int count = 0;

      while (now < k) {
        now *= 2;
        count++;
      }

      result += Math.pow(0.5, count) / n;
    }

    System.out.println(result);
  }
}
