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();

    Map<Integer, Integer> memo = new HashMap<>();

    int maxN = 0;
    int bunshi = 0;
    for (int i = 1; i <= N; i++) {
      int n = powern(i, K);
      if (i == 1) {
        maxN = n;
      }
      bunshi = bunshi + power2(maxN - n, memo);
    }
    int bunbo = N * power2(maxN, memo);

    System.out.println((double) bunshi / bunbo);
  }
  /*
  private static int power2(int n, Map<Integer, Integer> memo) {
    Integer cached = memo.get(n);
    if (cacehd != null) {
      return cached;
    }

    int ret = 1;
    for (int i = 0; i < n; i++) {
      ret = ret * 2;
    }
    memo.put(n, ret);
    return ret;
  }
  */

  private static int power2(int n, Map<Integer, Integer> memo) {
    Integer cached = memo.get(n);
    if (cached != null) {
      return cached;
    }

    if (n == 0) {
      return 1;
    }

    int tmp = power2(n/2, memo);
    int ret = tmp * tmp;
    if (n % 2 != 0) {
      ret = ret * 2;
    }
    memo.put(n, ret);

    return ret;
  }


  private static int powern(int a, int K) {

    int work = a;
    int ret = 0;

    while (work < K) {
      work = work * 2;
      ret++;
    }

    return ret;
  }
}
 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();

    Map<Integer, Integer> memo = new HashMap<>();

    int maxN = 0;
    int bunshi = 0;
    for (int i = 1; i <= N; i++) {
      int n = powern(i, K);
      if (i == 1) {
        maxN = n;
      }
      bunshi = bunshi + power2(maxN - n, memo);
    }
    int bunbo = N * power2(maxN, memo);

    System.out.println((double) bunshi / bunbo);
  }
  /*
  private static int power2(int n, Map<Integer, Integer> memo) {
    Integer cached = memo.get(n);
    if (cacehd != null) {
      return cached;
    }

    int ret = 1;
    for (int i = 0; i < n; i++) {
      ret = ret * 2;
    }
    memo.put(n, ret);
    return ret;
  }
  */

  private static int power2(int n, Map<Integer, Integer> memo) {
    Integer cached = memo.get(n);
    if (cached != null) {
      return cached;
    }

    if (n == 0) {
      return 1;
    }

    int tmp = power2(n/2, memo);
    int ret = tmp * tmp;
    if (n % 2 != 0) {
      ret = ret * 2;
    }
    memo.put(n, ret);

    return ret;
  }


  private static int powern(int a, int K) {

    int work = a;
    int ret = 0;

    while (work < K) {
      work = work * 2;
      ret++;
    }

    return ret;
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();

    Map<Integer, Integer> memo = new HashMap<>();

    int maxN = 0;
    int bunshi = 0;
    for (int i = 1; i <= N; i++) {
      int n = powern(i, K);
      if (i == 1) {
        maxN = n;
      }
      bunshi = bunshi + power2(maxN - n, memo);
    }
    int bunbo = N * power2(maxN, memo);

    System.out.println((double) bunshi / bunbo);
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();

    Map<Integer, Integer> memo = new HashMap<>();

    int maxN = 0;
    int bunshi = 0;
    for (int i = 1; i <= N; i++) {
      int n = powern(i, K);
      if (i == 1) {
        maxN = n;
      }
      bunshi = bunshi + power2(maxN - n, memo);
    }
    int bunbo = N * power2(maxN, memo);

    System.out.println((double) bunshi / bunbo);
  } 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 Map<Integer, Integer> memo = new HashMap<>(); memo new HashMap<>() int maxN = 0; maxN 0 int bunshi = 0; bunshi 0 for (int i = 1; i <= N; i++) {
      int n = powern(i, K);
      if (i == 1) {
        maxN = n;
      }
      bunshi = bunshi + power2(maxN - n, memo);
    } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
      int n = powern(i, K);
      if (i == 1) {
        maxN = n;
      }
      bunshi = bunshi + power2(maxN - n, memo);
    } {
      int n = powern(i, K);
      if (i == 1) {
        maxN = n;
      }
      bunshi = bunshi + power2(maxN - n, memo);
    } int n = powern(i, K); n powern(i, K) powern i K if (i == 1) {
        maxN = n;
      } i == 1 i 1 {
        maxN = n;
      } maxN = n maxN n bunshi = bunshi + power2(maxN - n, memo) bunshi bunshi + power2(maxN - n, memo) bunshi power2(maxN - n, memo) power2 maxN - n maxN n memo int bunbo = N * power2(maxN, memo); bunbo N * power2(maxN, memo) N power2(maxN, memo) power2 maxN memo System.out.println((double) bunshi / bunbo) System.out.println System.out System System.out (double) bunshi / bunbo (double) bunshi bunbo String[] args args private static int power2(int n, Map<Integer, Integer> memo) {
    Integer cached = memo.get(n);
    if (cached != null) {
      return cached;
    }

    if (n == 0) {
      return 1;
    }

    int tmp = power2(n/2, memo);
    int ret = tmp * tmp;
    if (n % 2 != 0) {
      ret = ret * 2;
    }
    memo.put(n, ret);

    return ret;
  } power2 {
    Integer cached = memo.get(n);
    if (cached != null) {
      return cached;
    }

    if (n == 0) {
      return 1;
    }

    int tmp = power2(n/2, memo);
    int ret = tmp * tmp;
    if (n % 2 != 0) {
      ret = ret * 2;
    }
    memo.put(n, ret);

    return ret;
  } Integer cached = memo.get(n); cached memo.get(n) memo.get memo n if (cached != null) {
      return cached;
    } cached != null cached null {
      return cached;
    } return cached; cached if (n == 0) {
      return 1;
    } n == 0 n 0 {
      return 1;
    } return 1; 1 int tmp = power2(n/2, memo); tmp power2(n/2, memo) power2 n/2 n 2 memo int ret = tmp * tmp; ret tmp * tmp tmp tmp if (n % 2 != 0) {
      ret = ret * 2;
    } n % 2 != 0 n % 2 n 2 0 {
      ret = ret * 2;
    } ret = ret * 2 ret ret * 2 ret 2 memo.put(n, ret) memo.put memo n ret return ret; ret int n n Map<Integer, Integer> memo memo private static int powern(int a, int K) {

    int work = a;
    int ret = 0;

    while (work < K) {
      work = work * 2;
      ret++;
    }

    return ret;
  } powern {

    int work = a;
    int ret = 0;

    while (work < K) {
      work = work * 2;
      ret++;
    }

    return ret;
  } int work = a; work a int ret = 0; ret 0 while (work < K) {
      work = work * 2;
      ret++;
    } work < K work K {
      work = work * 2;
      ret++;
    } work = work * 2 work work * 2 work 2 ret++ ret return ret; ret int a a int K K public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();

    Map<Integer, Integer> memo = new HashMap<>();

    int maxN = 0;
    int bunshi = 0;
    for (int i = 1; i <= N; i++) {
      int n = powern(i, K);
      if (i == 1) {
        maxN = n;
      }
      bunshi = bunshi + power2(maxN - n, memo);
    }
    int bunbo = N * power2(maxN, memo);

    System.out.println((double) bunshi / bunbo);
  }
  /*
  private static int power2(int n, Map<Integer, Integer> memo) {
    Integer cached = memo.get(n);
    if (cacehd != null) {
      return cached;
    }

    int ret = 1;
    for (int i = 0; i < n; i++) {
      ret = ret * 2;
    }
    memo.put(n, ret);
    return ret;
  }
  */

  private static int power2(int n, Map<Integer, Integer> memo) {
    Integer cached = memo.get(n);
    if (cached != null) {
      return cached;
    }

    if (n == 0) {
      return 1;
    }

    int tmp = power2(n/2, memo);
    int ret = tmp * tmp;
    if (n % 2 != 0) {
      ret = ret * 2;
    }
    memo.put(n, ret);

    return ret;
  }


  private static int powern(int a, int K) {

    int work = a;
    int ret = 0;

    while (work < K) {
      work = work * 2;
      ret++;
    }

    return ret;
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();

    Map<Integer, Integer> memo = new HashMap<>();

    int maxN = 0;
    int bunshi = 0;
    for (int i = 1; i <= N; i++) {
      int n = powern(i, K);
      if (i == 1) {
        maxN = n;
      }
      bunshi = bunshi + power2(maxN - n, memo);
    }
    int bunbo = N * power2(maxN, memo);

    System.out.println((double) bunshi / bunbo);
  }
  /*
  private static int power2(int n, Map<Integer, Integer> memo) {
    Integer cached = memo.get(n);
    if (cacehd != null) {
      return cached;
    }

    int ret = 1;
    for (int i = 0; i < n; i++) {
      ret = ret * 2;
    }
    memo.put(n, ret);
    return ret;
  }
  */

  private static int power2(int n, Map<Integer, Integer> memo) {
    Integer cached = memo.get(n);
    if (cached != null) {
      return cached;
    }

    if (n == 0) {
      return 1;
    }

    int tmp = power2(n/2, memo);
    int ret = tmp * tmp;
    if (n % 2 != 0) {
      ret = ret * 2;
    }
    memo.put(n, ret);

    return ret;
  }


  private static int powern(int a, int K) {

    int work = a;
    int ret = 0;

    while (work < K) {
      work = work * 2;
      ret++;
    }

    return ret;
  }
} 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();

    Map<Integer, Integer> memo = new HashMap<>();

    int maxN = 0;
    int bunshi = 0;
    for (int i = 1; i <= N; i++) {
      int n = powern(i, K);
      if (i == 1) {
        maxN = n;
      }
      bunshi = bunshi + power2(maxN - n, memo);
    }
    int bunbo = N * power2(maxN, memo);

    System.out.println((double) bunshi / bunbo);
  }
  /*
  private static int power2(int n, Map<Integer, Integer> memo) {
    Integer cached = memo.get(n);
    if (cacehd != null) {
      return cached;
    }

    int ret = 1;
    for (int i = 0; i < n; i++) {
      ret = ret * 2;
    }
    memo.put(n, ret);
    return ret;
  }
  */

  private static int power2(int n, Map<Integer, Integer> memo) {
    Integer cached = memo.get(n);
    if (cached != null) {
      return cached;
    }

    if (n == 0) {
      return 1;
    }

    int tmp = power2(n/2, memo);
    int ret = tmp * tmp;
    if (n % 2 != 0) {
      ret = ret * 2;
    }
    memo.put(n, ret);

    return ret;
  }


  private static int powern(int a, int K) {

    int work = a;
    int ret = 0;

    while (work < K) {
      work = work * 2;
      ret++;
    }

    return ret;
  }
}

