import java.util.*;

 class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long K = sc.nextLong();
        double p=0;
        
        for(int i=1;i<=N;i++) {
        	double k = 1.0/N;
        	for(int j=i;j<K;j=j*2){
        		k=k/2;
        	}
        	p=p+k;
        }
        System.out.println(p);
    }

} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long K = sc.nextLong();
        double p=0;
        
        for(int i=1;i<=N;i++) {
        	double k = 1.0/N;
        	for(int j=i;j<K;j=j*2){
        		k=k/2;
        	}
        	p=p+k;
        }
        System.out.println(p);
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long K = sc.nextLong();
        double p=0;
        
        for(int i=1;i<=N;i++) {
        	double k = 1.0/N;
        	for(int j=i;j<K;j=j*2){
        		k=k/2;
        	}
        	p=p+k;
        }
        System.out.println(p);
    } main {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long K = sc.nextLong();
        double p=0;
        
        for(int i=1;i<=N;i++) {
        	double k = 1.0/N;
        	for(int j=i;j<K;j=j*2){
        		k=k/2;
        	}
        	p=p+k;
        }
        System.out.println(p);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc long K = sc.nextLong(); K sc.nextLong() sc.nextLong sc double p=0; p 0 for(int i=1;i<=N;i++) {
        	double k = 1.0/N;
        	for(int j=i;j<K;j=j*2){
        		k=k/2;
        	}
        	p=p+k;
        } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
        	double k = 1.0/N;
        	for(int j=i;j<K;j=j*2){
        		k=k/2;
        	}
        	p=p+k;
        } {
        	double k = 1.0/N;
        	for(int j=i;j<K;j=j*2){
        		k=k/2;
        	}
        	p=p+k;
        } double k = 1.0/N; k 1.0/N 1.0 N for(int j=i;j<K;j=j*2){
        		k=k/2;
        	} int j=i; int j=i; j i j<K j K j=j*2 j=j*2 j j*2 j 2 {
        		k=k/2;
        	} {
        		k=k/2;
        	} k=k/2 k k/2 k 2 p=p+k p p+k p k System.out.println(p) System.out.println System.out System System.out p String[] args args
import java.util.*;

 class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long K = sc.nextLong();
        double p=0;
        
        for(int i=1;i<=N;i++) {
        	double k = 1.0/N;
        	for(int j=i;j<K;j=j*2){
        		k=k/2;
        	}
        	p=p+k;
        }
        System.out.println(p);
    }

}