import java.util.Scanner;

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

		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		
		double win=0;
		
		String K = Integer.toBinaryString(k);
		int count=0;
		for(int i=1;i<=n;i++){
			String s = Integer.toBinaryString(i);
			while(s.length()<K.length()) {
				s = s + "0";
				count++;
			}
			
			if(Integer.parseInt(s,2)<Integer.parseInt(K,2)) {
				count++;
			}
			
			win += 1/Math.pow(2,count);
			count=0;
		}
		
		
		System.out.println(win/n);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);

		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		
		double win=0;
		
		String K = Integer.toBinaryString(k);
		int count=0;
		for(int i=1;i<=n;i++){
			String s = Integer.toBinaryString(i);
			while(s.length()<K.length()) {
				s = s + "0";
				count++;
			}
			
			if(Integer.parseInt(s,2)<Integer.parseInt(K,2)) {
				count++;
			}
			
			win += 1/Math.pow(2,count);
			count=0;
		}
		
		
		System.out.println(win/n);
	}
} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);

		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		
		double win=0;
		
		String K = Integer.toBinaryString(k);
		int count=0;
		for(int i=1;i<=n;i++){
			String s = Integer.toBinaryString(i);
			while(s.length()<K.length()) {
				s = s + "0";
				count++;
			}
			
			if(Integer.parseInt(s,2)<Integer.parseInt(K,2)) {
				count++;
			}
			
			win += 1/Math.pow(2,count);
			count=0;
		}
		
		
		System.out.println(win/n);
	} main {
		Scanner sc = new Scanner(System.in);

		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		
		double win=0;
		
		String K = Integer.toBinaryString(k);
		int count=0;
		for(int i=1;i<=n;i++){
			String s = Integer.toBinaryString(i);
			while(s.length()<K.length()) {
				s = s + "0";
				count++;
			}
			
			if(Integer.parseInt(s,2)<Integer.parseInt(K,2)) {
				count++;
			}
			
			win += 1/Math.pow(2,count);
			count=0;
		}
		
		
		System.out.println(win/n);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int k = Integer.parseInt(sc.next()); k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc double win=0; win 0 String K = Integer.toBinaryString(k); K Integer.toBinaryString(k) Integer.toBinaryString Integer k int count=0; count 0 for(int i=1;i<=n;i++){
			String s = Integer.toBinaryString(i);
			while(s.length()<K.length()) {
				s = s + "0";
				count++;
			}
			
			if(Integer.parseInt(s,2)<Integer.parseInt(K,2)) {
				count++;
			}
			
			win += 1/Math.pow(2,count);
			count=0;
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			String s = Integer.toBinaryString(i);
			while(s.length()<K.length()) {
				s = s + "0";
				count++;
			}
			
			if(Integer.parseInt(s,2)<Integer.parseInt(K,2)) {
				count++;
			}
			
			win += 1/Math.pow(2,count);
			count=0;
		} {
			String s = Integer.toBinaryString(i);
			while(s.length()<K.length()) {
				s = s + "0";
				count++;
			}
			
			if(Integer.parseInt(s,2)<Integer.parseInt(K,2)) {
				count++;
			}
			
			win += 1/Math.pow(2,count);
			count=0;
		} String s = Integer.toBinaryString(i); s Integer.toBinaryString(i) Integer.toBinaryString Integer i while(s.length()<K.length()) {
				s = s + "0";
				count++;
			} s.length()<K.length() s.length() s.length s K.length() K.length K {
				s = s + "0";
				count++;
			} s = s + "0" s s + "0" s "0" count++ count if(Integer.parseInt(s,2)<Integer.parseInt(K,2)) {
				count++;
			} Integer.parseInt(s,2)<Integer.parseInt(K,2) Integer.parseInt(s,2) Integer.parseInt Integer s 2 Integer.parseInt(K,2) Integer.parseInt Integer K 2 {
				count++;
			} count++ count win += 1/Math.pow(2,count) win 1/Math.pow(2,count) 1 Math.pow(2,count) Math.pow Math 2 count count=0 count 0 System.out.println(win/n) System.out.println System.out System System.out win/n win n String args[] args public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);

		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		
		double win=0;
		
		String K = Integer.toBinaryString(k);
		int count=0;
		for(int i=1;i<=n;i++){
			String s = Integer.toBinaryString(i);
			while(s.length()<K.length()) {
				s = s + "0";
				count++;
			}
			
			if(Integer.parseInt(s,2)<Integer.parseInt(K,2)) {
				count++;
			}
			
			win += 1/Math.pow(2,count);
			count=0;
		}
		
		
		System.out.println(win/n);
	}
} public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);

		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		
		double win=0;
		
		String K = Integer.toBinaryString(k);
		int count=0;
		for(int i=1;i<=n;i++){
			String s = Integer.toBinaryString(i);
			while(s.length()<K.length()) {
				s = s + "0";
				count++;
			}
			
			if(Integer.parseInt(s,2)<Integer.parseInt(K,2)) {
				count++;
			}
			
			win += 1/Math.pow(2,count);
			count=0;
		}
		
		
		System.out.println(win/n);
	}
} Main
import java.util.Scanner;

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

		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		
		double win=0;
		
		String K = Integer.toBinaryString(k);
		int count=0;
		for(int i=1;i<=n;i++){
			String s = Integer.toBinaryString(i);
			while(s.length()<K.length()) {
				s = s + "0";
				count++;
			}
			
			if(Integer.parseInt(s,2)<Integer.parseInt(K,2)) {
				count++;
			}
			
			win += 1/Math.pow(2,count);
			count=0;
		}
		
		
		System.out.println(win/n);
	}
}