import java.util.*;

/**
 * Main
 */
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int K = sc.nextInt();
		int point;
		double kakuritu = 1.0000000000;
		double ans = 0.0000000000;
		for(int i=1;i<=N;i++){
			kakuritu = 1.0000000000/N;
			point = i;
			while(point<K){
				kakuritu *= 0.5;
				point *= 2;
			}
			ans += kakuritu;
		}
		sc.close();
		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();
		int point;
		double kakuritu = 1.0000000000;
		double ans = 0.0000000000;
		for(int i=1;i<=N;i++){
			kakuritu = 1.0000000000/N;
			point = i;
			while(point<K){
				kakuritu *= 0.5;
				point *= 2;
			}
			ans += kakuritu;
		}
		sc.close();
		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();
		int point;
		double kakuritu = 1.0000000000;
		double ans = 0.0000000000;
		for(int i=1;i<=N;i++){
			kakuritu = 1.0000000000/N;
			point = i;
			while(point<K){
				kakuritu *= 0.5;
				point *= 2;
			}
			ans += kakuritu;
		}
		sc.close();
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int K = sc.nextInt();
		int point;
		double kakuritu = 1.0000000000;
		double ans = 0.0000000000;
		for(int i=1;i<=N;i++){
			kakuritu = 1.0000000000/N;
			point = i;
			while(point<K){
				kakuritu *= 0.5;
				point *= 2;
			}
			ans += kakuritu;
		}
		sc.close();
		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 int point; point double kakuritu = 1.0000000000; kakuritu 1.0000000000 double ans = 0.0000000000; ans 0.0000000000 for(int i=1;i<=N;i++){
			kakuritu = 1.0000000000/N;
			point = i;
			while(point<K){
				kakuritu *= 0.5;
				point *= 2;
			}
			ans += kakuritu;
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
			kakuritu = 1.0000000000/N;
			point = i;
			while(point<K){
				kakuritu *= 0.5;
				point *= 2;
			}
			ans += kakuritu;
		} {
			kakuritu = 1.0000000000/N;
			point = i;
			while(point<K){
				kakuritu *= 0.5;
				point *= 2;
			}
			ans += kakuritu;
		} kakuritu = 1.0000000000/N kakuritu 1.0000000000/N 1.0000000000 N point = i point i while(point<K){
				kakuritu *= 0.5;
				point *= 2;
			} point<K point K {
				kakuritu *= 0.5;
				point *= 2;
			} kakuritu *= 0.5 kakuritu 0.5 point *= 2 point 2 ans += kakuritu ans kakuritu sc.close() sc.close sc 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();
		int point;
		double kakuritu = 1.0000000000;
		double ans = 0.0000000000;
		for(int i=1;i<=N;i++){
			kakuritu = 1.0000000000/N;
			point = i;
			while(point<K){
				kakuritu *= 0.5;
				point *= 2;
			}
			ans += kakuritu;
		}
		sc.close();
		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();
		int point;
		double kakuritu = 1.0000000000;
		double ans = 0.0000000000;
		for(int i=1;i<=N;i++){
			kakuritu = 1.0000000000/N;
			point = i;
			while(point<K){
				kakuritu *= 0.5;
				point *= 2;
			}
			ans += kakuritu;
		}
		sc.close();
		System.out.println(ans);
	}
} Main
import java.util.*;

/**
 * Main
 */
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		int K = sc.nextInt();
		int point;
		double kakuritu = 1.0000000000;
		double ans = 0.0000000000;
		for(int i=1;i<=N;i++){
			kakuritu = 1.0000000000/N;
			point = i;
			while(point<K){
				kakuritu *= 0.5;
				point *= 2;
			}
			ans += kakuritu;
		}
		sc.close();
		System.out.println(ans);
	}
};
