
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] lines = line.split(" ");
		int N = Integer.parseInt(lines[0]);
		int K = Integer.parseInt(lines[1]);

		double ans = 0;
		for(int i = 1; i < N+1; i++) {
			int count = 1;
			while(K > i*count) {
				count *= 2;
			}
			ans += 1/(double)count;
		}
		System.out.println(ans / N);
	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] lines = line.split(" ");
		int N = Integer.parseInt(lines[0]);
		int K = Integer.parseInt(lines[1]);

		double ans = 0;
		for(int i = 1; i < N+1; i++) {
			int count = 1;
			while(K > i*count) {
				count *= 2;
			}
			ans += 1/(double)count;
		}
		System.out.println(ans / N);
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] lines = line.split(" ");
		int N = Integer.parseInt(lines[0]);
		int K = Integer.parseInt(lines[1]);

		double ans = 0;
		for(int i = 1; i < N+1; i++) {
			int count = 1;
			while(K > i*count) {
				count *= 2;
			}
			ans += 1/(double)count;
		}
		System.out.println(ans / N);
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] lines = line.split(" ");
		int N = Integer.parseInt(lines[0]);
		int K = Integer.parseInt(lines[1]);

		double ans = 0;
		for(int i = 1; i < N+1; i++) {
			int count = 1;
			while(K > i*count) {
				count *= 2;
			}
			ans += 1/(double)count;
		}
		System.out.println(ans / N);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc String[] lines = line.split(" "); lines line.split(" ") line.split line " " int N = Integer.parseInt(lines[0]); N Integer.parseInt(lines[0]) Integer.parseInt Integer lines[0] lines 0 int K = Integer.parseInt(lines[1]); K Integer.parseInt(lines[1]) Integer.parseInt Integer lines[1] lines 1 double ans = 0; ans 0 for(int i = 1; i < N+1; i++) {
			int count = 1;
			while(K > i*count) {
				count *= 2;
			}
			ans += 1/(double)count;
		} int i = 1; int i = 1; i 1 i < N+1 i N+1 N 1 i++ i++ i {
			int count = 1;
			while(K > i*count) {
				count *= 2;
			}
			ans += 1/(double)count;
		} {
			int count = 1;
			while(K > i*count) {
				count *= 2;
			}
			ans += 1/(double)count;
		} int count = 1; count 1 while(K > i*count) {
				count *= 2;
			} K > i*count K i*count i count {
				count *= 2;
			} count *= 2 count 2 ans += 1/(double)count ans 1/(double)count 1 (double)count System.out.println(ans / N) System.out.println System.out System System.out ans / N ans N String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] lines = line.split(" ");
		int N = Integer.parseInt(lines[0]);
		int K = Integer.parseInt(lines[1]);

		double ans = 0;
		for(int i = 1; i < N+1; i++) {
			int count = 1;
			while(K > i*count) {
				count *= 2;
			}
			ans += 1/(double)count;
		}
		System.out.println(ans / N);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] lines = line.split(" ");
		int N = Integer.parseInt(lines[0]);
		int K = Integer.parseInt(lines[1]);

		double ans = 0;
		for(int i = 1; i < N+1; i++) {
			int count = 1;
			while(K > i*count) {
				count *= 2;
			}
			ans += 1/(double)count;
		}
		System.out.println(ans / N);
	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] lines = line.split(" ");
		int N = Integer.parseInt(lines[0]);
		int K = Integer.parseInt(lines[1]);

		double ans = 0;
		for(int i = 1; i < N+1; i++) {
			int count = 1;
			while(K > i*count) {
				count *= 2;
			}
			ans += 1/(double)count;
		}
		System.out.println(ans / N);
	}

}
