import java.util.Scanner;

public class Main {

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);

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

		double p = 0;

		if(N < K) {

			for(int i=1;i<=N;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}

			p /= N;
		}else {
			for(int i=1;i<K;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}
			p /= N;

			p += (double)(N-K+1)/(double)N;
		}
		System.out.println(p);
	}

	public static boolean ispow2(int a) {
		int x = a & (a-1);
		if(x == 0) {
			return true;
		}else {
			return false;
		}
	}

	public static double log2(double a) {
		return Math.log(a)/Math.log(2);
	}
} import java.util.Scanner; Scanner 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();

		double p = 0;

		if(N < K) {

			for(int i=1;i<=N;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}

			p /= N;
		}else {
			for(int i=1;i<K;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}
			p /= N;

			p += (double)(N-K+1)/(double)N;
		}
		System.out.println(p);
	}

	public static boolean ispow2(int a) {
		int x = a & (a-1);
		if(x == 0) {
			return true;
		}else {
			return false;
		}
	}

	public static double log2(double a) {
		return Math.log(a)/Math.log(2);
	}
} Main public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);

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

		double p = 0;

		if(N < K) {

			for(int i=1;i<=N;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}

			p /= N;
		}else {
			for(int i=1;i<K;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}
			p /= N;

			p += (double)(N-K+1)/(double)N;
		}
		System.out.println(p);
	} main {

		Scanner sc = new Scanner(System.in);

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

		double p = 0;

		if(N < K) {

			for(int i=1;i<=N;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}

			p /= N;
		}else {
			for(int i=1;i<K;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}
			p /= N;

			p += (double)(N-K+1)/(double)N;
		}
		System.out.println(p);
	} 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 double p = 0; p 0 if(N < K) {

			for(int i=1;i<=N;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}

			p /= N;
		}else {
			for(int i=1;i<K;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}
			p /= N;

			p += (double)(N-K+1)/(double)N;
		} N < K N K {

			for(int i=1;i<=N;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}

			p /= N;
		} for(int i=1;i<=N;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			} {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			} if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				} K%i == 0 && ispow2(K/i) K%i == 0 K%i K i 0 ispow2(K/i) ispow2 K/i K i {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				} p += Math.pow(2, -1*((int)(log2(K/i)))) p Math.pow(2, -1*((int)(log2(K/i)))) Math.pow Math 2 -1*((int)(log2(K/i))) -1 1 ((int)(log2(K/i))) log2 K/i K i {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				} p += Math.pow(2, -1*((int)(log2(K/i) + 1))) p Math.pow(2, -1*((int)(log2(K/i) + 1))) Math.pow Math 2 -1*((int)(log2(K/i) + 1)) -1 1 ((int)(log2(K/i) + 1)) log2(K/i) log2 K/i K i 1 p /= N p N {
			for(int i=1;i<K;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}
			p /= N;

			p += (double)(N-K+1)/(double)N;
		} for(int i=1;i<K;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			} int i=1; int i=1; i 1 i<K i K i++ i++ i {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			} {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			} if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				} K%i == 0 && ispow2(K/i) K%i == 0 K%i K i 0 ispow2(K/i) ispow2 K/i K i {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				} p += Math.pow(2, -1*((int)(log2(K/i)))) p Math.pow(2, -1*((int)(log2(K/i)))) Math.pow Math 2 -1*((int)(log2(K/i))) -1 1 ((int)(log2(K/i))) log2 K/i K i {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				} p += Math.pow(2, -1*((int)(log2(K/i) + 1))) p Math.pow(2, -1*((int)(log2(K/i) + 1))) Math.pow Math 2 -1*((int)(log2(K/i) + 1)) -1 1 ((int)(log2(K/i) + 1)) log2(K/i) log2 K/i K i 1 p /= N p N p += (double)(N-K+1)/(double)N p (double)(N-K+1)/(double)N (double)(N-K+1) N-K N K 1 (double)N System.out.println(p) System.out.println System.out System System.out p String args[] args public static boolean ispow2(int a) {
		int x = a & (a-1);
		if(x == 0) {
			return true;
		}else {
			return false;
		}
	} ispow2 {
		int x = a & (a-1);
		if(x == 0) {
			return true;
		}else {
			return false;
		}
	} int x = a & (a-1); x a & (a-1) a (a-1) a 1 if(x == 0) {
			return true;
		}else {
			return false;
		} x == 0 x 0 {
			return true;
		} return true; true {
			return false;
		} return false; false int a a public static double log2(double a) {
		return Math.log(a)/Math.log(2);
	} log2 {
		return Math.log(a)/Math.log(2);
	} return Math.log(a)/Math.log(2); Math.log(a)/Math.log(2) Math.log(a) Math.log Math a Math.log(2) Math.log Math 2 double a a public class Main {

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);

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

		double p = 0;

		if(N < K) {

			for(int i=1;i<=N;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}

			p /= N;
		}else {
			for(int i=1;i<K;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}
			p /= N;

			p += (double)(N-K+1)/(double)N;
		}
		System.out.println(p);
	}

	public static boolean ispow2(int a) {
		int x = a & (a-1);
		if(x == 0) {
			return true;
		}else {
			return false;
		}
	}

	public static double log2(double a) {
		return Math.log(a)/Math.log(2);
	}
} public class Main {

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);

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

		double p = 0;

		if(N < K) {

			for(int i=1;i<=N;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}

			p /= N;
		}else {
			for(int i=1;i<K;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}
			p /= N;

			p += (double)(N-K+1)/(double)N;
		}
		System.out.println(p);
	}

	public static boolean ispow2(int a) {
		int x = a & (a-1);
		if(x == 0) {
			return true;
		}else {
			return false;
		}
	}

	public static double log2(double a) {
		return Math.log(a)/Math.log(2);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);

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

		double p = 0;

		if(N < K) {

			for(int i=1;i<=N;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}

			p /= N;
		}else {
			for(int i=1;i<K;i++) {
				if(K%i == 0 && ispow2(K/i)) {
					p += Math.pow(2, -1*((int)(log2(K/i))));
				}else {
					p += Math.pow(2, -1*((int)(log2(K/i) + 1)));
				}
			}
			p /= N;

			p += (double)(N-K+1)/(double)N;
		}
		System.out.println(p);
	}

	public static boolean ispow2(int a) {
		int x = a & (a-1);
		if(x == 0) {
			return true;
		}else {
			return false;
		}
	}

	public static double log2(double a) {
		return Math.log(a)/Math.log(2);
	}
}
