import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		ArrayList<Double> ary = new ArrayList<>();
		int i = 0;
		while (true){
			double num = k / Math.pow(2, i);
			if(num < 1){
				break;
			}
			ary.add(num);
			i++;
		}
		int[] coinNums = new int[n];
		int coinNum = ary.size();
		loop:
		for(int m = 1; m <= n; m++){
			while(ary.get(coinNum - 1) <= m ){
				coinNum--;
				if (coinNum == 0){
					break loop;
				}
			}
			coinNums[m - 1] = coinNum;
		}
		double ans = 0;
		for(int cn : coinNums){
			ans += 1 / (double)n / Math.pow(2, cn);
		}
		System.out.println(ans);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner 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();
		ArrayList<Double> ary = new ArrayList<>();
		int i = 0;
		while (true){
			double num = k / Math.pow(2, i);
			if(num < 1){
				break;
			}
			ary.add(num);
			i++;
		}
		int[] coinNums = new int[n];
		int coinNum = ary.size();
		loop:
		for(int m = 1; m <= n; m++){
			while(ary.get(coinNum - 1) <= m ){
				coinNum--;
				if (coinNum == 0){
					break loop;
				}
			}
			coinNums[m - 1] = coinNum;
		}
		double ans = 0;
		for(int cn : coinNums){
			ans += 1 / (double)n / Math.pow(2, cn);
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		ArrayList<Double> ary = new ArrayList<>();
		int i = 0;
		while (true){
			double num = k / Math.pow(2, i);
			if(num < 1){
				break;
			}
			ary.add(num);
			i++;
		}
		int[] coinNums = new int[n];
		int coinNum = ary.size();
		loop:
		for(int m = 1; m <= n; m++){
			while(ary.get(coinNum - 1) <= m ){
				coinNum--;
				if (coinNum == 0){
					break loop;
				}
			}
			coinNums[m - 1] = coinNum;
		}
		double ans = 0;
		for(int cn : coinNums){
			ans += 1 / (double)n / Math.pow(2, cn);
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		ArrayList<Double> ary = new ArrayList<>();
		int i = 0;
		while (true){
			double num = k / Math.pow(2, i);
			if(num < 1){
				break;
			}
			ary.add(num);
			i++;
		}
		int[] coinNums = new int[n];
		int coinNum = ary.size();
		loop:
		for(int m = 1; m <= n; m++){
			while(ary.get(coinNum - 1) <= m ){
				coinNum--;
				if (coinNum == 0){
					break loop;
				}
			}
			coinNums[m - 1] = coinNum;
		}
		double ans = 0;
		for(int cn : coinNums){
			ans += 1 / (double)n / Math.pow(2, cn);
		}
		System.out.println(ans);
	} 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 ArrayList<Double> ary = new ArrayList<>(); ary new ArrayList<>() int i = 0; i 0 while (true){
			double num = k / Math.pow(2, i);
			if(num < 1){
				break;
			}
			ary.add(num);
			i++;
		} true {
			double num = k / Math.pow(2, i);
			if(num < 1){
				break;
			}
			ary.add(num);
			i++;
		} double num = k / Math.pow(2, i); num k / Math.pow(2, i) k Math.pow(2, i) Math.pow Math 2 i if(num < 1){
				break;
			} num < 1 num 1 {
				break;
			} break; ary.add(num) ary.add ary num i++ i int[] coinNums = new int[n]; coinNums new int[n] n int coinNum = ary.size(); coinNum ary.size() ary.size ary double ans = 0; ans 0 for(int cn : coinNums){
			ans += 1 / (double)n / Math.pow(2, cn);
		} int cn coinNums {
			ans += 1 / (double)n / Math.pow(2, cn);
		} {
			ans += 1 / (double)n / Math.pow(2, cn);
		} ans += 1 / (double)n / Math.pow(2, cn) ans 1 / (double)n / Math.pow(2, cn) 1 / (double)n / Math.pow(2, cn) 1 (double)n Math.pow(2, cn) Math.pow Math 2 cn System.out.println(ans) System.out.println System.out System System.out ans 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();
		ArrayList<Double> ary = new ArrayList<>();
		int i = 0;
		while (true){
			double num = k / Math.pow(2, i);
			if(num < 1){
				break;
			}
			ary.add(num);
			i++;
		}
		int[] coinNums = new int[n];
		int coinNum = ary.size();
		loop:
		for(int m = 1; m <= n; m++){
			while(ary.get(coinNum - 1) <= m ){
				coinNum--;
				if (coinNum == 0){
					break loop;
				}
			}
			coinNums[m - 1] = coinNum;
		}
		double ans = 0;
		for(int cn : coinNums){
			ans += 1 / (double)n / Math.pow(2, cn);
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		ArrayList<Double> ary = new ArrayList<>();
		int i = 0;
		while (true){
			double num = k / Math.pow(2, i);
			if(num < 1){
				break;
			}
			ary.add(num);
			i++;
		}
		int[] coinNums = new int[n];
		int coinNum = ary.size();
		loop:
		for(int m = 1; m <= n; m++){
			while(ary.get(coinNum - 1) <= m ){
				coinNum--;
				if (coinNum == 0){
					break loop;
				}
			}
			coinNums[m - 1] = coinNum;
		}
		double ans = 0;
		for(int cn : coinNums){
			ans += 1 / (double)n / Math.pow(2, cn);
		}
		System.out.println(ans);
	}
} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		ArrayList<Double> ary = new ArrayList<>();
		int i = 0;
		while (true){
			double num = k / Math.pow(2, i);
			if(num < 1){
				break;
			}
			ary.add(num);
			i++;
		}
		int[] coinNums = new int[n];
		int coinNum = ary.size();
		loop:
		for(int m = 1; m <= n; m++){
			while(ary.get(coinNum - 1) <= m ){
				coinNum--;
				if (coinNum == 0){
					break loop;
				}
			}
			coinNums[m - 1] = coinNum;
		}
		double ans = 0;
		for(int cn : coinNums){
			ans += 1 / (double)n / Math.pow(2, cn);
		}
		System.out.println(ans);
	}
}
