import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);

    int N = scn.nextInt();
    int K = scn.nextInt();

    double winRate = 0;
    for (int i = 1; i <= N; i++) {
      winRate += calcProb(i, K, 1.0 / N);

    }
    System.out.println(winRate);
  }

  public static double calcProb(int N, int K, double prob) {

    if (N >= K) {
      return prob;

    } else {
      return calcProb(N * 2, K, prob * 0.5);

    }
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);

    int N = scn.nextInt();
    int K = scn.nextInt();

    double winRate = 0;
    for (int i = 1; i <= N; i++) {
      winRate += calcProb(i, K, 1.0 / N);

    }
    System.out.println(winRate);
  }

  public static double calcProb(int N, int K, double prob) {

    if (N >= K) {
      return prob;

    } else {
      return calcProb(N * 2, K, prob * 0.5);

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

    int N = scn.nextInt();
    int K = scn.nextInt();

    double winRate = 0;
    for (int i = 1; i <= N; i++) {
      winRate += calcProb(i, K, 1.0 / N);

    }
    System.out.println(winRate);
  } main {
    Scanner scn = new Scanner(System.in);

    int N = scn.nextInt();
    int K = scn.nextInt();

    double winRate = 0;
    for (int i = 1; i <= N; i++) {
      winRate += calcProb(i, K, 1.0 / N);

    }
    System.out.println(winRate);
  } Scanner scn = new Scanner(System.in); scn new Scanner(System.in) int N = scn.nextInt(); N scn.nextInt() scn.nextInt scn int K = scn.nextInt(); K scn.nextInt() scn.nextInt scn double winRate = 0; winRate 0 for (int i = 1; i <= N; i++) {
      winRate += calcProb(i, K, 1.0 / N);

    } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
      winRate += calcProb(i, K, 1.0 / N);

    } {
      winRate += calcProb(i, K, 1.0 / N);

    } winRate += calcProb(i, K, 1.0 / N) winRate calcProb(i, K, 1.0 / N) calcProb i K 1.0 / N 1.0 N System.out.println(winRate) System.out.println System.out System System.out winRate String[] args args public static double calcProb(int N, int K, double prob) {

    if (N >= K) {
      return prob;

    } else {
      return calcProb(N * 2, K, prob * 0.5);

    }
  } calcProb {

    if (N >= K) {
      return prob;

    } else {
      return calcProb(N * 2, K, prob * 0.5);

    }
  } if (N >= K) {
      return prob;

    } else {
      return calcProb(N * 2, K, prob * 0.5);

    } N >= K N K {
      return prob;

    } return prob; prob {
      return calcProb(N * 2, K, prob * 0.5);

    } return calcProb(N * 2, K, prob * 0.5); calcProb(N * 2, K, prob * 0.5) calcProb N * 2 N 2 K prob * 0.5 prob 0.5 int N N int K K double prob prob public class Main {
  public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);

    int N = scn.nextInt();
    int K = scn.nextInt();

    double winRate = 0;
    for (int i = 1; i <= N; i++) {
      winRate += calcProb(i, K, 1.0 / N);

    }
    System.out.println(winRate);
  }

  public static double calcProb(int N, int K, double prob) {

    if (N >= K) {
      return prob;

    } else {
      return calcProb(N * 2, K, prob * 0.5);

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

    int N = scn.nextInt();
    int K = scn.nextInt();

    double winRate = 0;
    for (int i = 1; i <= N; i++) {
      winRate += calcProb(i, K, 1.0 / N);

    }
    System.out.println(winRate);
  }

  public static double calcProb(int N, int K, double prob) {

    if (N >= K) {
      return prob;

    } else {
      return calcProb(N * 2, K, prob * 0.5);

    }
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);

    int N = scn.nextInt();
    int K = scn.nextInt();

    double winRate = 0;
    for (int i = 1; i <= N; i++) {
      winRate += calcProb(i, K, 1.0 / N);

    }
    System.out.println(winRate);
  }

  public static double calcProb(int N, int K, double prob) {

    if (N >= K) {
      return prob;

    } else {
      return calcProb(N * 2, K, prob * 0.5);

    }
  }
}