import java.util.Scanner;
public class Main{

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		double n = sc.nextDouble();
		double k = sc.nextDouble();
		
		double E = 0;
		double q;
		for(double p = 1; p <= n; p++) {
			double Ep = 1/n;
			q = p;
			if(p >= k) {
				E += Ep;
			}
			if(p < k) {
				do{
					q = q * 2;
					Ep = Ep / 2;
				}while(q < k);
				
				E += Ep;
			}
		}
		System.out.println(E);

	}

} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		double n = sc.nextDouble();
		double k = sc.nextDouble();
		
		double E = 0;
		double q;
		for(double p = 1; p <= n; p++) {
			double Ep = 1/n;
			q = p;
			if(p >= k) {
				E += Ep;
			}
			if(p < k) {
				do{
					q = q * 2;
					Ep = Ep / 2;
				}while(q < k);
				
				E += Ep;
			}
		}
		System.out.println(E);

	}

} Main public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		double n = sc.nextDouble();
		double k = sc.nextDouble();
		
		double E = 0;
		double q;
		for(double p = 1; p <= n; p++) {
			double Ep = 1/n;
			q = p;
			if(p >= k) {
				E += Ep;
			}
			if(p < k) {
				do{
					q = q * 2;
					Ep = Ep / 2;
				}while(q < k);
				
				E += Ep;
			}
		}
		System.out.println(E);

	} main {
		
		Scanner sc = new Scanner(System.in);
		
		double n = sc.nextDouble();
		double k = sc.nextDouble();
		
		double E = 0;
		double q;
		for(double p = 1; p <= n; p++) {
			double Ep = 1/n;
			q = p;
			if(p >= k) {
				E += Ep;
			}
			if(p < k) {
				do{
					q = q * 2;
					Ep = Ep / 2;
				}while(q < k);
				
				E += Ep;
			}
		}
		System.out.println(E);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double n = sc.nextDouble(); n sc.nextDouble() sc.nextDouble sc double k = sc.nextDouble(); k sc.nextDouble() sc.nextDouble sc double E = 0; E 0 double q; q for(double p = 1; p <= n; p++) {
			double Ep = 1/n;
			q = p;
			if(p >= k) {
				E += Ep;
			}
			if(p < k) {
				do{
					q = q * 2;
					Ep = Ep / 2;
				}while(q < k);
				
				E += Ep;
			}
		} double p = 1; double p = 1; p 1 p <= n p n p++ p++ p {
			double Ep = 1/n;
			q = p;
			if(p >= k) {
				E += Ep;
			}
			if(p < k) {
				do{
					q = q * 2;
					Ep = Ep / 2;
				}while(q < k);
				
				E += Ep;
			}
		} {
			double Ep = 1/n;
			q = p;
			if(p >= k) {
				E += Ep;
			}
			if(p < k) {
				do{
					q = q * 2;
					Ep = Ep / 2;
				}while(q < k);
				
				E += Ep;
			}
		} double Ep = 1/n; Ep 1/n 1 n q = p q p if(p >= k) {
				E += Ep;
			} p >= k p k {
				E += Ep;
			} E += Ep E Ep if(p < k) {
				do{
					q = q * 2;
					Ep = Ep / 2;
				}while(q < k);
				
				E += Ep;
			} p < k p k {
				do{
					q = q * 2;
					Ep = Ep / 2;
				}while(q < k);
				
				E += Ep;
			} do{
					q = q * 2;
					Ep = Ep / 2;
				}while(q < k); q < k q k {
					q = q * 2;
					Ep = Ep / 2;
				} q = q * 2 q q * 2 q 2 Ep = Ep / 2 Ep Ep / 2 Ep 2 E += Ep E Ep System.out.println(E) System.out.println System.out System System.out E String[] args args public class Main{

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		double n = sc.nextDouble();
		double k = sc.nextDouble();
		
		double E = 0;
		double q;
		for(double p = 1; p <= n; p++) {
			double Ep = 1/n;
			q = p;
			if(p >= k) {
				E += Ep;
			}
			if(p < k) {
				do{
					q = q * 2;
					Ep = Ep / 2;
				}while(q < k);
				
				E += Ep;
			}
		}
		System.out.println(E);

	}

} public class Main{

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		double n = sc.nextDouble();
		double k = sc.nextDouble();
		
		double E = 0;
		double q;
		for(double p = 1; p <= n; p++) {
			double Ep = 1/n;
			q = p;
			if(p >= k) {
				E += Ep;
			}
			if(p < k) {
				do{
					q = q * 2;
					Ep = Ep / 2;
				}while(q < k);
				
				E += Ep;
			}
		}
		System.out.println(E);

	}

} Main
import java.util.Scanner;
public class Main{

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		double n = sc.nextDouble();
		double k = sc.nextDouble();
		
		double E = 0;
		double q;
		for(double p = 1; p <= n; p++) {
			double Ep = 1/n;
			q = p;
			if(p >= k) {
				E += Ep;
			}
			if(p < k) {
				do{
					q = q * 2;
					Ep = Ep / 2;
				}while(q < k);
				
				E += Ep;
			}
		}
		System.out.println(E);

	}

}
