import java.util.*;
import java.util.Map;
import java.util.TreeMap;
 
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
 
        int N = sc.nextInt();
        int K = sc.nextInt();
        double ans = 0;

        for(int i=1; i<=N; i++){
            double p = 1.0 / N;
            int a = i;
            for(int j=0; j<=18; j++){
                if(a>=K){
                    p *= Math.pow((double)1 / 2, j);
                    break;
                }
                a *= 2;
            }
            ans += p;
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java import java.util.Map; Map java.util import java.util.TreeMap; TreeMap java.util class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
 
        int N = sc.nextInt();
        int K = sc.nextInt();
        double ans = 0;

        for(int i=1; i<=N; i++){
            double p = 1.0 / N;
            int a = i;
            for(int j=0; j<=18; j++){
                if(a>=K){
                    p *= Math.pow((double)1 / 2, j);
                    break;
                }
                a *= 2;
            }
            ans += p;
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
 
        int N = sc.nextInt();
        int K = sc.nextInt();
        double ans = 0;

        for(int i=1; i<=N; i++){
            double p = 1.0 / N;
            int a = i;
            for(int j=0; j<=18; j++){
                if(a>=K){
                    p *= Math.pow((double)1 / 2, j);
                    break;
                }
                a *= 2;
            }
            ans += p;
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
 
        int N = sc.nextInt();
        int K = sc.nextInt();
        double ans = 0;

        for(int i=1; i<=N; i++){
            double p = 1.0 / N;
            int a = i;
            for(int j=0; j<=18; j++){
                if(a>=K){
                    p *= Math.pow((double)1 / 2, j);
                    break;
                }
                a *= 2;
            }
            ans += p;
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc double ans = 0; ans 0 for(int i=1; i<=N; i++){
            double p = 1.0 / N;
            int a = i;
            for(int j=0; j<=18; j++){
                if(a>=K){
                    p *= Math.pow((double)1 / 2, j);
                    break;
                }
                a *= 2;
            }
            ans += p;
        } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
            double p = 1.0 / N;
            int a = i;
            for(int j=0; j<=18; j++){
                if(a>=K){
                    p *= Math.pow((double)1 / 2, j);
                    break;
                }
                a *= 2;
            }
            ans += p;
        } {
            double p = 1.0 / N;
            int a = i;
            for(int j=0; j<=18; j++){
                if(a>=K){
                    p *= Math.pow((double)1 / 2, j);
                    break;
                }
                a *= 2;
            }
            ans += p;
        } double p = 1.0 / N; p 1.0 / N 1.0 N int a = i; a i for(int j=0; j<=18; j++){
                if(a>=K){
                    p *= Math.pow((double)1 / 2, j);
                    break;
                }
                a *= 2;
            } int j=0; int j=0; j 0 j<=18 j 18 j++ j++ j {
                if(a>=K){
                    p *= Math.pow((double)1 / 2, j);
                    break;
                }
                a *= 2;
            } {
                if(a>=K){
                    p *= Math.pow((double)1 / 2, j);
                    break;
                }
                a *= 2;
            } if(a>=K){
                    p *= Math.pow((double)1 / 2, j);
                    break;
                } a>=K a K {
                    p *= Math.pow((double)1 / 2, j);
                    break;
                } p *= Math.pow((double)1 / 2, j) p Math.pow((double)1 / 2, j) Math.pow Math (double)1 / 2 (double)1 2 j break; a *= 2 a 2 ans += p ans p System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;
import java.util.Map;
import java.util.TreeMap;
 
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
 
        int N = sc.nextInt();
        int K = sc.nextInt();
        double ans = 0;

        for(int i=1; i<=N; i++){
            double p = 1.0 / N;
            int a = i;
            for(int j=0; j<=18; j++){
                if(a>=K){
                    p *= Math.pow((double)1 / 2, j);
                    break;
                }
                a *= 2;
            }
            ans += p;
        }
        System.out.println(ans);
    }
}