import java.util.Scanner;

public class Main {

    static Scanner stdIn = new Scanner(System.in);
    public static void main(String[] args) {
        int n = stdIn.nextInt();
        int k = stdIn.nextInt();

        double kakuritu;
        
        int length;
        if(n<k){
            length = n;
            kakuritu = 0.0;
        }else{
            length = k;
            kakuritu = ((double)1/n)*(n-k);
        }

        for(int i=1; i<=length; i++){
            double tempkakuritu = 1;
            tempkakuritu *= (double)1/n;

            int tempi= i;
            for(; tempi<k; tempi*=2){
                tempkakuritu *= 0.5;
            }

            kakuritu += tempkakuritu;
        }

        System.out.println(kakuritu);

    }
} import java.util.Scanner; Scanner java.util public class Main {

    static Scanner stdIn = new Scanner(System.in);
    public static void main(String[] args) {
        int n = stdIn.nextInt();
        int k = stdIn.nextInt();

        double kakuritu;
        
        int length;
        if(n<k){
            length = n;
            kakuritu = 0.0;
        }else{
            length = k;
            kakuritu = ((double)1/n)*(n-k);
        }

        for(int i=1; i<=length; i++){
            double tempkakuritu = 1;
            tempkakuritu *= (double)1/n;

            int tempi= i;
            for(; tempi<k; tempi*=2){
                tempkakuritu *= 0.5;
            }

            kakuritu += tempkakuritu;
        }

        System.out.println(kakuritu);

    }
} Main static Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) public static void main(String[] args) {
        int n = stdIn.nextInt();
        int k = stdIn.nextInt();

        double kakuritu;
        
        int length;
        if(n<k){
            length = n;
            kakuritu = 0.0;
        }else{
            length = k;
            kakuritu = ((double)1/n)*(n-k);
        }

        for(int i=1; i<=length; i++){
            double tempkakuritu = 1;
            tempkakuritu *= (double)1/n;

            int tempi= i;
            for(; tempi<k; tempi*=2){
                tempkakuritu *= 0.5;
            }

            kakuritu += tempkakuritu;
        }

        System.out.println(kakuritu);

    } main {
        int n = stdIn.nextInt();
        int k = stdIn.nextInt();

        double kakuritu;
        
        int length;
        if(n<k){
            length = n;
            kakuritu = 0.0;
        }else{
            length = k;
            kakuritu = ((double)1/n)*(n-k);
        }

        for(int i=1; i<=length; i++){
            double tempkakuritu = 1;
            tempkakuritu *= (double)1/n;

            int tempi= i;
            for(; tempi<k; tempi*=2){
                tempkakuritu *= 0.5;
            }

            kakuritu += tempkakuritu;
        }

        System.out.println(kakuritu);

    } int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int k = stdIn.nextInt(); k stdIn.nextInt() stdIn.nextInt stdIn double kakuritu; kakuritu int length; length if(n<k){
            length = n;
            kakuritu = 0.0;
        }else{
            length = k;
            kakuritu = ((double)1/n)*(n-k);
        } n<k n k {
            length = n;
            kakuritu = 0.0;
        } length = n length n kakuritu = 0.0 kakuritu 0.0 {
            length = k;
            kakuritu = ((double)1/n)*(n-k);
        } length = k length k kakuritu = ((double)1/n)*(n-k) kakuritu ((double)1/n)*(n-k) ((double)1/n) (double)1 n (n-k) n k for(int i=1; i<=length; i++){
            double tempkakuritu = 1;
            tempkakuritu *= (double)1/n;

            int tempi= i;
            for(; tempi<k; tempi*=2){
                tempkakuritu *= 0.5;
            }

            kakuritu += tempkakuritu;
        } int i=1; int i=1; i 1 i<=length i length i++ i++ i {
            double tempkakuritu = 1;
            tempkakuritu *= (double)1/n;

            int tempi= i;
            for(; tempi<k; tempi*=2){
                tempkakuritu *= 0.5;
            }

            kakuritu += tempkakuritu;
        } {
            double tempkakuritu = 1;
            tempkakuritu *= (double)1/n;

            int tempi= i;
            for(; tempi<k; tempi*=2){
                tempkakuritu *= 0.5;
            }

            kakuritu += tempkakuritu;
        } double tempkakuritu = 1; tempkakuritu 1 tempkakuritu *= (double)1/n tempkakuritu (double)1/n (double)1 n int tempi= i; tempi i for(; tempi<k; tempi*=2){
                tempkakuritu *= 0.5;
            } ; tempi<k tempi k tempi*=2 tempi*=2 tempi 2 {
                tempkakuritu *= 0.5;
            } {
                tempkakuritu *= 0.5;
            } tempkakuritu *= 0.5 tempkakuritu 0.5 kakuritu += tempkakuritu kakuritu tempkakuritu System.out.println(kakuritu) System.out.println System.out System System.out kakuritu String[] args args public class Main {

    static Scanner stdIn = new Scanner(System.in);
    public static void main(String[] args) {
        int n = stdIn.nextInt();
        int k = stdIn.nextInt();

        double kakuritu;
        
        int length;
        if(n<k){
            length = n;
            kakuritu = 0.0;
        }else{
            length = k;
            kakuritu = ((double)1/n)*(n-k);
        }

        for(int i=1; i<=length; i++){
            double tempkakuritu = 1;
            tempkakuritu *= (double)1/n;

            int tempi= i;
            for(; tempi<k; tempi*=2){
                tempkakuritu *= 0.5;
            }

            kakuritu += tempkakuritu;
        }

        System.out.println(kakuritu);

    }
} public class Main {

    static Scanner stdIn = new Scanner(System.in);
    public static void main(String[] args) {
        int n = stdIn.nextInt();
        int k = stdIn.nextInt();

        double kakuritu;
        
        int length;
        if(n<k){
            length = n;
            kakuritu = 0.0;
        }else{
            length = k;
            kakuritu = ((double)1/n)*(n-k);
        }

        for(int i=1; i<=length; i++){
            double tempkakuritu = 1;
            tempkakuritu *= (double)1/n;

            int tempi= i;
            for(; tempi<k; tempi*=2){
                tempkakuritu *= 0.5;
            }

            kakuritu += tempkakuritu;
        }

        System.out.println(kakuritu);

    }
} Main
import java.util.Scanner;

public class Main {

    static Scanner stdIn = new Scanner(System.in);
    public static void main(String[] args) {
        int n = stdIn.nextInt();
        int k = stdIn.nextInt();

        double kakuritu;
        
        int length;
        if(n<k){
            length = n;
            kakuritu = 0.0;
        }else{
            length = k;
            kakuritu = ((double)1/n)*(n-k);
        }

        for(int i=1; i<=length; i++){
            double tempkakuritu = 1;
            tempkakuritu *= (double)1/n;

            int tempi= i;
            for(; tempi<k; tempi*=2){
                tempkakuritu *= 0.5;
            }

            kakuritu += tempkakuritu;
        }

        System.out.println(kakuritu);

    }
}