import java.io.*;

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader r = new BufferedReader (new InputStreamReader (System.in));
		String s1 = r.readLine();
		long num = Long.valueOf(s1.split(" ")[0]);
		long count = Long.valueOf(s1.split(" ")[1]);
		double val = 0.0d;

		double kitei = ((double)1 / num);
		for (long i = 1; i <= num; i++) {
			if (i >= count) {
				val += kitei;
				continue;
			}
			
			double v = 1;
			long v2 = i;
			for (long j = 0; j < count; j++) {
				v2 = v2 * 2;
				v = v / 2;
				if (v2 >= count) {
					val += kitei * v;
					break;
				}
			}
		}
		
		System.out.println(val);
	}
} import java.io.*; io.* java class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader r = new BufferedReader (new InputStreamReader (System.in));
		String s1 = r.readLine();
		long num = Long.valueOf(s1.split(" ")[0]);
		long count = Long.valueOf(s1.split(" ")[1]);
		double val = 0.0d;

		double kitei = ((double)1 / num);
		for (long i = 1; i <= num; i++) {
			if (i >= count) {
				val += kitei;
				continue;
			}
			
			double v = 1;
			long v2 = i;
			for (long j = 0; j < count; j++) {
				v2 = v2 * 2;
				v = v / 2;
				if (v2 >= count) {
					val += kitei * v;
					break;
				}
			}
		}
		
		System.out.println(val);
	}
} Main public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader r = new BufferedReader (new InputStreamReader (System.in));
		String s1 = r.readLine();
		long num = Long.valueOf(s1.split(" ")[0]);
		long count = Long.valueOf(s1.split(" ")[1]);
		double val = 0.0d;

		double kitei = ((double)1 / num);
		for (long i = 1; i <= num; i++) {
			if (i >= count) {
				val += kitei;
				continue;
			}
			
			double v = 1;
			long v2 = i;
			for (long j = 0; j < count; j++) {
				v2 = v2 * 2;
				v = v / 2;
				if (v2 >= count) {
					val += kitei * v;
					break;
				}
			}
		}
		
		System.out.println(val);
	} main {
		BufferedReader r = new BufferedReader (new InputStreamReader (System.in));
		String s1 = r.readLine();
		long num = Long.valueOf(s1.split(" ")[0]);
		long count = Long.valueOf(s1.split(" ")[1]);
		double val = 0.0d;

		double kitei = ((double)1 / num);
		for (long i = 1; i <= num; i++) {
			if (i >= count) {
				val += kitei;
				continue;
			}
			
			double v = 1;
			long v2 = i;
			for (long j = 0; j < count; j++) {
				v2 = v2 * 2;
				v = v / 2;
				if (v2 >= count) {
					val += kitei * v;
					break;
				}
			}
		}
		
		System.out.println(val);
	} BufferedReader r = new BufferedReader (new InputStreamReader (System.in)); r new BufferedReader (new InputStreamReader (System.in)) String s1 = r.readLine(); s1 r.readLine() r.readLine r long num = Long.valueOf(s1.split(" ")[0]); num Long.valueOf(s1.split(" ")[0]) Long.valueOf Long s1.split(" ")[0] s1.split(" ") s1.split s1 " " 0 long count = Long.valueOf(s1.split(" ")[1]); count Long.valueOf(s1.split(" ")[1]) Long.valueOf Long s1.split(" ")[1] s1.split(" ") s1.split s1 " " 1 double val = 0.0d; val 0.0d double kitei = ((double)1 / num); kitei ((double)1 / num) (double)1 num for (long i = 1; i <= num; i++) {
			if (i >= count) {
				val += kitei;
				continue;
			}
			
			double v = 1;
			long v2 = i;
			for (long j = 0; j < count; j++) {
				v2 = v2 * 2;
				v = v / 2;
				if (v2 >= count) {
					val += kitei * v;
					break;
				}
			}
		} long i = 1; long i = 1; i 1 i <= num i num i++ i++ i {
			if (i >= count) {
				val += kitei;
				continue;
			}
			
			double v = 1;
			long v2 = i;
			for (long j = 0; j < count; j++) {
				v2 = v2 * 2;
				v = v / 2;
				if (v2 >= count) {
					val += kitei * v;
					break;
				}
			}
		} {
			if (i >= count) {
				val += kitei;
				continue;
			}
			
			double v = 1;
			long v2 = i;
			for (long j = 0; j < count; j++) {
				v2 = v2 * 2;
				v = v / 2;
				if (v2 >= count) {
					val += kitei * v;
					break;
				}
			}
		} if (i >= count) {
				val += kitei;
				continue;
			} i >= count i count {
				val += kitei;
				continue;
			} val += kitei val kitei continue; double v = 1; v 1 long v2 = i; v2 i for (long j = 0; j < count; j++) {
				v2 = v2 * 2;
				v = v / 2;
				if (v2 >= count) {
					val += kitei * v;
					break;
				}
			} long j = 0; long j = 0; j 0 j < count j count j++ j++ j {
				v2 = v2 * 2;
				v = v / 2;
				if (v2 >= count) {
					val += kitei * v;
					break;
				}
			} {
				v2 = v2 * 2;
				v = v / 2;
				if (v2 >= count) {
					val += kitei * v;
					break;
				}
			} v2 = v2 * 2 v2 v2 * 2 v2 2 v = v / 2 v v / 2 v 2 if (v2 >= count) {
					val += kitei * v;
					break;
				} v2 >= count v2 count {
					val += kitei * v;
					break;
				} val += kitei * v val kitei * v kitei v break; System.out.println(val) System.out.println System.out System System.out val String[] args args
import java.io.*;

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader r = new BufferedReader (new InputStreamReader (System.in));
		String s1 = r.readLine();
		long num = Long.valueOf(s1.split(" ")[0]);
		long count = Long.valueOf(s1.split(" ")[1]);
		double val = 0.0d;

		double kitei = ((double)1 / num);
		for (long i = 1; i <= num; i++) {
			if (i >= count) {
				val += kitei;
				continue;
			}
			
			double v = 1;
			long v2 = i;
			for (long j = 0; j < count; j++) {
				v2 = v2 * 2;
				v = v / 2;
				if (v2 >= count) {
					val += kitei * v;
					break;
				}
			}
		}
		
		System.out.println(val);
	}
}
