import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();
		double ans = 0;
		if(n<k) {
			long count = 0;
			for(int i=1;i<=n;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			ans = (double)count/(double)(1<<20)/n;
		}else {
			long count = 0;
			for(int i=1;i<=k-1;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			double ans1 = (double)(n-k+1)/(double)n;
			double ans2 = (double)count/(double)(1<<20)/n;
			ans = ans1 + ans2;
		}
		System.out.println(ans);
		in.close();
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();
		double ans = 0;
		if(n<k) {
			long count = 0;
			for(int i=1;i<=n;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			ans = (double)count/(double)(1<<20)/n;
		}else {
			long count = 0;
			for(int i=1;i<=k-1;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			double ans1 = (double)(n-k+1)/(double)n;
			double ans2 = (double)count/(double)(1<<20)/n;
			ans = ans1 + ans2;
		}
		System.out.println(ans);
		in.close();
	}

} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();
		double ans = 0;
		if(n<k) {
			long count = 0;
			for(int i=1;i<=n;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			ans = (double)count/(double)(1<<20)/n;
		}else {
			long count = 0;
			for(int i=1;i<=k-1;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			double ans1 = (double)(n-k+1)/(double)n;
			double ans2 = (double)count/(double)(1<<20)/n;
			ans = ans1 + ans2;
		}
		System.out.println(ans);
		in.close();
	} main {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();
		double ans = 0;
		if(n<k) {
			long count = 0;
			for(int i=1;i<=n;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			ans = (double)count/(double)(1<<20)/n;
		}else {
			long count = 0;
			for(int i=1;i<=k-1;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			double ans1 = (double)(n-k+1)/(double)n;
			double ans2 = (double)count/(double)(1<<20)/n;
			ans = ans1 + ans2;
		}
		System.out.println(ans);
		in.close();
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int k = in.nextInt(); k in.nextInt() in.nextInt in double ans = 0; ans 0 if(n<k) {
			long count = 0;
			for(int i=1;i<=n;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			ans = (double)count/(double)(1<<20)/n;
		}else {
			long count = 0;
			for(int i=1;i<=k-1;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			double ans1 = (double)(n-k+1)/(double)n;
			double ans2 = (double)count/(double)(1<<20)/n;
			ans = ans1 + ans2;
		} n<k n k {
			long count = 0;
			for(int i=1;i<=n;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			ans = (double)count/(double)(1<<20)/n;
		} long count = 0; count 0 for(int i=1;i<=n;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			} {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			} int tmp_count = 1; tmp_count 1 while((i<<tmp_count)<k) {
					tmp_count++;
				} (i<<tmp_count)<k (i<<tmp_count) i tmp_count k {
					tmp_count++;
				} tmp_count++ tmp_count count += 1<<(20-tmp_count) count 1<<(20-tmp_count) 1 (20-tmp_count) 20 tmp_count ans = (double)count/(double)(1<<20)/n ans (double)count/(double)(1<<20)/n (double)count/(double)(1<<20)/n (double)count (double)(1<<20) 1 20 n {
			long count = 0;
			for(int i=1;i<=k-1;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			double ans1 = (double)(n-k+1)/(double)n;
			double ans2 = (double)count/(double)(1<<20)/n;
			ans = ans1 + ans2;
		} long count = 0; count 0 for(int i=1;i<=k-1;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			} int i=1; int i=1; i 1 i<=k-1 i k-1 k 1 i++ i++ i {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			} {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			} int tmp_count = 1; tmp_count 1 while((i<<tmp_count)<k) {
					tmp_count++;
				} (i<<tmp_count)<k (i<<tmp_count) i tmp_count k {
					tmp_count++;
				} tmp_count++ tmp_count count += 1<<(20-tmp_count) count 1<<(20-tmp_count) 1 (20-tmp_count) 20 tmp_count double ans1 = (double)(n-k+1)/(double)n; ans1 (double)(n-k+1)/(double)n (double)(n-k+1) n-k n k 1 (double)n double ans2 = (double)count/(double)(1<<20)/n; ans2 (double)count/(double)(1<<20)/n (double)count/(double)(1<<20)/n (double)count (double)(1<<20) 1 20 n ans = ans1 + ans2 ans ans1 + ans2 ans1 ans2 System.out.println(ans) System.out.println System.out System System.out ans in.close() in.close in String[] args args public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();
		double ans = 0;
		if(n<k) {
			long count = 0;
			for(int i=1;i<=n;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			ans = (double)count/(double)(1<<20)/n;
		}else {
			long count = 0;
			for(int i=1;i<=k-1;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			double ans1 = (double)(n-k+1)/(double)n;
			double ans2 = (double)count/(double)(1<<20)/n;
			ans = ans1 + ans2;
		}
		System.out.println(ans);
		in.close();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();
		double ans = 0;
		if(n<k) {
			long count = 0;
			for(int i=1;i<=n;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			ans = (double)count/(double)(1<<20)/n;
		}else {
			long count = 0;
			for(int i=1;i<=k-1;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			double ans1 = (double)(n-k+1)/(double)n;
			double ans2 = (double)count/(double)(1<<20)/n;
			ans = ans1 + ans2;
		}
		System.out.println(ans);
		in.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();
		double ans = 0;
		if(n<k) {
			long count = 0;
			for(int i=1;i<=n;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			ans = (double)count/(double)(1<<20)/n;
		}else {
			long count = 0;
			for(int i=1;i<=k-1;i++) {
				int tmp_count = 1;
				while((i<<tmp_count)<k) {
					tmp_count++;
				}
				count += 1<<(20-tmp_count);
			}
			double ans1 = (double)(n-k+1)/(double)n;
			double ans2 = (double)count/(double)(1<<20)/n;
			ans = ans1 + ans2;
		}
		System.out.println(ans);
		in.close();
	}

}
