import java.math.BigDecimal;
import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			int N = scan.nextInt();
			int K = scan.nextInt();
			
			double kakuritu= 0;
			
			
			for(int i=1;i<=N;i++){
				if(i>=K) {
					
					kakuritu+=(1.0/(double)N);
					//System.out.println("o-i");
				}else{
					//if(2*i>=K) {
						//kakuritu+=(1.0/(double)N)*(0.5);
					//}else{
					
					int nankai =0;
					int idash=i;
					while(true) {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					}
					
					//System.out.println(BigDecimal.valueOf((1.0/(double)N)*Math.pow(0.5, nankai)).toPlainString());
					//System.out.println();
					kakuritu+=(1.0/(double)N)*Math.pow(0.5, nankai);
				
					
				}
			}
			
			
			System.out.println(BigDecimal.valueOf(kakuritu).toPlainString());
			
			
			
			
			
		}
		
		
	}
		

} import java.math.BigDecimal; BigDecimal java.math import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			int N = scan.nextInt();
			int K = scan.nextInt();
			
			double kakuritu= 0;
			
			
			for(int i=1;i<=N;i++){
				if(i>=K) {
					
					kakuritu+=(1.0/(double)N);
					//System.out.println("o-i");
				}else{
					//if(2*i>=K) {
						//kakuritu+=(1.0/(double)N)*(0.5);
					//}else{
					
					int nankai =0;
					int idash=i;
					while(true) {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					}
					
					//System.out.println(BigDecimal.valueOf((1.0/(double)N)*Math.pow(0.5, nankai)).toPlainString());
					//System.out.println();
					kakuritu+=(1.0/(double)N)*Math.pow(0.5, nankai);
				
					
				}
			}
			
			
			System.out.println(BigDecimal.valueOf(kakuritu).toPlainString());
			
			
			
			
			
		}
		
		
	}
		

} Main public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			int N = scan.nextInt();
			int K = scan.nextInt();
			
			double kakuritu= 0;
			
			
			for(int i=1;i<=N;i++){
				if(i>=K) {
					
					kakuritu+=(1.0/(double)N);
					//System.out.println("o-i");
				}else{
					//if(2*i>=K) {
						//kakuritu+=(1.0/(double)N)*(0.5);
					//}else{
					
					int nankai =0;
					int idash=i;
					while(true) {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					}
					
					//System.out.println(BigDecimal.valueOf((1.0/(double)N)*Math.pow(0.5, nankai)).toPlainString());
					//System.out.println();
					kakuritu+=(1.0/(double)N)*Math.pow(0.5, nankai);
				
					
				}
			}
			
			
			System.out.println(BigDecimal.valueOf(kakuritu).toPlainString());
			
			
			
			
			
		}
		
		
	} main {
		try(Scanner scan = new Scanner(System.in)){
			int N = scan.nextInt();
			int K = scan.nextInt();
			
			double kakuritu= 0;
			
			
			for(int i=1;i<=N;i++){
				if(i>=K) {
					
					kakuritu+=(1.0/(double)N);
					//System.out.println("o-i");
				}else{
					//if(2*i>=K) {
						//kakuritu+=(1.0/(double)N)*(0.5);
					//}else{
					
					int nankai =0;
					int idash=i;
					while(true) {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					}
					
					//System.out.println(BigDecimal.valueOf((1.0/(double)N)*Math.pow(0.5, nankai)).toPlainString());
					//System.out.println();
					kakuritu+=(1.0/(double)N)*Math.pow(0.5, nankai);
				
					
				}
			}
			
			
			System.out.println(BigDecimal.valueOf(kakuritu).toPlainString());
			
			
			
			
			
		}
		
		
	} try(Scanner scan = new Scanner(System.in)){
			int N = scan.nextInt();
			int K = scan.nextInt();
			
			double kakuritu= 0;
			
			
			for(int i=1;i<=N;i++){
				if(i>=K) {
					
					kakuritu+=(1.0/(double)N);
					//System.out.println("o-i");
				}else{
					//if(2*i>=K) {
						//kakuritu+=(1.0/(double)N)*(0.5);
					//}else{
					
					int nankai =0;
					int idash=i;
					while(true) {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					}
					
					//System.out.println(BigDecimal.valueOf((1.0/(double)N)*Math.pow(0.5, nankai)).toPlainString());
					//System.out.println();
					kakuritu+=(1.0/(double)N)*Math.pow(0.5, nankai);
				
					
				}
			}
			
			
			System.out.println(BigDecimal.valueOf(kakuritu).toPlainString());
			
			
			
			
			
		} {
			int N = scan.nextInt();
			int K = scan.nextInt();
			
			double kakuritu= 0;
			
			
			for(int i=1;i<=N;i++){
				if(i>=K) {
					
					kakuritu+=(1.0/(double)N);
					//System.out.println("o-i");
				}else{
					//if(2*i>=K) {
						//kakuritu+=(1.0/(double)N)*(0.5);
					//}else{
					
					int nankai =0;
					int idash=i;
					while(true) {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					}
					
					//System.out.println(BigDecimal.valueOf((1.0/(double)N)*Math.pow(0.5, nankai)).toPlainString());
					//System.out.println();
					kakuritu+=(1.0/(double)N)*Math.pow(0.5, nankai);
				
					
				}
			}
			
			
			System.out.println(BigDecimal.valueOf(kakuritu).toPlainString());
			
			
			
			
			
		} Scanner scan = new Scanner(System.in) Scanner scan = new Scanner(System.in) new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int K = scan.nextInt(); K scan.nextInt() scan.nextInt scan double kakuritu= 0; kakuritu 0 for(int i=1;i<=N;i++){
				if(i>=K) {
					
					kakuritu+=(1.0/(double)N);
					//System.out.println("o-i");
				}else{
					//if(2*i>=K) {
						//kakuritu+=(1.0/(double)N)*(0.5);
					//}else{
					
					int nankai =0;
					int idash=i;
					while(true) {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					}
					
					//System.out.println(BigDecimal.valueOf((1.0/(double)N)*Math.pow(0.5, nankai)).toPlainString());
					//System.out.println();
					kakuritu+=(1.0/(double)N)*Math.pow(0.5, nankai);
				
					
				}
			} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
				if(i>=K) {
					
					kakuritu+=(1.0/(double)N);
					//System.out.println("o-i");
				}else{
					//if(2*i>=K) {
						//kakuritu+=(1.0/(double)N)*(0.5);
					//}else{
					
					int nankai =0;
					int idash=i;
					while(true) {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					}
					
					//System.out.println(BigDecimal.valueOf((1.0/(double)N)*Math.pow(0.5, nankai)).toPlainString());
					//System.out.println();
					kakuritu+=(1.0/(double)N)*Math.pow(0.5, nankai);
				
					
				}
			} {
				if(i>=K) {
					
					kakuritu+=(1.0/(double)N);
					//System.out.println("o-i");
				}else{
					//if(2*i>=K) {
						//kakuritu+=(1.0/(double)N)*(0.5);
					//}else{
					
					int nankai =0;
					int idash=i;
					while(true) {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					}
					
					//System.out.println(BigDecimal.valueOf((1.0/(double)N)*Math.pow(0.5, nankai)).toPlainString());
					//System.out.println();
					kakuritu+=(1.0/(double)N)*Math.pow(0.5, nankai);
				
					
				}
			} if(i>=K) {
					
					kakuritu+=(1.0/(double)N);
					//System.out.println("o-i");
				}else{
					//if(2*i>=K) {
						//kakuritu+=(1.0/(double)N)*(0.5);
					//}else{
					
					int nankai =0;
					int idash=i;
					while(true) {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					}
					
					//System.out.println(BigDecimal.valueOf((1.0/(double)N)*Math.pow(0.5, nankai)).toPlainString());
					//System.out.println();
					kakuritu+=(1.0/(double)N)*Math.pow(0.5, nankai);
				
					
				} i>=K i K {
					
					kakuritu+=(1.0/(double)N);
					//System.out.println("o-i");
				} kakuritu+=(1.0/(double)N) kakuritu (1.0/(double)N) 1.0 (double)N {
					//if(2*i>=K) {
						//kakuritu+=(1.0/(double)N)*(0.5);
					//}else{
					
					int nankai =0;
					int idash=i;
					while(true) {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					}
					
					//System.out.println(BigDecimal.valueOf((1.0/(double)N)*Math.pow(0.5, nankai)).toPlainString());
					//System.out.println();
					kakuritu+=(1.0/(double)N)*Math.pow(0.5, nankai);
				
					
				} int nankai =0; nankai 0 int idash=i; idash i while(true) {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					} true {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					} idash  = 2*idash idash 2*idash 2 idash nankai++ nankai if(K<=idash){
							break;
						} K<=idash K idash {
							break;
						} break; kakuritu+=(1.0/(double)N)*Math.pow(0.5, nankai) kakuritu (1.0/(double)N)*Math.pow(0.5, nankai) (1.0/(double)N) 1.0 (double)N Math.pow(0.5, nankai) Math.pow Math 0.5 nankai System.out.println(BigDecimal.valueOf(kakuritu).toPlainString()) System.out.println System.out System System.out BigDecimal.valueOf(kakuritu).toPlainString() BigDecimal.valueOf(kakuritu).toPlainString BigDecimal.valueOf(kakuritu) BigDecimal.valueOf BigDecimal kakuritu String[]args args public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			int N = scan.nextInt();
			int K = scan.nextInt();
			
			double kakuritu= 0;
			
			
			for(int i=1;i<=N;i++){
				if(i>=K) {
					
					kakuritu+=(1.0/(double)N);
					//System.out.println("o-i");
				}else{
					//if(2*i>=K) {
						//kakuritu+=(1.0/(double)N)*(0.5);
					//}else{
					
					int nankai =0;
					int idash=i;
					while(true) {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					}
					
					//System.out.println(BigDecimal.valueOf((1.0/(double)N)*Math.pow(0.5, nankai)).toPlainString());
					//System.out.println();
					kakuritu+=(1.0/(double)N)*Math.pow(0.5, nankai);
				
					
				}
			}
			
			
			System.out.println(BigDecimal.valueOf(kakuritu).toPlainString());
			
			
			
			
			
		}
		
		
	}
		

} public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			int N = scan.nextInt();
			int K = scan.nextInt();
			
			double kakuritu= 0;
			
			
			for(int i=1;i<=N;i++){
				if(i>=K) {
					
					kakuritu+=(1.0/(double)N);
					//System.out.println("o-i");
				}else{
					//if(2*i>=K) {
						//kakuritu+=(1.0/(double)N)*(0.5);
					//}else{
					
					int nankai =0;
					int idash=i;
					while(true) {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					}
					
					//System.out.println(BigDecimal.valueOf((1.0/(double)N)*Math.pow(0.5, nankai)).toPlainString());
					//System.out.println();
					kakuritu+=(1.0/(double)N)*Math.pow(0.5, nankai);
				
					
				}
			}
			
			
			System.out.println(BigDecimal.valueOf(kakuritu).toPlainString());
			
			
			
			
			
		}
		
		
	}
		

} Main
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			int N = scan.nextInt();
			int K = scan.nextInt();
			
			double kakuritu= 0;
			
			
			for(int i=1;i<=N;i++){
				if(i>=K) {
					
					kakuritu+=(1.0/(double)N);
					//System.out.println("o-i");
				}else{
					//if(2*i>=K) {
						//kakuritu+=(1.0/(double)N)*(0.5);
					//}else{
					
					int nankai =0;
					int idash=i;
					while(true) {
						idash  = 2*idash;
						nankai++;
						
						//System.out.println(idash);
						//System.out.println();
						//System.out.println(nankai);
						
						if(K<=idash){
							break;
						}
						
						
					}
					
					//System.out.println(BigDecimal.valueOf((1.0/(double)N)*Math.pow(0.5, nankai)).toPlainString());
					//System.out.println();
					kakuritu+=(1.0/(double)N)*Math.pow(0.5, nankai);
				
					
				}
			}
			
			
			System.out.println(BigDecimal.valueOf(kakuritu).toPlainString());
			
			
			
			
			
		}
		
		
	}
		

}
