import 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();
		int genzai = 0;
		double result = 1d/(double)n;
		//System.out.println(result);
		double ans = 0;
		ArrayList<Double> arr=new ArrayList<>();
		if(k==1) {
			ans=1;
		}else {
			for(int i=1;i<=n;i++) {
				genzai = i;
				while(true) {
					if(genzai>k-1) {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					}
					genzai=genzai*2;
					result=result*0.5d;
				}
			}
			for(double d:arr) {
				ans+=d;
			}
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int genzai = 0;
		double result = 1d/(double)n;
		//System.out.println(result);
		double ans = 0;
		ArrayList<Double> arr=new ArrayList<>();
		if(k==1) {
			ans=1;
		}else {
			for(int i=1;i<=n;i++) {
				genzai = i;
				while(true) {
					if(genzai>k-1) {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					}
					genzai=genzai*2;
					result=result*0.5d;
				}
			}
			for(double d:arr) {
				ans+=d;
			}
		}
		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();
		int genzai = 0;
		double result = 1d/(double)n;
		//System.out.println(result);
		double ans = 0;
		ArrayList<Double> arr=new ArrayList<>();
		if(k==1) {
			ans=1;
		}else {
			for(int i=1;i<=n;i++) {
				genzai = i;
				while(true) {
					if(genzai>k-1) {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					}
					genzai=genzai*2;
					result=result*0.5d;
				}
			}
			for(double d:arr) {
				ans+=d;
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int genzai = 0;
		double result = 1d/(double)n;
		//System.out.println(result);
		double ans = 0;
		ArrayList<Double> arr=new ArrayList<>();
		if(k==1) {
			ans=1;
		}else {
			for(int i=1;i<=n;i++) {
				genzai = i;
				while(true) {
					if(genzai>k-1) {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					}
					genzai=genzai*2;
					result=result*0.5d;
				}
			}
			for(double d:arr) {
				ans+=d;
			}
		}
		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 int genzai = 0; genzai 0 double result = 1d/(double)n; result 1d/(double)n 1d (double)n double ans = 0; ans 0 ArrayList<Double> arr=new ArrayList<>(); arr new ArrayList<>() if(k==1) {
			ans=1;
		}else {
			for(int i=1;i<=n;i++) {
				genzai = i;
				while(true) {
					if(genzai>k-1) {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					}
					genzai=genzai*2;
					result=result*0.5d;
				}
			}
			for(double d:arr) {
				ans+=d;
			}
		} k==1 k 1 {
			ans=1;
		} ans=1 ans 1 {
			for(int i=1;i<=n;i++) {
				genzai = i;
				while(true) {
					if(genzai>k-1) {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					}
					genzai=genzai*2;
					result=result*0.5d;
				}
			}
			for(double d:arr) {
				ans+=d;
			}
		} for(int i=1;i<=n;i++) {
				genzai = i;
				while(true) {
					if(genzai>k-1) {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					}
					genzai=genzai*2;
					result=result*0.5d;
				}
			} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
				genzai = i;
				while(true) {
					if(genzai>k-1) {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					}
					genzai=genzai*2;
					result=result*0.5d;
				}
			} {
				genzai = i;
				while(true) {
					if(genzai>k-1) {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					}
					genzai=genzai*2;
					result=result*0.5d;
				}
			} genzai = i genzai i while(true) {
					if(genzai>k-1) {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					}
					genzai=genzai*2;
					result=result*0.5d;
				} true {
					if(genzai>k-1) {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					}
					genzai=genzai*2;
					result=result*0.5d;
				} if(genzai>k-1) {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					} genzai>k-1 genzai k-1 k 1 {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					} arr.add(result) arr.add arr result result = 1d/(double)n result 1d/(double)n 1d (double)n break; genzai=genzai*2 genzai genzai*2 genzai 2 result=result*0.5d result result*0.5d result 0.5d for(double d:arr) {
				ans+=d;
			} double d arr {
				ans+=d;
			} {
				ans+=d;
			} ans+=d ans d 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();
		int genzai = 0;
		double result = 1d/(double)n;
		//System.out.println(result);
		double ans = 0;
		ArrayList<Double> arr=new ArrayList<>();
		if(k==1) {
			ans=1;
		}else {
			for(int i=1;i<=n;i++) {
				genzai = i;
				while(true) {
					if(genzai>k-1) {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					}
					genzai=genzai*2;
					result=result*0.5d;
				}
			}
			for(double d:arr) {
				ans+=d;
			}
		}
		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();
		int genzai = 0;
		double result = 1d/(double)n;
		//System.out.println(result);
		double ans = 0;
		ArrayList<Double> arr=new ArrayList<>();
		if(k==1) {
			ans=1;
		}else {
			for(int i=1;i<=n;i++) {
				genzai = i;
				while(true) {
					if(genzai>k-1) {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					}
					genzai=genzai*2;
					result=result*0.5d;
				}
			}
			for(double d:arr) {
				ans+=d;
			}
		}
		System.out.println(ans);
	}
} Main
import 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();
		int genzai = 0;
		double result = 1d/(double)n;
		//System.out.println(result);
		double ans = 0;
		ArrayList<Double> arr=new ArrayList<>();
		if(k==1) {
			ans=1;
		}else {
			for(int i=1;i<=n;i++) {
				genzai = i;
				while(true) {
					if(genzai>k-1) {
						arr.add(result);
						result = 1d/(double)n;;
						break;
					}
					genzai=genzai*2;
					result=result*0.5d;
				}
			}
			for(double d:arr) {
				ans+=d;
			}
		}
		System.out.println(ans);
	}
}