import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int k = stdIn.nextInt();

    double answer = 0;
    for(int i = 1; i <= n; i++) {
      int c = 0;
      int s = i;
      while(s < k) {
        s = s*2;
        c++;
      }

      double p = 1;
      for(int j = 0; j < c; j++) {
        p = p/2;
      }
      answer += p/n;
    }

    System.out.println(answer);
  }
} import java.util.Scanner; Scanner java.util class Main {
  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int k = stdIn.nextInt();

    double answer = 0;
    for(int i = 1; i <= n; i++) {
      int c = 0;
      int s = i;
      while(s < k) {
        s = s*2;
        c++;
      }

      double p = 1;
      for(int j = 0; j < c; j++) {
        p = p/2;
      }
      answer += p/n;
    }

    System.out.println(answer);
  }
} Main public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int k = stdIn.nextInt();

    double answer = 0;
    for(int i = 1; i <= n; i++) {
      int c = 0;
      int s = i;
      while(s < k) {
        s = s*2;
        c++;
      }

      double p = 1;
      for(int j = 0; j < c; j++) {
        p = p/2;
      }
      answer += p/n;
    }

    System.out.println(answer);
  } main {
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int k = stdIn.nextInt();

    double answer = 0;
    for(int i = 1; i <= n; i++) {
      int c = 0;
      int s = i;
      while(s < k) {
        s = s*2;
        c++;
      }

      double p = 1;
      for(int j = 0; j < c; j++) {
        p = p/2;
      }
      answer += p/n;
    }

    System.out.println(answer);
  } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int k = stdIn.nextInt(); k stdIn.nextInt() stdIn.nextInt stdIn double answer = 0; answer 0 for(int i = 1; i <= n; i++) {
      int c = 0;
      int s = i;
      while(s < k) {
        s = s*2;
        c++;
      }

      double p = 1;
      for(int j = 0; j < c; j++) {
        p = p/2;
      }
      answer += p/n;
    } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
      int c = 0;
      int s = i;
      while(s < k) {
        s = s*2;
        c++;
      }

      double p = 1;
      for(int j = 0; j < c; j++) {
        p = p/2;
      }
      answer += p/n;
    } {
      int c = 0;
      int s = i;
      while(s < k) {
        s = s*2;
        c++;
      }

      double p = 1;
      for(int j = 0; j < c; j++) {
        p = p/2;
      }
      answer += p/n;
    } int c = 0; c 0 int s = i; s i while(s < k) {
        s = s*2;
        c++;
      } s < k s k {
        s = s*2;
        c++;
      } s = s*2 s s*2 s 2 c++ c double p = 1; p 1 for(int j = 0; j < c; j++) {
        p = p/2;
      } int j = 0; int j = 0; j 0 j < c j c j++ j++ j {
        p = p/2;
      } {
        p = p/2;
      } p = p/2 p p/2 p 2 answer += p/n answer p/n p n System.out.println(answer) System.out.println System.out System System.out answer String[] args args
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int k = stdIn.nextInt();

    double answer = 0;
    for(int i = 1; i <= n; i++) {
      int c = 0;
      int s = i;
      while(s < k) {
        s = s*2;
        c++;
      }

      double p = 1;
      for(int j = 0; j < c; j++) {
        p = p/2;
      }
      answer += p/n;
    }

    System.out.println(answer);
  }
}