
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double n = sc.nextDouble();
		double k = sc.nextDouble();
		sc.close();
		
		double p = 0;
		
		for(int i=1; i<=n; i++) {
			if(i<k) {
				p += 1/n * Math.pow(0.5, (int)(Math.log10((k-1)/i)/Math.log10(2)+1));
			}else {
				p += 1/n;
			}
		}
		System.out.println(p);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double n = sc.nextDouble();
		double k = sc.nextDouble();
		sc.close();
		
		double p = 0;
		
		for(int i=1; i<=n; i++) {
			if(i<k) {
				p += 1/n * Math.pow(0.5, (int)(Math.log10((k-1)/i)/Math.log10(2)+1));
			}else {
				p += 1/n;
			}
		}
		System.out.println(p);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double n = sc.nextDouble();
		double k = sc.nextDouble();
		sc.close();
		
		double p = 0;
		
		for(int i=1; i<=n; i++) {
			if(i<k) {
				p += 1/n * Math.pow(0.5, (int)(Math.log10((k-1)/i)/Math.log10(2)+1));
			}else {
				p += 1/n;
			}
		}
		System.out.println(p);
	} main {
		Scanner sc = new Scanner(System.in);
		double n = sc.nextDouble();
		double k = sc.nextDouble();
		sc.close();
		
		double p = 0;
		
		for(int i=1; i<=n; i++) {
			if(i<k) {
				p += 1/n * Math.pow(0.5, (int)(Math.log10((k-1)/i)/Math.log10(2)+1));
			}else {
				p += 1/n;
			}
		}
		System.out.println(p);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double n = sc.nextDouble(); n sc.nextDouble() sc.nextDouble sc double k = sc.nextDouble(); k sc.nextDouble() sc.nextDouble sc sc.close() sc.close sc double p = 0; p 0 for(int i=1; i<=n; i++) {
			if(i<k) {
				p += 1/n * Math.pow(0.5, (int)(Math.log10((k-1)/i)/Math.log10(2)+1));
			}else {
				p += 1/n;
			}
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			if(i<k) {
				p += 1/n * Math.pow(0.5, (int)(Math.log10((k-1)/i)/Math.log10(2)+1));
			}else {
				p += 1/n;
			}
		} {
			if(i<k) {
				p += 1/n * Math.pow(0.5, (int)(Math.log10((k-1)/i)/Math.log10(2)+1));
			}else {
				p += 1/n;
			}
		} if(i<k) {
				p += 1/n * Math.pow(0.5, (int)(Math.log10((k-1)/i)/Math.log10(2)+1));
			}else {
				p += 1/n;
			} i<k i k {
				p += 1/n * Math.pow(0.5, (int)(Math.log10((k-1)/i)/Math.log10(2)+1));
			} p += 1/n * Math.pow(0.5, (int)(Math.log10((k-1)/i)/Math.log10(2)+1)) p 1/n * Math.pow(0.5, (int)(Math.log10((k-1)/i)/Math.log10(2)+1)) 1/n 1 n Math.pow(0.5, (int)(Math.log10((k-1)/i)/Math.log10(2)+1)) Math.pow Math 0.5 (int)(Math.log10((k-1)/i)/Math.log10(2)+1) Math.log10((k-1)/i)/Math.log10(2) Math.log10((k-1)/i) Math.log10 Math (k-1)/i (k-1) k 1 i Math.log10(2) Math.log10 Math 2 1 {
				p += 1/n;
			} p += 1/n p 1/n 1 n System.out.println(p) System.out.println System.out System System.out p String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double n = sc.nextDouble();
		double k = sc.nextDouble();
		sc.close();
		
		double p = 0;
		
		for(int i=1; i<=n; i++) {
			if(i<k) {
				p += 1/n * Math.pow(0.5, (int)(Math.log10((k-1)/i)/Math.log10(2)+1));
			}else {
				p += 1/n;
			}
		}
		System.out.println(p);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double n = sc.nextDouble();
		double k = sc.nextDouble();
		sc.close();
		
		double p = 0;
		
		for(int i=1; i<=n; i++) {
			if(i<k) {
				p += 1/n * Math.pow(0.5, (int)(Math.log10((k-1)/i)/Math.log10(2)+1));
			}else {
				p += 1/n;
			}
		}
		System.out.println(p);
	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double n = sc.nextDouble();
		double k = sc.nextDouble();
		sc.close();
		
		double p = 0;
		
		for(int i=1; i<=n; i++) {
			if(i<k) {
				p += 1/n * Math.pow(0.5, (int)(Math.log10((k-1)/i)/Math.log10(2)+1));
			}else {
				p += 1/n;
			}
		}
		System.out.println(p);
	}

}
