import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    int k = Integer.parseInt(sc.next());
    if (k == 1) {
      pw.println("1");
      return;
    }
    int maxDenominator = requiredPercentDenominator(1, k);
    int totalNumerator = 0;
    for (int dice = 1; dice <= n; dice++) {
      int requiredPercentDenominator = requiredPercentDenominator(dice, k);
      totalNumerator += maxDenominator / requiredPercentDenominator;
    }
    double numerator = totalNumerator;
    double denominator = maxDenominator * n;
    pw.println(numerator / denominator);
    return;
  }

  static int requiredPercentDenominator(int dice, int k) {
    return intPow(2, requiredContThrows(dice, k));
  }

  static int requiredContThrows(int dice, int k) {
    if (dice >= k) {
      return 0;
    }
    int point = dice;
    for (int i = 1; ; i++) {
      point = point * 2;
      if (point >= k) {
        return i;
      }
    }
  }

  static int intPow(int seed, int n) {
    if (n == 0) {
      return 1;
    }
    int result = seed;
    for (int i = 0; i < n - 1; i++) {
      result = result * seed;
    }
    return result;
  }
} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    int k = Integer.parseInt(sc.next());
    if (k == 1) {
      pw.println("1");
      return;
    }
    int maxDenominator = requiredPercentDenominator(1, k);
    int totalNumerator = 0;
    for (int dice = 1; dice <= n; dice++) {
      int requiredPercentDenominator = requiredPercentDenominator(dice, k);
      totalNumerator += maxDenominator / requiredPercentDenominator;
    }
    double numerator = totalNumerator;
    double denominator = maxDenominator * n;
    pw.println(numerator / denominator);
    return;
  }

  static int requiredPercentDenominator(int dice, int k) {
    return intPow(2, requiredContThrows(dice, k));
  }

  static int requiredContThrows(int dice, int k) {
    if (dice >= k) {
      return 0;
    }
    int point = dice;
    for (int i = 1; ; i++) {
      point = point * 2;
      if (point >= k) {
        return i;
      }
    }
  }

  static int intPow(int seed, int n) {
    if (n == 0) {
      return 1;
    }
    int result = seed;
    for (int i = 0; i < n - 1; i++) {
      result = result * seed;
    }
    return result;
  }
} Main public static void main(String[] args) {
    resolve(System.in, System.out);
  } main {
    resolve(System.in, System.out);
  } resolve(System.in, System.out) resolve System.in System System.in System.out System System.out String[] args args static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    int k = Integer.parseInt(sc.next());
    if (k == 1) {
      pw.println("1");
      return;
    }
    int maxDenominator = requiredPercentDenominator(1, k);
    int totalNumerator = 0;
    for (int dice = 1; dice <= n; dice++) {
      int requiredPercentDenominator = requiredPercentDenominator(dice, k);
      totalNumerator += maxDenominator / requiredPercentDenominator;
    }
    double numerator = totalNumerator;
    double denominator = maxDenominator * n;
    pw.println(numerator / denominator);
    return;
  } resolve {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    int k = Integer.parseInt(sc.next());
    if (k == 1) {
      pw.println("1");
      return;
    }
    int maxDenominator = requiredPercentDenominator(1, k);
    int totalNumerator = 0;
    for (int dice = 1; dice <= n; dice++) {
      int requiredPercentDenominator = requiredPercentDenominator(dice, k);
      totalNumerator += maxDenominator / requiredPercentDenominator;
    }
    double numerator = totalNumerator;
    double denominator = maxDenominator * n;
    pw.println(numerator / denominator);
    return;
  } Scanner sc = new Scanner(is); sc new Scanner(is) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int k = Integer.parseInt(sc.next()); k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if (k == 1) {
      pw.println("1");
      return;
    } k == 1 k 1 {
      pw.println("1");
      return;
    } pw.println("1") pw.println pw "1" return; int maxDenominator = requiredPercentDenominator(1, k); maxDenominator requiredPercentDenominator(1, k) requiredPercentDenominator 1 k int totalNumerator = 0; totalNumerator 0 for (int dice = 1; dice <= n; dice++) {
      int requiredPercentDenominator = requiredPercentDenominator(dice, k);
      totalNumerator += maxDenominator / requiredPercentDenominator;
    } int dice = 1; int dice = 1; dice 1 dice <= n dice n dice++ dice++ dice {
      int requiredPercentDenominator = requiredPercentDenominator(dice, k);
      totalNumerator += maxDenominator / requiredPercentDenominator;
    } {
      int requiredPercentDenominator = requiredPercentDenominator(dice, k);
      totalNumerator += maxDenominator / requiredPercentDenominator;
    } int requiredPercentDenominator = requiredPercentDenominator(dice, k); requiredPercentDenominator requiredPercentDenominator(dice, k) requiredPercentDenominator dice k totalNumerator += maxDenominator / requiredPercentDenominator totalNumerator maxDenominator / requiredPercentDenominator maxDenominator requiredPercentDenominator double numerator = totalNumerator; numerator totalNumerator double denominator = maxDenominator * n; denominator maxDenominator * n maxDenominator n pw.println(numerator / denominator) pw.println pw numerator / denominator numerator denominator return; InputStream is is PrintStream pw pw static int requiredPercentDenominator(int dice, int k) {
    return intPow(2, requiredContThrows(dice, k));
  } requiredPercentDenominator {
    return intPow(2, requiredContThrows(dice, k));
  } return intPow(2, requiredContThrows(dice, k)); intPow(2, requiredContThrows(dice, k)) intPow 2 requiredContThrows(dice, k) requiredContThrows dice k int dice dice int k k static int requiredContThrows(int dice, int k) {
    if (dice >= k) {
      return 0;
    }
    int point = dice;
    for (int i = 1; ; i++) {
      point = point * 2;
      if (point >= k) {
        return i;
      }
    }
  } requiredContThrows {
    if (dice >= k) {
      return 0;
    }
    int point = dice;
    for (int i = 1; ; i++) {
      point = point * 2;
      if (point >= k) {
        return i;
      }
    }
  } if (dice >= k) {
      return 0;
    } dice >= k dice k {
      return 0;
    } return 0; 0 int point = dice; point dice for (int i = 1; ; i++) {
      point = point * 2;
      if (point >= k) {
        return i;
      }
    } int i = 1; int i = 1; i 1 i++ i++ i {
      point = point * 2;
      if (point >= k) {
        return i;
      }
    } {
      point = point * 2;
      if (point >= k) {
        return i;
      }
    } point = point * 2 point point * 2 point 2 if (point >= k) {
        return i;
      } point >= k point k {
        return i;
      } return i; i int dice dice int k k static int intPow(int seed, int n) {
    if (n == 0) {
      return 1;
    }
    int result = seed;
    for (int i = 0; i < n - 1; i++) {
      result = result * seed;
    }
    return result;
  } intPow {
    if (n == 0) {
      return 1;
    }
    int result = seed;
    for (int i = 0; i < n - 1; i++) {
      result = result * seed;
    }
    return result;
  } if (n == 0) {
      return 1;
    } n == 0 n 0 {
      return 1;
    } return 1; 1 int result = seed; result seed for (int i = 0; i < n - 1; i++) {
      result = result * seed;
    } int i = 0; int i = 0; i 0 i < n - 1 i n - 1 n 1 i++ i++ i {
      result = result * seed;
    } {
      result = result * seed;
    } result = result * seed result result * seed result seed return result; result int seed seed int n n public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    int k = Integer.parseInt(sc.next());
    if (k == 1) {
      pw.println("1");
      return;
    }
    int maxDenominator = requiredPercentDenominator(1, k);
    int totalNumerator = 0;
    for (int dice = 1; dice <= n; dice++) {
      int requiredPercentDenominator = requiredPercentDenominator(dice, k);
      totalNumerator += maxDenominator / requiredPercentDenominator;
    }
    double numerator = totalNumerator;
    double denominator = maxDenominator * n;
    pw.println(numerator / denominator);
    return;
  }

  static int requiredPercentDenominator(int dice, int k) {
    return intPow(2, requiredContThrows(dice, k));
  }

  static int requiredContThrows(int dice, int k) {
    if (dice >= k) {
      return 0;
    }
    int point = dice;
    for (int i = 1; ; i++) {
      point = point * 2;
      if (point >= k) {
        return i;
      }
    }
  }

  static int intPow(int seed, int n) {
    if (n == 0) {
      return 1;
    }
    int result = seed;
    for (int i = 0; i < n - 1; i++) {
      result = result * seed;
    }
    return result;
  }
} public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    int k = Integer.parseInt(sc.next());
    if (k == 1) {
      pw.println("1");
      return;
    }
    int maxDenominator = requiredPercentDenominator(1, k);
    int totalNumerator = 0;
    for (int dice = 1; dice <= n; dice++) {
      int requiredPercentDenominator = requiredPercentDenominator(dice, k);
      totalNumerator += maxDenominator / requiredPercentDenominator;
    }
    double numerator = totalNumerator;
    double denominator = maxDenominator * n;
    pw.println(numerator / denominator);
    return;
  }

  static int requiredPercentDenominator(int dice, int k) {
    return intPow(2, requiredContThrows(dice, k));
  }

  static int requiredContThrows(int dice, int k) {
    if (dice >= k) {
      return 0;
    }
    int point = dice;
    for (int i = 1; ; i++) {
      point = point * 2;
      if (point >= k) {
        return i;
      }
    }
  }

  static int intPow(int seed, int n) {
    if (n == 0) {
      return 1;
    }
    int result = seed;
    for (int i = 0; i < n - 1; i++) {
      result = result * seed;
    }
    return result;
  }
} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    int k = Integer.parseInt(sc.next());
    if (k == 1) {
      pw.println("1");
      return;
    }
    int maxDenominator = requiredPercentDenominator(1, k);
    int totalNumerator = 0;
    for (int dice = 1; dice <= n; dice++) {
      int requiredPercentDenominator = requiredPercentDenominator(dice, k);
      totalNumerator += maxDenominator / requiredPercentDenominator;
    }
    double numerator = totalNumerator;
    double denominator = maxDenominator * n;
    pw.println(numerator / denominator);
    return;
  }

  static int requiredPercentDenominator(int dice, int k) {
    return intPow(2, requiredContThrows(dice, k));
  }

  static int requiredContThrows(int dice, int k) {
    if (dice >= k) {
      return 0;
    }
    int point = dice;
    for (int i = 1; ; i++) {
      point = point * 2;
      if (point >= k) {
        return i;
      }
    }
  }

  static int intPow(int seed, int n) {
    if (n == 0) {
      return 1;
    }
    int result = seed;
    for (int i = 0; i < n - 1; i++) {
      result = result * seed;
    }
    return result;
  }
}
