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.0;
		for (int i = 1; i <= N; i++) {
			double tmp = 1.0/N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		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.0;
		for (int i = 1; i <= N; i++) {
			double tmp = 1.0/N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		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.0;
		for (int i = 1; i <= N; i++) {
			double tmp = 1.0/N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		double ans = 0.0;
		for (int i = 1; i <= N; i++) {
			double tmp = 1.0/N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		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.0; ans 0.0 for (int i = 1; i <= N; i++) {
			double tmp = 1.0/N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			double tmp = 1.0/N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		} {
			double tmp = 1.0/N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		} double tmp = 1.0/N; tmp 1.0/N 1.0 N int now = i; now i while (now < K) {
				now *= 2;
				tmp /= 2;
			} now < K now K {
				now *= 2;
				tmp /= 2;
			} now *= 2 now 2 tmp /= 2 tmp 2 ans += tmp ans tmp 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.0;
		for (int i = 1; i <= N; i++) {
			double tmp = 1.0/N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		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.0;
		for (int i = 1; i <= N; i++) {
			double tmp = 1.0/N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		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.0;
		for (int i = 1; i <= N; i++) {
			double tmp = 1.0/N;
			int now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;
		}
		System.out.println(ans);
	}
}