import java.util.*;

class Main{
	public static void main(String[] args){
      	int k, p;
      	double answer = 0, n;
    	Scanner sc = new Scanner(System.in);
      	n = sc.nextDouble();
      	k = sc.nextInt();
      	
      	for(int i = 1; i <= n; i++) {
      		int count = 0;
      		p = i;
      		while(true) {
      			if(p >= k) {
      				answer = answer + ((1.0/n) * Math.pow(0.5, count));
      				break;
      			}
      			count++;
      			p = p*2;
      		}
      	}
      	System.out.println(answer);
    }
} import java.util.*; util.* java class Main{
	public static void main(String[] args){
      	int k, p;
      	double answer = 0, n;
    	Scanner sc = new Scanner(System.in);
      	n = sc.nextDouble();
      	k = sc.nextInt();
      	
      	for(int i = 1; i <= n; i++) {
      		int count = 0;
      		p = i;
      		while(true) {
      			if(p >= k) {
      				answer = answer + ((1.0/n) * Math.pow(0.5, count));
      				break;
      			}
      			count++;
      			p = p*2;
      		}
      	}
      	System.out.println(answer);
    }
} Main public static void main(String[] args){
      	int k, p;
      	double answer = 0, n;
    	Scanner sc = new Scanner(System.in);
      	n = sc.nextDouble();
      	k = sc.nextInt();
      	
      	for(int i = 1; i <= n; i++) {
      		int count = 0;
      		p = i;
      		while(true) {
      			if(p >= k) {
      				answer = answer + ((1.0/n) * Math.pow(0.5, count));
      				break;
      			}
      			count++;
      			p = p*2;
      		}
      	}
      	System.out.println(answer);
    } main {
      	int k, p;
      	double answer = 0, n;
    	Scanner sc = new Scanner(System.in);
      	n = sc.nextDouble();
      	k = sc.nextInt();
      	
      	for(int i = 1; i <= n; i++) {
      		int count = 0;
      		p = i;
      		while(true) {
      			if(p >= k) {
      				answer = answer + ((1.0/n) * Math.pow(0.5, count));
      				break;
      			}
      			count++;
      			p = p*2;
      		}
      	}
      	System.out.println(answer);
    } int k k p; p double answer = 0 answer 0 n; n Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextDouble() n sc.nextDouble() sc.nextDouble sc k = sc.nextInt() k sc.nextInt() sc.nextInt sc for(int i = 1; i <= n; i++) {
      		int count = 0;
      		p = i;
      		while(true) {
      			if(p >= k) {
      				answer = answer + ((1.0/n) * Math.pow(0.5, count));
      				break;
      			}
      			count++;
      			p = p*2;
      		}
      	} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
      		int count = 0;
      		p = i;
      		while(true) {
      			if(p >= k) {
      				answer = answer + ((1.0/n) * Math.pow(0.5, count));
      				break;
      			}
      			count++;
      			p = p*2;
      		}
      	} {
      		int count = 0;
      		p = i;
      		while(true) {
      			if(p >= k) {
      				answer = answer + ((1.0/n) * Math.pow(0.5, count));
      				break;
      			}
      			count++;
      			p = p*2;
      		}
      	} int count = 0; count 0 p = i p i while(true) {
      			if(p >= k) {
      				answer = answer + ((1.0/n) * Math.pow(0.5, count));
      				break;
      			}
      			count++;
      			p = p*2;
      		} true {
      			if(p >= k) {
      				answer = answer + ((1.0/n) * Math.pow(0.5, count));
      				break;
      			}
      			count++;
      			p = p*2;
      		} if(p >= k) {
      				answer = answer + ((1.0/n) * Math.pow(0.5, count));
      				break;
      			} p >= k p k {
      				answer = answer + ((1.0/n) * Math.pow(0.5, count));
      				break;
      			} answer = answer + ((1.0/n) * Math.pow(0.5, count)) answer answer + ((1.0/n) * Math.pow(0.5, count)) answer ((1.0/n) * Math.pow(0.5, count)) (1.0/n) 1.0 n Math.pow(0.5, count) Math.pow Math 0.5 count break; count++ count p = p*2 p p*2 p 2 System.out.println(answer) System.out.println System.out System System.out answer String[] args args
import java.util.*;

class Main{
	public static void main(String[] args){
      	int k, p;
      	double answer = 0, n;
    	Scanner sc = new Scanner(System.in);
      	n = sc.nextDouble();
      	k = sc.nextInt();
      	
      	for(int i = 1; i <= n; i++) {
      		int count = 0;
      		p = i;
      		while(true) {
      			if(p >= k) {
      				answer = answer + ((1.0/n) * Math.pow(0.5, count));
      				break;
      			}
      			count++;
      			p = p*2;
      		}
      	}
      	System.out.println(answer);
    }
}