import java.time.Instant;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

public class Main {
	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();

		int[] cnt = new int[N];
		for(int i=0; i<N; i++){
			int c = 0;
			int n = i+1;
			while(n<K) {
				n= n*2;
				c++;
			}
			cnt[i]=c;
		}

		Double ans = 0.0;

		for(int i=0; i<N; i++) {
			ans += (double) 1 / N * (double) (1 / Math.pow(2, cnt[i]));
		}

		System.out.println(ans);
	}
} import java.time.Instant; Instant java.time import java.util.*; util.* java import java.util.regex.Pattern; Pattern java.util.regex import java.util.stream.Collectors; Collectors java.util.stream public class Main {
	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();

		int[] cnt = new int[N];
		for(int i=0; i<N; i++){
			int c = 0;
			int n = i+1;
			while(n<K) {
				n= n*2;
				c++;
			}
			cnt[i]=c;
		}

		Double ans = 0.0;

		for(int i=0; i<N; i++) {
			ans += (double) 1 / N * (double) (1 / Math.pow(2, cnt[i]));
		}

		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[] cnt = new int[N];
		for(int i=0; i<N; i++){
			int c = 0;
			int n = i+1;
			while(n<K) {
				n= n*2;
				c++;
			}
			cnt[i]=c;
		}

		Double ans = 0.0;

		for(int i=0; i<N; i++) {
			ans += (double) 1 / N * (double) (1 / Math.pow(2, cnt[i]));
		}

		System.out.println(ans);
	} main {

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();

		int[] cnt = new int[N];
		for(int i=0; i<N; i++){
			int c = 0;
			int n = i+1;
			while(n<K) {
				n= n*2;
				c++;
			}
			cnt[i]=c;
		}

		Double ans = 0.0;

		for(int i=0; i<N; i++) {
			ans += (double) 1 / N * (double) (1 / Math.pow(2, cnt[i]));
		}

		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[] cnt = new int[N]; cnt new int[N] N for(int i=0; i<N; i++){
			int c = 0;
			int n = i+1;
			while(n<K) {
				n= n*2;
				c++;
			}
			cnt[i]=c;
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			int c = 0;
			int n = i+1;
			while(n<K) {
				n= n*2;
				c++;
			}
			cnt[i]=c;
		} {
			int c = 0;
			int n = i+1;
			while(n<K) {
				n= n*2;
				c++;
			}
			cnt[i]=c;
		} int c = 0; c 0 int n = i+1; n i+1 i 1 while(n<K) {
				n= n*2;
				c++;
			} n<K n K {
				n= n*2;
				c++;
			} n= n*2 n n*2 n 2 c++ c cnt[i]=c cnt[i] cnt i c Double ans = 0.0; ans 0.0 for(int i=0; i<N; i++) {
			ans += (double) 1 / N * (double) (1 / Math.pow(2, cnt[i]));
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			ans += (double) 1 / N * (double) (1 / Math.pow(2, cnt[i]));
		} {
			ans += (double) 1 / N * (double) (1 / Math.pow(2, cnt[i]));
		} ans += (double) 1 / N * (double) (1 / Math.pow(2, cnt[i])) ans (double) 1 / N * (double) (1 / Math.pow(2, cnt[i])) (double) 1 / N (double) 1 N (double) (1 / Math.pow(2, cnt[i])) 1 Math.pow(2, cnt[i]) Math.pow Math 2 cnt[i] cnt i 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[] cnt = new int[N];
		for(int i=0; i<N; i++){
			int c = 0;
			int n = i+1;
			while(n<K) {
				n= n*2;
				c++;
			}
			cnt[i]=c;
		}

		Double ans = 0.0;

		for(int i=0; i<N; i++) {
			ans += (double) 1 / N * (double) (1 / Math.pow(2, cnt[i]));
		}

		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[] cnt = new int[N];
		for(int i=0; i<N; i++){
			int c = 0;
			int n = i+1;
			while(n<K) {
				n= n*2;
				c++;
			}
			cnt[i]=c;
		}

		Double ans = 0.0;

		for(int i=0; i<N; i++) {
			ans += (double) 1 / N * (double) (1 / Math.pow(2, cnt[i]));
		}

		System.out.println(ans);
	}
} Main
import java.time.Instant;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

public class Main {
	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();

		int[] cnt = new int[N];
		for(int i=0; i<N; i++){
			int c = 0;
			int n = i+1;
			while(n<K) {
				n= n*2;
				c++;
			}
			cnt[i]=c;
		}

		Double ans = 0.0;

		for(int i=0; i<N; i++) {
			ans += (double) 1 / N * (double) (1 / Math.pow(2, cnt[i]));
		}

		System.out.println(ans);
	}
}