import java.util.*;

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

        double n = sc.nextInt();
		double k = sc.nextInt();
		
		double rate = 0;
		int score = 0;

		for (int i = 0; i < n; i++) {
			score = i + 1;
			if (score < k) {
				int count = 0;
				while (score < k) {
					count++;
					score *= 2;
				}
				rate += (1/n) * Math.pow(0.5, count);
			} else {
				rate += 1 / n;
			}
		}

		System.out.println(rate);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

        double n = sc.nextInt();
		double k = sc.nextInt();
		
		double rate = 0;
		int score = 0;

		for (int i = 0; i < n; i++) {
			score = i + 1;
			if (score < k) {
				int count = 0;
				while (score < k) {
					count++;
					score *= 2;
				}
				rate += (1/n) * Math.pow(0.5, count);
			} else {
				rate += 1 / n;
			}
		}

		System.out.println(rate);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

        double n = sc.nextInt();
		double k = sc.nextInt();
		
		double rate = 0;
		int score = 0;

		for (int i = 0; i < n; i++) {
			score = i + 1;
			if (score < k) {
				int count = 0;
				while (score < k) {
					count++;
					score *= 2;
				}
				rate += (1/n) * Math.pow(0.5, count);
			} else {
				rate += 1 / n;
			}
		}

		System.out.println(rate);
	} main {
		Scanner sc = new Scanner(System.in);

        double n = sc.nextInt();
		double k = sc.nextInt();
		
		double rate = 0;
		int score = 0;

		for (int i = 0; i < n; i++) {
			score = i + 1;
			if (score < k) {
				int count = 0;
				while (score < k) {
					count++;
					score *= 2;
				}
				rate += (1/n) * Math.pow(0.5, count);
			} else {
				rate += 1 / n;
			}
		}

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

        double n = sc.nextInt();
		double k = sc.nextInt();
		
		double rate = 0;
		int score = 0;

		for (int i = 0; i < n; i++) {
			score = i + 1;
			if (score < k) {
				int count = 0;
				while (score < k) {
					count++;
					score *= 2;
				}
				rate += (1/n) * Math.pow(0.5, count);
			} else {
				rate += 1 / n;
			}
		}

		System.out.println(rate);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

        double n = sc.nextInt();
		double k = sc.nextInt();
		
		double rate = 0;
		int score = 0;

		for (int i = 0; i < n; i++) {
			score = i + 1;
			if (score < k) {
				int count = 0;
				while (score < k) {
					count++;
					score *= 2;
				}
				rate += (1/n) * Math.pow(0.5, count);
			} else {
				rate += 1 / n;
			}
		}

		System.out.println(rate);
	}
} Main
import java.util.*;

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

        double n = sc.nextInt();
		double k = sc.nextInt();
		
		double rate = 0;
		int score = 0;

		for (int i = 0; i < n; i++) {
			score = i + 1;
			if (score < k) {
				int count = 0;
				while (score < k) {
					count++;
					score *= 2;
				}
				rate += (1/n) * Math.pow(0.5, count);
			} else {
				rate += 1 / n;
			}
		}

		System.out.println(rate);
	}
}