import java.util.Scanner;

public class Main
{

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		double n = Integer.parseInt(sc.next());
		double k = Integer.parseInt(sc.next());

		double sum = 0;

		for (int i = 1; i <= n; i++) {
			if (i >= k) {
				sum += 1.0;
			} else {
				sum += Math.pow(0.5, Math.ceil(log2(k/i)));
			}
		}

		System.out.println(sum / n);

		sc.close();
	}

	public static double log2(double d)
	{
		return Math.log(d) / Math.log(2);
	}
} import java.util.Scanner; Scanner java.util public class Main
{

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		double n = Integer.parseInt(sc.next());
		double k = Integer.parseInt(sc.next());

		double sum = 0;

		for (int i = 1; i <= n; i++) {
			if (i >= k) {
				sum += 1.0;
			} else {
				sum += Math.pow(0.5, Math.ceil(log2(k/i)));
			}
		}

		System.out.println(sum / n);

		sc.close();
	}

	public static double log2(double d)
	{
		return Math.log(d) / Math.log(2);
	}
} Main public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		double n = Integer.parseInt(sc.next());
		double k = Integer.parseInt(sc.next());

		double sum = 0;

		for (int i = 1; i <= n; i++) {
			if (i >= k) {
				sum += 1.0;
			} else {
				sum += Math.pow(0.5, Math.ceil(log2(k/i)));
			}
		}

		System.out.println(sum / n);

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		double n = Integer.parseInt(sc.next());
		double k = Integer.parseInt(sc.next());

		double sum = 0;

		for (int i = 1; i <= n; i++) {
			if (i >= k) {
				sum += 1.0;
			} else {
				sum += Math.pow(0.5, Math.ceil(log2(k/i)));
			}
		}

		System.out.println(sum / n);

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc double k = Integer.parseInt(sc.next()); k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc double sum = 0; sum 0 for (int i = 1; i <= n; i++) {
			if (i >= k) {
				sum += 1.0;
			} else {
				sum += Math.pow(0.5, Math.ceil(log2(k/i)));
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			if (i >= k) {
				sum += 1.0;
			} else {
				sum += Math.pow(0.5, Math.ceil(log2(k/i)));
			}
		} {
			if (i >= k) {
				sum += 1.0;
			} else {
				sum += Math.pow(0.5, Math.ceil(log2(k/i)));
			}
		} if (i >= k) {
				sum += 1.0;
			} else {
				sum += Math.pow(0.5, Math.ceil(log2(k/i)));
			} i >= k i k {
				sum += 1.0;
			} sum += 1.0 sum 1.0 {
				sum += Math.pow(0.5, Math.ceil(log2(k/i)));
			} sum += Math.pow(0.5, Math.ceil(log2(k/i))) sum Math.pow(0.5, Math.ceil(log2(k/i))) Math.pow Math 0.5 Math.ceil(log2(k/i)) Math.ceil Math log2(k/i) log2 k/i k i System.out.println(sum / n) System.out.println System.out System System.out sum / n sum n sc.close() sc.close sc String[] args args public static double log2(double d)
	{
		return Math.log(d) / Math.log(2);
	} log2 {
		return Math.log(d) / Math.log(2);
	} return Math.log(d) / Math.log(2); Math.log(d) / Math.log(2) Math.log(d) Math.log Math d Math.log(2) Math.log Math 2 double d d public class Main
{

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		double n = Integer.parseInt(sc.next());
		double k = Integer.parseInt(sc.next());

		double sum = 0;

		for (int i = 1; i <= n; i++) {
			if (i >= k) {
				sum += 1.0;
			} else {
				sum += Math.pow(0.5, Math.ceil(log2(k/i)));
			}
		}

		System.out.println(sum / n);

		sc.close();
	}

	public static double log2(double d)
	{
		return Math.log(d) / Math.log(2);
	}
} public class Main
{

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		double n = Integer.parseInt(sc.next());
		double k = Integer.parseInt(sc.next());

		double sum = 0;

		for (int i = 1; i <= n; i++) {
			if (i >= k) {
				sum += 1.0;
			} else {
				sum += Math.pow(0.5, Math.ceil(log2(k/i)));
			}
		}

		System.out.println(sum / n);

		sc.close();
	}

	public static double log2(double d)
	{
		return Math.log(d) / Math.log(2);
	}
} Main
import java.util.Scanner;

public class Main
{

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		double n = Integer.parseInt(sc.next());
		double k = Integer.parseInt(sc.next());

		double sum = 0;

		for (int i = 1; i <= n; i++) {
			if (i >= k) {
				sum += 1.0;
			} else {
				sum += Math.pow(0.5, Math.ceil(log2(k/i)));
			}
		}

		System.out.println(sum / n);

		sc.close();
	}

	public static double log2(double d)
	{
		return Math.log(d) / Math.log(2);
	}
}
