import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double total = 0;
		for (int i = 1; i <= n; i++) {
		    int x = i;
		    double base = 1.0 / n;
		    while (x < k) {
		        x *= 2;
		        base /= 2;
		    }
		    total += base;
		}
		System.out.println(total);
   }
} import java.util.*; util.* java public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double total = 0;
		for (int i = 1; i <= n; i++) {
		    int x = i;
		    double base = 1.0 / n;
		    while (x < k) {
		        x *= 2;
		        base /= 2;
		    }
		    total += base;
		}
		System.out.println(total);
   }
} Main public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double total = 0;
		for (int i = 1; i <= n; i++) {
		    int x = i;
		    double base = 1.0 / n;
		    while (x < k) {
		        x *= 2;
		        base /= 2;
		    }
		    total += base;
		}
		System.out.println(total);
   } main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double total = 0;
		for (int i = 1; i <= n; i++) {
		    int x = i;
		    double base = 1.0 / n;
		    while (x < k) {
		        x *= 2;
		        base /= 2;
		    }
		    total += base;
		}
		System.out.println(total);
   } 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 total = 0; total 0 for (int i = 1; i <= n; i++) {
		    int x = i;
		    double base = 1.0 / n;
		    while (x < k) {
		        x *= 2;
		        base /= 2;
		    }
		    total += base;
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
		    int x = i;
		    double base = 1.0 / n;
		    while (x < k) {
		        x *= 2;
		        base /= 2;
		    }
		    total += base;
		} {
		    int x = i;
		    double base = 1.0 / n;
		    while (x < k) {
		        x *= 2;
		        base /= 2;
		    }
		    total += base;
		} int x = i; x i double base = 1.0 / n; base 1.0 / n 1.0 n while (x < k) {
		        x *= 2;
		        base /= 2;
		    } x < k x k {
		        x *= 2;
		        base /= 2;
		    } x *= 2 x 2 base /= 2 base 2 total += base total base System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double total = 0;
		for (int i = 1; i <= n; i++) {
		    int x = i;
		    double base = 1.0 / n;
		    while (x < k) {
		        x *= 2;
		        base /= 2;
		    }
		    total += base;
		}
		System.out.println(total);
   }
} public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double total = 0;
		for (int i = 1; i <= n; i++) {
		    int x = i;
		    double base = 1.0 / n;
		    while (x < k) {
		        x *= 2;
		        base /= 2;
		    }
		    total += base;
		}
		System.out.println(total);
   }
} Main
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double total = 0;
		for (int i = 1; i <= n; i++) {
		    int x = i;
		    double base = 1.0 / n;
		    while (x < k) {
		        x *= 2;
		        base /= 2;
		    }
		    total += base;
		}
		System.out.println(total);
   }
}
