#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
	int n, k;
	double rate = 0;
	cin >> n >> k;
	for (int i = 1; i <= n; i++) {
		double rate2 = 1;
		int n2 = i;
		while (n2 < k) {
			rate2 /= 2;
			n2 *= 2;
		}
		rate += rate2;
	}
	printf("%.10lf\n", rate / n);
	return 0;
}