import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
	int toReach(int cur, int target) {
		int ans = 0;
		while(cur < target) {
			cur <<= 1;
			++ans;
		}
		return ans;
	}
	void solve(Scanner in, PrintWriter out) {
		int n = in.nextInt(), k = in.nextInt();
		double ans = 0;
		for(int i = 1; i <= n; ++i) {
			int times = toReach(i, k);
			double div = 1;
			for(int j = 0; j < times; ++j) div *= 1 / 2.0;
			ans += (1 / (double)n) * div;
		}
		out.printf("%.10f\n", ans);
	}

	public static void main(String[] args) {
		try (Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out)) {
			new Main().solve(in, out);
		}
	}
} import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
	int toReach(int cur, int target) {
		int ans = 0;
		while(cur < target) {
			cur <<= 1;
			++ans;
		}
		return ans;
	}
	void solve(Scanner in, PrintWriter out) {
		int n = in.nextInt(), k = in.nextInt();
		double ans = 0;
		for(int i = 1; i <= n; ++i) {
			int times = toReach(i, k);
			double div = 1;
			for(int j = 0; j < times; ++j) div *= 1 / 2.0;
			ans += (1 / (double)n) * div;
		}
		out.printf("%.10f\n", ans);
	}

	public static void main(String[] args) {
		try (Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out)) {
			new Main().solve(in, out);
		}
	}
} Main int toReach(int cur, int target) {
		int ans = 0;
		while(cur < target) {
			cur <<= 1;
			++ans;
		}
		return ans;
	} toReach {
		int ans = 0;
		while(cur < target) {
			cur <<= 1;
			++ans;
		}
		return ans;
	} int ans = 0; ans 0 while(cur < target) {
			cur <<= 1;
			++ans;
		} cur < target cur target {
			cur <<= 1;
			++ans;
		} cur <<= 1 cur 1 ++ans ans return ans; ans int cur cur int target target void solve(Scanner in, PrintWriter out) {
		int n = in.nextInt(), k = in.nextInt();
		double ans = 0;
		for(int i = 1; i <= n; ++i) {
			int times = toReach(i, k);
			double div = 1;
			for(int j = 0; j < times; ++j) div *= 1 / 2.0;
			ans += (1 / (double)n) * div;
		}
		out.printf("%.10f\n", ans);
	} solve {
		int n = in.nextInt(), k = in.nextInt();
		double ans = 0;
		for(int i = 1; i <= n; ++i) {
			int times = toReach(i, k);
			double div = 1;
			for(int j = 0; j < times; ++j) div *= 1 / 2.0;
			ans += (1 / (double)n) * div;
		}
		out.printf("%.10f\n", ans);
	} int n = in.nextInt() n in.nextInt() in.nextInt in k = in.nextInt(); k in.nextInt() in.nextInt in double ans = 0; ans 0 for(int i = 1; i <= n; ++i) {
			int times = toReach(i, k);
			double div = 1;
			for(int j = 0; j < times; ++j) div *= 1 / 2.0;
			ans += (1 / (double)n) * div;
		} int i = 1; int i = 1; i 1 i <= n i n ++i ++i i {
			int times = toReach(i, k);
			double div = 1;
			for(int j = 0; j < times; ++j) div *= 1 / 2.0;
			ans += (1 / (double)n) * div;
		} {
			int times = toReach(i, k);
			double div = 1;
			for(int j = 0; j < times; ++j) div *= 1 / 2.0;
			ans += (1 / (double)n) * div;
		} int times = toReach(i, k); times toReach(i, k) toReach i k double div = 1; div 1 for(int j = 0; j < times; ++j) div *= 1 / 2.0; int j = 0; int j = 0; j 0 j < times j times ++j ++j j div *= 1 / 2.0; div *= 1 / 2.0 div 1 / 2.0 1 2.0 ans += (1 / (double)n) * div ans (1 / (double)n) * div (1 / (double)n) 1 (double)n div out.printf("%.10f\n", ans) out.printf out "%.10f\n" ans Scanner in in PrintWriter out out public static void main(String[] args) {
		try (Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out)) {
			new Main().solve(in, out);
		}
	} main {
		try (Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out)) {
			new Main().solve(in, out);
		}
	} try (Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out)) {
			new Main().solve(in, out);
		} {
			new Main().solve(in, out);
		} Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) PrintWriter out = new PrintWriter(System.out) PrintWriter out = new PrintWriter(System.out) new PrintWriter(System.out) new Main().solve(in, out) new Main().solve new Main() in out String[] args args public class Main {
	int toReach(int cur, int target) {
		int ans = 0;
		while(cur < target) {
			cur <<= 1;
			++ans;
		}
		return ans;
	}
	void solve(Scanner in, PrintWriter out) {
		int n = in.nextInt(), k = in.nextInt();
		double ans = 0;
		for(int i = 1; i <= n; ++i) {
			int times = toReach(i, k);
			double div = 1;
			for(int j = 0; j < times; ++j) div *= 1 / 2.0;
			ans += (1 / (double)n) * div;
		}
		out.printf("%.10f\n", ans);
	}

	public static void main(String[] args) {
		try (Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out)) {
			new Main().solve(in, out);
		}
	}
} public class Main {
	int toReach(int cur, int target) {
		int ans = 0;
		while(cur < target) {
			cur <<= 1;
			++ans;
		}
		return ans;
	}
	void solve(Scanner in, PrintWriter out) {
		int n = in.nextInt(), k = in.nextInt();
		double ans = 0;
		for(int i = 1; i <= n; ++i) {
			int times = toReach(i, k);
			double div = 1;
			for(int j = 0; j < times; ++j) div *= 1 / 2.0;
			ans += (1 / (double)n) * div;
		}
		out.printf("%.10f\n", ans);
	}

	public static void main(String[] args) {
		try (Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out)) {
			new Main().solve(in, out);
		}
	}
} Main
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
	int toReach(int cur, int target) {
		int ans = 0;
		while(cur < target) {
			cur <<= 1;
			++ans;
		}
		return ans;
	}
	void solve(Scanner in, PrintWriter out) {
		int n = in.nextInt(), k = in.nextInt();
		double ans = 0;
		for(int i = 1; i <= n; ++i) {
			int times = toReach(i, k);
			double div = 1;
			for(int j = 0; j < times; ++j) div *= 1 / 2.0;
			ans += (1 / (double)n) * div;
		}
		out.printf("%.10f\n", ans);
	}

	public static void main(String[] args) {
		try (Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out)) {
			new Main().solve(in, out);
		}
	}
}
