import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//Integer[] array = new Integer[m];
        int n = sc.nextInt();
        int k = sc.nextInt();
        double answer=0;
        for(int i=1;n+1>i;i++) {
        	int count=i;
        	int j=0;
        	while(true) {
        		if(count>=k)
        			break;
        		count = count*2;
        		j++;
        	}
        	answer=answer+1/(double)n*Math.pow(0.5,j);
        	//System.out.println(answer);
        }
        System.out.println(answer);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//Integer[] array = new Integer[m];
        int n = sc.nextInt();
        int k = sc.nextInt();
        double answer=0;
        for(int i=1;n+1>i;i++) {
        	int count=i;
        	int j=0;
        	while(true) {
        		if(count>=k)
        			break;
        		count = count*2;
        		j++;
        	}
        	answer=answer+1/(double)n*Math.pow(0.5,j);
        	//System.out.println(answer);
        }
        System.out.println(answer);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//Integer[] array = new Integer[m];
        int n = sc.nextInt();
        int k = sc.nextInt();
        double answer=0;
        for(int i=1;n+1>i;i++) {
        	int count=i;
        	int j=0;
        	while(true) {
        		if(count>=k)
        			break;
        		count = count*2;
        		j++;
        	}
        	answer=answer+1/(double)n*Math.pow(0.5,j);
        	//System.out.println(answer);
        }
        System.out.println(answer);
	} main {
		Scanner sc = new Scanner(System.in);
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//Integer[] array = new Integer[m];
        int n = sc.nextInt();
        int k = sc.nextInt();
        double answer=0;
        for(int i=1;n+1>i;i++) {
        	int count=i;
        	int j=0;
        	while(true) {
        		if(count>=k)
        			break;
        		count = count*2;
        		j++;
        	}
        	answer=answer+1/(double)n*Math.pow(0.5,j);
        	//System.out.println(answer);
        }
        System.out.println(answer);
	} 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 double answer=0; answer 0 for(int i=1;n+1>i;i++) {
        	int count=i;
        	int j=0;
        	while(true) {
        		if(count>=k)
        			break;
        		count = count*2;
        		j++;
        	}
        	answer=answer+1/(double)n*Math.pow(0.5,j);
        	//System.out.println(answer);
        } int i=1; int i=1; i 1 n+1>i n+1 n 1 i i++ i++ i {
        	int count=i;
        	int j=0;
        	while(true) {
        		if(count>=k)
        			break;
        		count = count*2;
        		j++;
        	}
        	answer=answer+1/(double)n*Math.pow(0.5,j);
        	//System.out.println(answer);
        } {
        	int count=i;
        	int j=0;
        	while(true) {
        		if(count>=k)
        			break;
        		count = count*2;
        		j++;
        	}
        	answer=answer+1/(double)n*Math.pow(0.5,j);
        	//System.out.println(answer);
        } int count=i; count i int j=0; j 0 while(true) {
        		if(count>=k)
        			break;
        		count = count*2;
        		j++;
        	} true {
        		if(count>=k)
        			break;
        		count = count*2;
        		j++;
        	} if(count>=k)
        			break; count>=k count k break; count = count*2 count count*2 count 2 j++ j answer=answer+1/(double)n*Math.pow(0.5,j) answer answer+1/(double)n*Math.pow(0.5,j) answer 1/(double)n*Math.pow(0.5,j) 1/(double)n 1 (double)n Math.pow(0.5,j) Math.pow Math 0.5 j System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//Integer[] array = new Integer[m];
        int n = sc.nextInt();
        int k = sc.nextInt();
        double answer=0;
        for(int i=1;n+1>i;i++) {
        	int count=i;
        	int j=0;
        	while(true) {
        		if(count>=k)
        			break;
        		count = count*2;
        		j++;
        	}
        	answer=answer+1/(double)n*Math.pow(0.5,j);
        	//System.out.println(answer);
        }
        System.out.println(answer);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//Integer[] array = new Integer[m];
        int n = sc.nextInt();
        int k = sc.nextInt();
        double answer=0;
        for(int i=1;n+1>i;i++) {
        	int count=i;
        	int j=0;
        	while(true) {
        		if(count>=k)
        			break;
        		count = count*2;
        		j++;
        	}
        	answer=answer+1/(double)n*Math.pow(0.5,j);
        	//System.out.println(answer);
        }
        System.out.println(answer);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//Integer[] array = new Integer[m];
        int n = sc.nextInt();
        int k = sc.nextInt();
        double answer=0;
        for(int i=1;n+1>i;i++) {
        	int count=i;
        	int j=0;
        	while(true) {
        		if(count>=k)
        			break;
        		count = count*2;
        		j++;
        	}
        	answer=answer+1/(double)n*Math.pow(0.5,j);
        	//System.out.println(answer);
        }
        System.out.println(answer);
	}
}