import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        double sum = 0;

        int base = 0;
        if (n>k){
            base = k;
        }
        else{
            base = n;
        }

        for (int i=1;i<=n;i++){
            int g = log(i,k);
            int check = (int) Math.pow(2,g)*n;
            sum += (double) 1/check;
        }

        System.out.println(sum);


    }

    static int log(int n,int k){
        int sum = 0;
        while (n<k){
            n *= 2;
            sum += 1;
        }
        return sum;
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        double sum = 0;

        int base = 0;
        if (n>k){
            base = k;
        }
        else{
            base = n;
        }

        for (int i=1;i<=n;i++){
            int g = log(i,k);
            int check = (int) Math.pow(2,g)*n;
            sum += (double) 1/check;
        }

        System.out.println(sum);


    }

    static int log(int n,int k){
        int sum = 0;
        while (n<k){
            n *= 2;
            sum += 1;
        }
        return sum;
    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        double sum = 0;

        int base = 0;
        if (n>k){
            base = k;
        }
        else{
            base = n;
        }

        for (int i=1;i<=n;i++){
            int g = log(i,k);
            int check = (int) Math.pow(2,g)*n;
            sum += (double) 1/check;
        }

        System.out.println(sum);


    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        double sum = 0;

        int base = 0;
        if (n>k){
            base = k;
        }
        else{
            base = n;
        }

        for (int i=1;i<=n;i++){
            int g = log(i,k);
            int check = (int) Math.pow(2,g)*n;
            sum += (double) 1/check;
        }

        System.out.println(sum);


    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan double sum = 0; sum 0 int base = 0; base 0 if (n>k){
            base = k;
        }
        else{
            base = n;
        } n>k n k {
            base = k;
        } base = k base k {
            base = n;
        } base = n base n for (int i=1;i<=n;i++){
            int g = log(i,k);
            int check = (int) Math.pow(2,g)*n;
            sum += (double) 1/check;
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            int g = log(i,k);
            int check = (int) Math.pow(2,g)*n;
            sum += (double) 1/check;
        } {
            int g = log(i,k);
            int check = (int) Math.pow(2,g)*n;
            sum += (double) 1/check;
        } int g = log(i,k); g log(i,k) log i k int check = (int) Math.pow(2,g)*n; check (int) Math.pow(2,g)*n (int) Math.pow(2,g) Math.pow Math 2 g n sum += (double) 1/check sum (double) 1/check (double) 1 check System.out.println(sum) System.out.println System.out System System.out sum String[] args args static int log(int n,int k){
        int sum = 0;
        while (n<k){
            n *= 2;
            sum += 1;
        }
        return sum;
    } log {
        int sum = 0;
        while (n<k){
            n *= 2;
            sum += 1;
        }
        return sum;
    } int sum = 0; sum 0 while (n<k){
            n *= 2;
            sum += 1;
        } n<k n k {
            n *= 2;
            sum += 1;
        } n *= 2 n 2 sum += 1 sum 1 return sum; sum int n n int k k public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        double sum = 0;

        int base = 0;
        if (n>k){
            base = k;
        }
        else{
            base = n;
        }

        for (int i=1;i<=n;i++){
            int g = log(i,k);
            int check = (int) Math.pow(2,g)*n;
            sum += (double) 1/check;
        }

        System.out.println(sum);


    }

    static int log(int n,int k){
        int sum = 0;
        while (n<k){
            n *= 2;
            sum += 1;
        }
        return sum;
    }
} public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        double sum = 0;

        int base = 0;
        if (n>k){
            base = k;
        }
        else{
            base = n;
        }

        for (int i=1;i<=n;i++){
            int g = log(i,k);
            int check = (int) Math.pow(2,g)*n;
            sum += (double) 1/check;
        }

        System.out.println(sum);


    }

    static int log(int n,int k){
        int sum = 0;
        while (n<k){
            n *= 2;
            sum += 1;
        }
        return sum;
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        double sum = 0;

        int base = 0;
        if (n>k){
            base = k;
        }
        else{
            base = n;
        }

        for (int i=1;i<=n;i++){
            int g = log(i,k);
            int check = (int) Math.pow(2,g)*n;
            sum += (double) 1/check;
        }

        System.out.println(sum);


    }

    static int log(int n,int k){
        int sum = 0;
        while (n<k){
            n *= 2;
            sum += 1;
        }
        return sum;
    }
}