import java.util.Scanner;

public class Main {

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

		double me = sc.nextInt();
		int point = sc.nextInt();
		int count = 0;
		double anser = 0;
		//サイコロの目
			for(int i = 1; i <= me ; i++) {
				double sai = 1.0/me;
				int win = i;
				//コインの振った回数
				while(win<point) {
					win = win*2;
					sai = sai/2;
				}
				anser += sai;
			}
			System.out.println(anser);
		}
	} import java.util.Scanner; Scanner java.util public class Main {

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

		double me = sc.nextInt();
		int point = sc.nextInt();
		int count = 0;
		double anser = 0;
		//サイコロの目
			for(int i = 1; i <= me ; i++) {
				double sai = 1.0/me;
				int win = i;
				//コインの振った回数
				while(win<point) {
					win = win*2;
					sai = sai/2;
				}
				anser += sai;
			}
			System.out.println(anser);
		}
	} Main public static void main(String[] args) {
		Scanner sc =new Scanner(System.in);

		double me = sc.nextInt();
		int point = sc.nextInt();
		int count = 0;
		double anser = 0;
		//サイコロの目
			for(int i = 1; i <= me ; i++) {
				double sai = 1.0/me;
				int win = i;
				//コインの振った回数
				while(win<point) {
					win = win*2;
					sai = sai/2;
				}
				anser += sai;
			}
			System.out.println(anser);
		} main {
		Scanner sc =new Scanner(System.in);

		double me = sc.nextInt();
		int point = sc.nextInt();
		int count = 0;
		double anser = 0;
		//サイコロの目
			for(int i = 1; i <= me ; i++) {
				double sai = 1.0/me;
				int win = i;
				//コインの振った回数
				while(win<point) {
					win = win*2;
					sai = sai/2;
				}
				anser += sai;
			}
			System.out.println(anser);
		} Scanner sc =new Scanner(System.in); sc new Scanner(System.in) double me = sc.nextInt(); me sc.nextInt() sc.nextInt sc int point = sc.nextInt(); point sc.nextInt() sc.nextInt sc int count = 0; count 0 double anser = 0; anser 0 for(int i = 1; i <= me ; i++) {
				double sai = 1.0/me;
				int win = i;
				//コインの振った回数
				while(win<point) {
					win = win*2;
					sai = sai/2;
				}
				anser += sai;
			} int i = 1; int i = 1; i 1 i <= me i me i++ i++ i {
				double sai = 1.0/me;
				int win = i;
				//コインの振った回数
				while(win<point) {
					win = win*2;
					sai = sai/2;
				}
				anser += sai;
			} {
				double sai = 1.0/me;
				int win = i;
				//コインの振った回数
				while(win<point) {
					win = win*2;
					sai = sai/2;
				}
				anser += sai;
			} double sai = 1.0/me; sai 1.0/me 1.0 me int win = i; win i while(win<point) {
					win = win*2;
					sai = sai/2;
				} win<point win point {
					win = win*2;
					sai = sai/2;
				} win = win*2 win win*2 win 2 sai = sai/2 sai sai/2 sai 2 anser += sai anser sai System.out.println(anser) System.out.println System.out System System.out anser String[] args args public class Main {

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

		double me = sc.nextInt();
		int point = sc.nextInt();
		int count = 0;
		double anser = 0;
		//サイコロの目
			for(int i = 1; i <= me ; i++) {
				double sai = 1.0/me;
				int win = i;
				//コインの振った回数
				while(win<point) {
					win = win*2;
					sai = sai/2;
				}
				anser += sai;
			}
			System.out.println(anser);
		}
	} public class Main {

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

		double me = sc.nextInt();
		int point = sc.nextInt();
		int count = 0;
		double anser = 0;
		//サイコロの目
			for(int i = 1; i <= me ; i++) {
				double sai = 1.0/me;
				int win = i;
				//コインの振った回数
				while(win<point) {
					win = win*2;
					sai = sai/2;
				}
				anser += sai;
			}
			System.out.println(anser);
		}
	} Main
import java.util.Scanner;

public class Main {

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

		double me = sc.nextInt();
		int point = sc.nextInt();
		int count = 0;
		double anser = 0;
		//サイコロの目
			for(int i = 1; i <= me ; i++) {
				double sai = 1.0/me;
				int win = i;
				//コインの振った回数
				while(win<point) {
					win = win*2;
					sai = sai/2;
				}
				anser += sai;
			}
			System.out.println(anser);
		}
	}
