import java.util.*;

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;
		for (int i=0;i<N;i++) {
			ans+=(double)1/N*Math.pow(0.5,binarysearch(K,i+1));
		}
		System.out.println(ans);
	}

	static int binarysearch(int x,int y) {
		int low=0;
		int high=20;
		if (x<=y) {
			return 0;
		}
		while (low+1<high) {
			int mid=(low+high)/2;
			double guess=y*Math.pow(2,mid);
			if (guess==x) {
				return mid;
			} else if (guess > x) {
				high = mid;
			} else {
				low = mid;
			}
		}
		return high;
	}
} import java.util.*; util.* java 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;
		for (int i=0;i<N;i++) {
			ans+=(double)1/N*Math.pow(0.5,binarysearch(K,i+1));
		}
		System.out.println(ans);
	}

	static int binarysearch(int x,int y) {
		int low=0;
		int high=20;
		if (x<=y) {
			return 0;
		}
		while (low+1<high) {
			int mid=(low+high)/2;
			double guess=y*Math.pow(2,mid);
			if (guess==x) {
				return mid;
			} else if (guess > x) {
				high = mid;
			} else {
				low = mid;
			}
		}
		return high;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		double ans = 0;
		for (int i=0;i<N;i++) {
			ans+=(double)1/N*Math.pow(0.5,binarysearch(K,i+1));
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		double ans = 0;
		for (int i=0;i<N;i++) {
			ans+=(double)1/N*Math.pow(0.5,binarysearch(K,i+1));
		}
		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; ans 0 for (int i=0;i<N;i++) {
			ans+=(double)1/N*Math.pow(0.5,binarysearch(K,i+1));
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			ans+=(double)1/N*Math.pow(0.5,binarysearch(K,i+1));
		} {
			ans+=(double)1/N*Math.pow(0.5,binarysearch(K,i+1));
		} ans+=(double)1/N*Math.pow(0.5,binarysearch(K,i+1)) ans (double)1/N*Math.pow(0.5,binarysearch(K,i+1)) (double)1/N (double)1 N Math.pow(0.5,binarysearch(K,i+1)) Math.pow Math 0.5 binarysearch(K,i+1) binarysearch K i+1 i 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args static int binarysearch(int x,int y) {
		int low=0;
		int high=20;
		if (x<=y) {
			return 0;
		}
		while (low+1<high) {
			int mid=(low+high)/2;
			double guess=y*Math.pow(2,mid);
			if (guess==x) {
				return mid;
			} else if (guess > x) {
				high = mid;
			} else {
				low = mid;
			}
		}
		return high;
	} binarysearch {
		int low=0;
		int high=20;
		if (x<=y) {
			return 0;
		}
		while (low+1<high) {
			int mid=(low+high)/2;
			double guess=y*Math.pow(2,mid);
			if (guess==x) {
				return mid;
			} else if (guess > x) {
				high = mid;
			} else {
				low = mid;
			}
		}
		return high;
	} int low=0; low 0 int high=20; high 20 if (x<=y) {
			return 0;
		} x<=y x y {
			return 0;
		} return 0; 0 while (low+1<high) {
			int mid=(low+high)/2;
			double guess=y*Math.pow(2,mid);
			if (guess==x) {
				return mid;
			} else if (guess > x) {
				high = mid;
			} else {
				low = mid;
			}
		} low+1<high low+1 low 1 high {
			int mid=(low+high)/2;
			double guess=y*Math.pow(2,mid);
			if (guess==x) {
				return mid;
			} else if (guess > x) {
				high = mid;
			} else {
				low = mid;
			}
		} int mid=(low+high)/2; mid (low+high)/2 (low+high) low high 2 double guess=y*Math.pow(2,mid); guess y*Math.pow(2,mid) y Math.pow(2,mid) Math.pow Math 2 mid if (guess==x) {
				return mid;
			} else if (guess > x) {
				high = mid;
			} else {
				low = mid;
			} guess==x guess x {
				return mid;
			} return mid; mid if (guess > x) {
				high = mid;
			} else {
				low = mid;
			} guess > x guess x {
				high = mid;
			} high = mid high mid {
				low = mid;
			} low = mid low mid return high; high int x x int y y
import java.util.*;

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;
		for (int i=0;i<N;i++) {
			ans+=(double)1/N*Math.pow(0.5,binarysearch(K,i+1));
		}
		System.out.println(ans);
	}

	static int binarysearch(int x,int y) {
		int low=0;
		int high=20;
		if (x<=y) {
			return 0;
		}
		while (low+1<high) {
			int mid=(low+high)/2;
			double guess=y*Math.pow(2,mid);
			if (guess==x) {
				return mid;
			} else if (guess > x) {
				high = mid;
			} else {
				low = mid;
			}
		}
		return high;
	}
}