import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) {

    new Main().run();
  }
  public void run() {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {
      String[] lines = in.readLine().split(" ");
      int n = Integer.parseInt(lines[0]);
      int k = Integer.parseInt(lines[1]);

      double dn = n;
      double ans = 0.0;
      if(k == 1) ans = 1;
      else {
        for (int i = 1; i <= n; i++) {
          int cnt = 0;
          for (int j = i; j < k; j*=2) {
            cnt++;
          }
          
          ans += 1 / dn * Math.pow(0.5, cnt);
        }
      }

      System.out.println(ans);
    }
    catch(IOException e) {

      System.err.println(e);
    }
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

  public static void main(String[] args) {

    new Main().run();
  }
  public void run() {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {
      String[] lines = in.readLine().split(" ");
      int n = Integer.parseInt(lines[0]);
      int k = Integer.parseInt(lines[1]);

      double dn = n;
      double ans = 0.0;
      if(k == 1) ans = 1;
      else {
        for (int i = 1; i <= n; i++) {
          int cnt = 0;
          for (int j = i; j < k; j*=2) {
            cnt++;
          }
          
          ans += 1 / dn * Math.pow(0.5, cnt);
        }
      }

      System.out.println(ans);
    }
    catch(IOException e) {

      System.err.println(e);
    }
  }
} Main public static void main(String[] args) {

    new Main().run();
  } main {

    new Main().run();
  } new Main().run() new Main().run new Main() String[] args args public void run() {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {
      String[] lines = in.readLine().split(" ");
      int n = Integer.parseInt(lines[0]);
      int k = Integer.parseInt(lines[1]);

      double dn = n;
      double ans = 0.0;
      if(k == 1) ans = 1;
      else {
        for (int i = 1; i <= n; i++) {
          int cnt = 0;
          for (int j = i; j < k; j*=2) {
            cnt++;
          }
          
          ans += 1 / dn * Math.pow(0.5, cnt);
        }
      }

      System.out.println(ans);
    }
    catch(IOException e) {

      System.err.println(e);
    }
  } run {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {
      String[] lines = in.readLine().split(" ");
      int n = Integer.parseInt(lines[0]);
      int k = Integer.parseInt(lines[1]);

      double dn = n;
      double ans = 0.0;
      if(k == 1) ans = 1;
      else {
        for (int i = 1; i <= n; i++) {
          int cnt = 0;
          for (int j = i; j < k; j*=2) {
            cnt++;
          }
          
          ans += 1 / dn * Math.pow(0.5, cnt);
        }
      }

      System.out.println(ans);
    }
    catch(IOException e) {

      System.err.println(e);
    }
  } try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {
      String[] lines = in.readLine().split(" ");
      int n = Integer.parseInt(lines[0]);
      int k = Integer.parseInt(lines[1]);

      double dn = n;
      double ans = 0.0;
      if(k == 1) ans = 1;
      else {
        for (int i = 1; i <= n; i++) {
          int cnt = 0;
          for (int j = i; j < k; j*=2) {
            cnt++;
          }
          
          ans += 1 / dn * Math.pow(0.5, cnt);
        }
      }

      System.out.println(ans);
    }
    catch(IOException e) {

      System.err.println(e);
    } catch(IOException e) {

      System.err.println(e);
    } IOException e {

      System.err.println(e);
    } System.err.println(e) System.err.println System.err System System.err e {
      String[] lines = in.readLine().split(" ");
      int n = Integer.parseInt(lines[0]);
      int k = Integer.parseInt(lines[1]);

      double dn = n;
      double ans = 0.0;
      if(k == 1) ans = 1;
      else {
        for (int i = 1; i <= n; i++) {
          int cnt = 0;
          for (int j = i; j < k; j*=2) {
            cnt++;
          }
          
          ans += 1 / dn * Math.pow(0.5, cnt);
        }
      }

      System.out.println(ans);
    } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String[] lines = in.readLine().split(" "); lines in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " int n = Integer.parseInt(lines[0]); n Integer.parseInt(lines[0]) Integer.parseInt Integer lines[0] lines 0 int k = Integer.parseInt(lines[1]); k Integer.parseInt(lines[1]) Integer.parseInt Integer lines[1] lines 1 double dn = n; dn n double ans = 0.0; ans 0.0 if(k == 1) ans = 1;
      else {
        for (int i = 1; i <= n; i++) {
          int cnt = 0;
          for (int j = i; j < k; j*=2) {
            cnt++;
          }
          
          ans += 1 / dn * Math.pow(0.5, cnt);
        }
      } k == 1 k 1 ans = 1 ans 1 {
        for (int i = 1; i <= n; i++) {
          int cnt = 0;
          for (int j = i; j < k; j*=2) {
            cnt++;
          }
          
          ans += 1 / dn * Math.pow(0.5, cnt);
        }
      } for (int i = 1; i <= n; i++) {
          int cnt = 0;
          for (int j = i; j < k; j*=2) {
            cnt++;
          }
          
          ans += 1 / dn * Math.pow(0.5, cnt);
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
          int cnt = 0;
          for (int j = i; j < k; j*=2) {
            cnt++;
          }
          
          ans += 1 / dn * Math.pow(0.5, cnt);
        } {
          int cnt = 0;
          for (int j = i; j < k; j*=2) {
            cnt++;
          }
          
          ans += 1 / dn * Math.pow(0.5, cnt);
        } int cnt = 0; cnt 0 for (int j = i; j < k; j*=2) {
            cnt++;
          } int j = i; int j = i; j i j < k j k j*=2 j*=2 j 2 {
            cnt++;
          } {
            cnt++;
          } cnt++ cnt ans += 1 / dn * Math.pow(0.5, cnt) ans 1 / dn * Math.pow(0.5, cnt) 1 / dn 1 dn Math.pow(0.5, cnt) Math.pow Math 0.5 cnt System.out.println(ans) System.out.println System.out System System.out ans public class Main {

  public static void main(String[] args) {

    new Main().run();
  }
  public void run() {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {
      String[] lines = in.readLine().split(" ");
      int n = Integer.parseInt(lines[0]);
      int k = Integer.parseInt(lines[1]);

      double dn = n;
      double ans = 0.0;
      if(k == 1) ans = 1;
      else {
        for (int i = 1; i <= n; i++) {
          int cnt = 0;
          for (int j = i; j < k; j*=2) {
            cnt++;
          }
          
          ans += 1 / dn * Math.pow(0.5, cnt);
        }
      }

      System.out.println(ans);
    }
    catch(IOException e) {

      System.err.println(e);
    }
  }
} public class Main {

  public static void main(String[] args) {

    new Main().run();
  }
  public void run() {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {
      String[] lines = in.readLine().split(" ");
      int n = Integer.parseInt(lines[0]);
      int k = Integer.parseInt(lines[1]);

      double dn = n;
      double ans = 0.0;
      if(k == 1) ans = 1;
      else {
        for (int i = 1; i <= n; i++) {
          int cnt = 0;
          for (int j = i; j < k; j*=2) {
            cnt++;
          }
          
          ans += 1 / dn * Math.pow(0.5, cnt);
        }
      }

      System.out.println(ans);
    }
    catch(IOException e) {

      System.err.println(e);
    }
  }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) {

    new Main().run();
  }
  public void run() {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {
      String[] lines = in.readLine().split(" ");
      int n = Integer.parseInt(lines[0]);
      int k = Integer.parseInt(lines[1]);

      double dn = n;
      double ans = 0.0;
      if(k == 1) ans = 1;
      else {
        for (int i = 1; i <= n; i++) {
          int cnt = 0;
          for (int j = i; j < k; j*=2) {
            cnt++;
          }
          
          ans += 1 / dn * Math.pow(0.5, cnt);
        }
      }

      System.out.println(ans);
    }
    catch(IOException e) {

      System.err.println(e);
    }
  }
}