import java.math.BigDecimal;
import java.util.*;

public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        double ans = 0;
        double n = sc.nextDouble();
        double k = sc.nextDouble();

        for(int i = 1; i <= n; i++){
            double temp = 1 / n;

            int now = i;
            while(now < k){
                now *= 2;
                temp /= 2;
            }
            ans += temp;
        }

        System.out.println(ans);
        return;
    }
} import java.math.BigDecimal; BigDecimal java.math import java.util.*; util.* java public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        double ans = 0;
        double n = sc.nextDouble();
        double k = sc.nextDouble();

        for(int i = 1; i <= n; i++){
            double temp = 1 / n;

            int now = i;
            while(now < k){
                now *= 2;
                temp /= 2;
            }
            ans += temp;
        }

        System.out.println(ans);
        return;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        double ans = 0;
        double n = sc.nextDouble();
        double k = sc.nextDouble();

        for(int i = 1; i <= n; i++){
            double temp = 1 / n;

            int now = i;
            while(now < k){
                now *= 2;
                temp /= 2;
            }
            ans += temp;
        }

        System.out.println(ans);
        return;
    } main {
        Scanner sc = new Scanner(System.in);

        double ans = 0;
        double n = sc.nextDouble();
        double k = sc.nextDouble();

        for(int i = 1; i <= n; i++){
            double temp = 1 / n;

            int now = i;
            while(now < k){
                now *= 2;
                temp /= 2;
            }
            ans += temp;
        }

        System.out.println(ans);
        return;
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double ans = 0; ans 0 double n = sc.nextDouble(); n sc.nextDouble() sc.nextDouble sc double k = sc.nextDouble(); k sc.nextDouble() sc.nextDouble sc for(int i = 1; i <= n; i++){
            double temp = 1 / n;

            int now = i;
            while(now < k){
                now *= 2;
                temp /= 2;
            }
            ans += temp;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            double temp = 1 / n;

            int now = i;
            while(now < k){
                now *= 2;
                temp /= 2;
            }
            ans += temp;
        } {
            double temp = 1 / n;

            int now = i;
            while(now < k){
                now *= 2;
                temp /= 2;
            }
            ans += temp;
        } double temp = 1 / n; temp 1 / n 1 n int now = i; now i while(now < k){
                now *= 2;
                temp /= 2;
            } now < k now k {
                now *= 2;
                temp /= 2;
            } now *= 2 now 2 temp /= 2 temp 2 ans += temp ans temp System.out.println(ans) System.out.println System.out System System.out ans return; String[] args args public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        double ans = 0;
        double n = sc.nextDouble();
        double k = sc.nextDouble();

        for(int i = 1; i <= n; i++){
            double temp = 1 / n;

            int now = i;
            while(now < k){
                now *= 2;
                temp /= 2;
            }
            ans += temp;
        }

        System.out.println(ans);
        return;
    }
} public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        double ans = 0;
        double n = sc.nextDouble();
        double k = sc.nextDouble();

        for(int i = 1; i <= n; i++){
            double temp = 1 / n;

            int now = i;
            while(now < k){
                now *= 2;
                temp /= 2;
            }
            ans += temp;
        }

        System.out.println(ans);
        return;
    }
} Main
import java.math.BigDecimal;
import java.util.*;

public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        double ans = 0;
        double n = sc.nextDouble();
        double k = sc.nextDouble();

        for(int i = 1; i <= n; i++){
            double temp = 1 / n;

            int now = i;
            while(now < k){
                now *= 2;
                temp /= 2;
            }
            ans += temp;
        }

        System.out.println(ans);
        return;
    }
}
