import java.util.*;

public class Main {

    static int N;
    static int K;

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

        N = scanner.nextInt();
        K = scanner.nextInt();

        double acc = 0;

        double baseProb = (double) 1 / N;

        for(int i=1; i<=N; i++){
            if(i >= K){
                acc += baseProb;
            }else{
                acc += baseProb * powerProb(i);
            }
        }

        System.out.println(acc);
    }

    private static double powerProb(int target) {
        double ret = 1;

        while(target <= K-1){
            target *= 2;
            ret *= 0.5;
        }

        return ret;
    }
} import java.util.*; util.* java public class Main {

    static int N;
    static int K;

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

        N = scanner.nextInt();
        K = scanner.nextInt();

        double acc = 0;

        double baseProb = (double) 1 / N;

        for(int i=1; i<=N; i++){
            if(i >= K){
                acc += baseProb;
            }else{
                acc += baseProb * powerProb(i);
            }
        }

        System.out.println(acc);
    }

    private static double powerProb(int target) {
        double ret = 1;

        while(target <= K-1){
            target *= 2;
            ret *= 0.5;
        }

        return ret;
    }
} Main static int N; N static int K; K public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        N = scanner.nextInt();
        K = scanner.nextInt();

        double acc = 0;

        double baseProb = (double) 1 / N;

        for(int i=1; i<=N; i++){
            if(i >= K){
                acc += baseProb;
            }else{
                acc += baseProb * powerProb(i);
            }
        }

        System.out.println(acc);
    } main {
        Scanner scanner = new Scanner(System.in);

        N = scanner.nextInt();
        K = scanner.nextInt();

        double acc = 0;

        double baseProb = (double) 1 / N;

        for(int i=1; i<=N; i++){
            if(i >= K){
                acc += baseProb;
            }else{
                acc += baseProb * powerProb(i);
            }
        }

        System.out.println(acc);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) N = scanner.nextInt() N scanner.nextInt() scanner.nextInt scanner K = scanner.nextInt() K scanner.nextInt() scanner.nextInt scanner double acc = 0; acc 0 double baseProb = (double) 1 / N; baseProb (double) 1 / N (double) 1 N for(int i=1; i<=N; i++){
            if(i >= K){
                acc += baseProb;
            }else{
                acc += baseProb * powerProb(i);
            }
        } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
            if(i >= K){
                acc += baseProb;
            }else{
                acc += baseProb * powerProb(i);
            }
        } {
            if(i >= K){
                acc += baseProb;
            }else{
                acc += baseProb * powerProb(i);
            }
        } if(i >= K){
                acc += baseProb;
            }else{
                acc += baseProb * powerProb(i);
            } i >= K i K {
                acc += baseProb;
            } acc += baseProb acc baseProb {
                acc += baseProb * powerProb(i);
            } acc += baseProb * powerProb(i) acc baseProb * powerProb(i) baseProb powerProb(i) powerProb i System.out.println(acc) System.out.println System.out System System.out acc String[] args args private static double powerProb(int target) {
        double ret = 1;

        while(target <= K-1){
            target *= 2;
            ret *= 0.5;
        }

        return ret;
    } powerProb {
        double ret = 1;

        while(target <= K-1){
            target *= 2;
            ret *= 0.5;
        }

        return ret;
    } double ret = 1; ret 1 while(target <= K-1){
            target *= 2;
            ret *= 0.5;
        } target <= K-1 target K-1 K 1 {
            target *= 2;
            ret *= 0.5;
        } target *= 2 target 2 ret *= 0.5 ret 0.5 return ret; ret int target target public class Main {

    static int N;
    static int K;

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

        N = scanner.nextInt();
        K = scanner.nextInt();

        double acc = 0;

        double baseProb = (double) 1 / N;

        for(int i=1; i<=N; i++){
            if(i >= K){
                acc += baseProb;
            }else{
                acc += baseProb * powerProb(i);
            }
        }

        System.out.println(acc);
    }

    private static double powerProb(int target) {
        double ret = 1;

        while(target <= K-1){
            target *= 2;
            ret *= 0.5;
        }

        return ret;
    }
} public class Main {

    static int N;
    static int K;

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

        N = scanner.nextInt();
        K = scanner.nextInt();

        double acc = 0;

        double baseProb = (double) 1 / N;

        for(int i=1; i<=N; i++){
            if(i >= K){
                acc += baseProb;
            }else{
                acc += baseProb * powerProb(i);
            }
        }

        System.out.println(acc);
    }

    private static double powerProb(int target) {
        double ret = 1;

        while(target <= K-1){
            target *= 2;
            ret *= 0.5;
        }

        return ret;
    }
} Main
import java.util.*;

public class Main {

    static int N;
    static int K;

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

        N = scanner.nextInt();
        K = scanner.nextInt();

        double acc = 0;

        double baseProb = (double) 1 / N;

        for(int i=1; i<=N; i++){
            if(i >= K){
                acc += baseProb;
            }else{
                acc += baseProb * powerProb(i);
            }
        }

        System.out.println(acc);
    }

    private static double powerProb(int target) {
        double ret = 1;

        while(target <= K-1){
            target *= 2;
            ret *= 0.5;
        }

        return ret;
    }
}
