import java.util.Arrays;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
	
	Scanner keyboard = new Scanner(System.in); 
	
	double N = keyboard.nextDouble();
	double K = keyboard.nextDouble();
	
	double S = 0.0;
	double ans = 0.0;
	
	if(N > K) {
		S = K - 1;
		ans +=  (1.0 / N * (N-K+1));
	}else {
		S = N;
	}
	
	for(int i = 1 ; i <= S; i++) {
		double P = 1.0 / N;
		int Q = i;
		
		while(Q < K) {
			Q = Q * 2;
			P = P * (1.0/2.0);
		}
		ans += P;
	}

	System.out.println(ans);
	keyboard.close();
	}	
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
public static void main(String[] args) {
	
	Scanner keyboard = new Scanner(System.in); 
	
	double N = keyboard.nextDouble();
	double K = keyboard.nextDouble();
	
	double S = 0.0;
	double ans = 0.0;
	
	if(N > K) {
		S = K - 1;
		ans +=  (1.0 / N * (N-K+1));
	}else {
		S = N;
	}
	
	for(int i = 1 ; i <= S; i++) {
		double P = 1.0 / N;
		int Q = i;
		
		while(Q < K) {
			Q = Q * 2;
			P = P * (1.0/2.0);
		}
		ans += P;
	}

	System.out.println(ans);
	keyboard.close();
	}	
} Main public static void main(String[] args) {
	
	Scanner keyboard = new Scanner(System.in); 
	
	double N = keyboard.nextDouble();
	double K = keyboard.nextDouble();
	
	double S = 0.0;
	double ans = 0.0;
	
	if(N > K) {
		S = K - 1;
		ans +=  (1.0 / N * (N-K+1));
	}else {
		S = N;
	}
	
	for(int i = 1 ; i <= S; i++) {
		double P = 1.0 / N;
		int Q = i;
		
		while(Q < K) {
			Q = Q * 2;
			P = P * (1.0/2.0);
		}
		ans += P;
	}

	System.out.println(ans);
	keyboard.close();
	} main {
	
	Scanner keyboard = new Scanner(System.in); 
	
	double N = keyboard.nextDouble();
	double K = keyboard.nextDouble();
	
	double S = 0.0;
	double ans = 0.0;
	
	if(N > K) {
		S = K - 1;
		ans +=  (1.0 / N * (N-K+1));
	}else {
		S = N;
	}
	
	for(int i = 1 ; i <= S; i++) {
		double P = 1.0 / N;
		int Q = i;
		
		while(Q < K) {
			Q = Q * 2;
			P = P * (1.0/2.0);
		}
		ans += P;
	}

	System.out.println(ans);
	keyboard.close();
	} Scanner keyboard = new Scanner(System.in); keyboard new Scanner(System.in) double N = keyboard.nextDouble(); N keyboard.nextDouble() keyboard.nextDouble keyboard double K = keyboard.nextDouble(); K keyboard.nextDouble() keyboard.nextDouble keyboard double S = 0.0; S 0.0 double ans = 0.0; ans 0.0 if(N > K) {
		S = K - 1;
		ans +=  (1.0 / N * (N-K+1));
	}else {
		S = N;
	} N > K N K {
		S = K - 1;
		ans +=  (1.0 / N * (N-K+1));
	} S = K - 1 S K - 1 K 1 ans +=  (1.0 / N * (N-K+1)) ans (1.0 / N * (N-K+1)) 1.0 / N 1.0 N (N-K+1) N-K N K 1 {
		S = N;
	} S = N S N for(int i = 1 ; i <= S; i++) {
		double P = 1.0 / N;
		int Q = i;
		
		while(Q < K) {
			Q = Q * 2;
			P = P * (1.0/2.0);
		}
		ans += P;
	} int i = 1 ; int i = 1 ; i 1 i <= S i S i++ i++ i {
		double P = 1.0 / N;
		int Q = i;
		
		while(Q < K) {
			Q = Q * 2;
			P = P * (1.0/2.0);
		}
		ans += P;
	} {
		double P = 1.0 / N;
		int Q = i;
		
		while(Q < K) {
			Q = Q * 2;
			P = P * (1.0/2.0);
		}
		ans += P;
	} double P = 1.0 / N; P 1.0 / N 1.0 N int Q = i; Q i while(Q < K) {
			Q = Q * 2;
			P = P * (1.0/2.0);
		} Q < K Q K {
			Q = Q * 2;
			P = P * (1.0/2.0);
		} Q = Q * 2 Q Q * 2 Q 2 P = P * (1.0/2.0) P P * (1.0/2.0) P (1.0/2.0) 1.0 2.0 ans += P ans P System.out.println(ans) System.out.println System.out System System.out ans keyboard.close() keyboard.close keyboard String[] args args public class Main {
public static void main(String[] args) {
	
	Scanner keyboard = new Scanner(System.in); 
	
	double N = keyboard.nextDouble();
	double K = keyboard.nextDouble();
	
	double S = 0.0;
	double ans = 0.0;
	
	if(N > K) {
		S = K - 1;
		ans +=  (1.0 / N * (N-K+1));
	}else {
		S = N;
	}
	
	for(int i = 1 ; i <= S; i++) {
		double P = 1.0 / N;
		int Q = i;
		
		while(Q < K) {
			Q = Q * 2;
			P = P * (1.0/2.0);
		}
		ans += P;
	}

	System.out.println(ans);
	keyboard.close();
	}	
} public class Main {
public static void main(String[] args) {
	
	Scanner keyboard = new Scanner(System.in); 
	
	double N = keyboard.nextDouble();
	double K = keyboard.nextDouble();
	
	double S = 0.0;
	double ans = 0.0;
	
	if(N > K) {
		S = K - 1;
		ans +=  (1.0 / N * (N-K+1));
	}else {
		S = N;
	}
	
	for(int i = 1 ; i <= S; i++) {
		double P = 1.0 / N;
		int Q = i;
		
		while(Q < K) {
			Q = Q * 2;
			P = P * (1.0/2.0);
		}
		ans += P;
	}

	System.out.println(ans);
	keyboard.close();
	}	
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
	
	Scanner keyboard = new Scanner(System.in); 
	
	double N = keyboard.nextDouble();
	double K = keyboard.nextDouble();
	
	double S = 0.0;
	double ans = 0.0;
	
	if(N > K) {
		S = K - 1;
		ans +=  (1.0 / N * (N-K+1));
	}else {
		S = N;
	}
	
	for(int i = 1 ; i <= S; i++) {
		double P = 1.0 / N;
		int Q = i;
		
		while(Q < K) {
			Q = Q * 2;
			P = P * (1.0/2.0);
		}
		ans += P;
	}

	System.out.println(ans);
	keyboard.close();
	}	
}
