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();
		double ans = 0;
		for(int i = 1; i <= N; i++) {
			int a = i;
			int h = 0;
			while(a < K) {
				h ++;
				a *= 2;
			}
			ans += (double)1/N/Math.pow(2,h);
		}
		System.out.println(ans);
	}

} 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();
		double ans = 0;
		for(int i = 1; i <= N; i++) {
			int a = i;
			int h = 0;
			while(a < K) {
				h ++;
				a *= 2;
			}
			ans += (double)1/N/Math.pow(2,h);
		}
		System.out.println(ans);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		double ans = 0;
		for(int i = 1; i <= N; i++) {
			int a = i;
			int h = 0;
			while(a < K) {
				h ++;
				a *= 2;
			}
			ans += (double)1/N/Math.pow(2,h);
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		double ans = 0;
		for(int i = 1; i <= N; i++) {
			int a = i;
			int h = 0;
			while(a < K) {
				h ++;
				a *= 2;
			}
			ans += (double)1/N/Math.pow(2,h);
		}
		System.out.println(ans);
	} 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 ans = 0; ans 0 for(int i = 1; i <= N; i++) {
			int a = i;
			int h = 0;
			while(a < K) {
				h ++;
				a *= 2;
			}
			ans += (double)1/N/Math.pow(2,h);
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			int a = i;
			int h = 0;
			while(a < K) {
				h ++;
				a *= 2;
			}
			ans += (double)1/N/Math.pow(2,h);
		} {
			int a = i;
			int h = 0;
			while(a < K) {
				h ++;
				a *= 2;
			}
			ans += (double)1/N/Math.pow(2,h);
		} int a = i; a i int h = 0; h 0 while(a < K) {
				h ++;
				a *= 2;
			} a < K a K {
				h ++;
				a *= 2;
			} h ++ h a *= 2 a 2 ans += (double)1/N/Math.pow(2,h) ans (double)1/N/Math.pow(2,h) (double)1/N/Math.pow(2,h) (double)1 N Math.pow(2,h) Math.pow Math 2 h System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		double ans = 0;
		for(int i = 1; i <= N; i++) {
			int a = i;
			int h = 0;
			while(a < K) {
				h ++;
				a *= 2;
			}
			ans += (double)1/N/Math.pow(2,h);
		}
		System.out.println(ans);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		double ans = 0;
		for(int i = 1; i <= N; i++) {
			int a = i;
			int h = 0;
			while(a < K) {
				h ++;
				a *= 2;
			}
			ans += (double)1/N/Math.pow(2,h);
		}
		System.out.println(ans);
	}

} 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();
		double ans = 0;
		for(int i = 1; i <= N; i++) {
			int a = i;
			int h = 0;
			while(a < K) {
				h ++;
				a *= 2;
			}
			ans += (double)1/N/Math.pow(2,h);
		}
		System.out.println(ans);
	}

}
