import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int K = scan.nextInt();
      	double ans = 0.0;
      	double[] anss = new double[n];
      	for(int i = 1; i <= n; i++){
        	if(i > K - 1){
              	anss[i-1] = 1.0 / n;
            }
          	else{
              	int j = i;
              	int counter = 0;
            	while(j < K){
                	j = j * 2;
                    counter ++;
                }
              anss[i-1] = (1.0/n) * Math.pow(0.5, counter); 
            }
        }
      	for(int k = 0; k < n; k++){
        	ans = ans + anss[k];
        }
      	System.out.print(ans);
    }
 
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int K = scan.nextInt();
      	double ans = 0.0;
      	double[] anss = new double[n];
      	for(int i = 1; i <= n; i++){
        	if(i > K - 1){
              	anss[i-1] = 1.0 / n;
            }
          	else{
              	int j = i;
              	int counter = 0;
            	while(j < K){
                	j = j * 2;
                    counter ++;
                }
              anss[i-1] = (1.0/n) * Math.pow(0.5, counter); 
            }
        }
      	for(int k = 0; k < n; k++){
        	ans = ans + anss[k];
        }
      	System.out.print(ans);
    }
 
} Main public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int K = scan.nextInt();
      	double ans = 0.0;
      	double[] anss = new double[n];
      	for(int i = 1; i <= n; i++){
        	if(i > K - 1){
              	anss[i-1] = 1.0 / n;
            }
          	else{
              	int j = i;
              	int counter = 0;
            	while(j < K){
                	j = j * 2;
                    counter ++;
                }
              anss[i-1] = (1.0/n) * Math.pow(0.5, counter); 
            }
        }
      	for(int k = 0; k < n; k++){
        	ans = ans + anss[k];
        }
      	System.out.print(ans);
    } main {
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int K = scan.nextInt();
      	double ans = 0.0;
      	double[] anss = new double[n];
      	for(int i = 1; i <= n; i++){
        	if(i > K - 1){
              	anss[i-1] = 1.0 / n;
            }
          	else{
              	int j = i;
              	int counter = 0;
            	while(j < K){
                	j = j * 2;
                    counter ++;
                }
              anss[i-1] = (1.0/n) * Math.pow(0.5, counter); 
            }
        }
      	for(int k = 0; k < n; k++){
        	ans = ans + anss[k];
        }
      	System.out.print(ans);
    } Scanner scan = new Scanner(System.in); scan 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 ans = 0.0; ans 0.0 double[] anss = new double[n]; anss new double[n] n for(int i = 1; i <= n; i++){
        	if(i > K - 1){
              	anss[i-1] = 1.0 / n;
            }
          	else{
              	int j = i;
              	int counter = 0;
            	while(j < K){
                	j = j * 2;
                    counter ++;
                }
              anss[i-1] = (1.0/n) * Math.pow(0.5, counter); 
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
        	if(i > K - 1){
              	anss[i-1] = 1.0 / n;
            }
          	else{
              	int j = i;
              	int counter = 0;
            	while(j < K){
                	j = j * 2;
                    counter ++;
                }
              anss[i-1] = (1.0/n) * Math.pow(0.5, counter); 
            }
        } {
        	if(i > K - 1){
              	anss[i-1] = 1.0 / n;
            }
          	else{
              	int j = i;
              	int counter = 0;
            	while(j < K){
                	j = j * 2;
                    counter ++;
                }
              anss[i-1] = (1.0/n) * Math.pow(0.5, counter); 
            }
        } if(i > K - 1){
              	anss[i-1] = 1.0 / n;
            }
          	else{
              	int j = i;
              	int counter = 0;
            	while(j < K){
                	j = j * 2;
                    counter ++;
                }
              anss[i-1] = (1.0/n) * Math.pow(0.5, counter); 
            } i > K - 1 i K - 1 K 1 {
              	anss[i-1] = 1.0 / n;
            } anss[i-1] = 1.0 / n anss[i-1] anss i-1 i 1 1.0 / n 1.0 n {
              	int j = i;
              	int counter = 0;
            	while(j < K){
                	j = j * 2;
                    counter ++;
                }
              anss[i-1] = (1.0/n) * Math.pow(0.5, counter); 
            } int j = i; j i int counter = 0; counter 0 while(j < K){
                	j = j * 2;
                    counter ++;
                } j < K j K {
                	j = j * 2;
                    counter ++;
                } j = j * 2 j j * 2 j 2 counter ++ counter anss[i-1] = (1.0/n) * Math.pow(0.5, counter) anss[i-1] anss i-1 i 1 (1.0/n) * Math.pow(0.5, counter) (1.0/n) 1.0 n Math.pow(0.5, counter) Math.pow Math 0.5 counter for(int k = 0; k < n; k++){
        	ans = ans + anss[k];
        } int k = 0; int k = 0; k 0 k < n k n k++ k++ k {
        	ans = ans + anss[k];
        } {
        	ans = ans + anss[k];
        } ans = ans + anss[k] ans ans + anss[k] ans anss[k] anss k System.out.print(ans) System.out.print System.out System System.out ans String[] args args public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int K = scan.nextInt();
      	double ans = 0.0;
      	double[] anss = new double[n];
      	for(int i = 1; i <= n; i++){
        	if(i > K - 1){
              	anss[i-1] = 1.0 / n;
            }
          	else{
              	int j = i;
              	int counter = 0;
            	while(j < K){
                	j = j * 2;
                    counter ++;
                }
              anss[i-1] = (1.0/n) * Math.pow(0.5, counter); 
            }
        }
      	for(int k = 0; k < n; k++){
        	ans = ans + anss[k];
        }
      	System.out.print(ans);
    }
 
} public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int K = scan.nextInt();
      	double ans = 0.0;
      	double[] anss = new double[n];
      	for(int i = 1; i <= n; i++){
        	if(i > K - 1){
              	anss[i-1] = 1.0 / n;
            }
          	else{
              	int j = i;
              	int counter = 0;
            	while(j < K){
                	j = j * 2;
                    counter ++;
                }
              anss[i-1] = (1.0/n) * Math.pow(0.5, counter); 
            }
        }
      	for(int k = 0; k < n; k++){
        	ans = ans + anss[k];
        }
      	System.out.print(ans);
    }
 
} Main
import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int K = scan.nextInt();
      	double ans = 0.0;
      	double[] anss = new double[n];
      	for(int i = 1; i <= n; i++){
        	if(i > K - 1){
              	anss[i-1] = 1.0 / n;
            }
          	else{
              	int j = i;
              	int counter = 0;
            	while(j < K){
                	j = j * 2;
                    counter ++;
                }
              anss[i-1] = (1.0/n) * Math.pow(0.5, counter); 
            }
        }
      	for(int k = 0; k < n; k++){
        	ans = ans + anss[k];
        }
      	System.out.print(ans);
    }
 
}