import 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++) {
            int now = i;
            double pro = 1;
            while(now < K) {
                now *= 2;
                pro /= 2;
            }
            ans += (double)(1/(double)N)*(pro);
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java 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++) {
            int now = i;
            double pro = 1;
            while(now < K) {
                now *= 2;
                pro /= 2;
            }
            ans += (double)(1/(double)N)*(pro);
        }
        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++) {
            int now = i;
            double pro = 1;
            while(now < K) {
                now *= 2;
                pro /= 2;
            }
            ans += (double)(1/(double)N)*(pro);
        }
        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++) {
            int now = i;
            double pro = 1;
            while(now < K) {
                now *= 2;
                pro /= 2;
            }
            ans += (double)(1/(double)N)*(pro);
        }
        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++) {
            int now = i;
            double pro = 1;
            while(now < K) {
                now *= 2;
                pro /= 2;
            }
            ans += (double)(1/(double)N)*(pro);
        } int i = 1; int i = 1; i 1 i<=N i N i++ i++ i {
            int now = i;
            double pro = 1;
            while(now < K) {
                now *= 2;
                pro /= 2;
            }
            ans += (double)(1/(double)N)*(pro);
        } {
            int now = i;
            double pro = 1;
            while(now < K) {
                now *= 2;
                pro /= 2;
            }
            ans += (double)(1/(double)N)*(pro);
        } int now = i; now i double pro = 1; pro 1 while(now < K) {
                now *= 2;
                pro /= 2;
            } now < K now K {
                now *= 2;
                pro /= 2;
            } now *= 2 now 2 pro /= 2 pro 2 ans += (double)(1/(double)N)*(pro) ans (double)(1/(double)N)*(pro) (double)(1/(double)N) 1 (double)N (pro) System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import 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++) {
            int now = i;
            double pro = 1;
            while(now < K) {
                now *= 2;
                pro /= 2;
            }
            ans += (double)(1/(double)N)*(pro);
        }
        System.out.println(ans);
    }
}