import java.util.*;
import java.io.*;


public 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.0;
        ans+=Math.max(0.0,(double)(n-k)/n);

        for (int i=1; i<=Math.min(n,k); i++)
        {
            int tmp=i;
            int count=0;
            while(tmp<k)
            {
                tmp*=2;
                count++;
            }
            ans+=(Math.pow(0.5,(double)count)*(double)1/n);

        }
        System.out.println(String.format("%.10f", ans));


    }
} import java.util.*; util.* java import java.io.*; io.* java public 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.0;
        ans+=Math.max(0.0,(double)(n-k)/n);

        for (int i=1; i<=Math.min(n,k); i++)
        {
            int tmp=i;
            int count=0;
            while(tmp<k)
            {
                tmp*=2;
                count++;
            }
            ans+=(Math.pow(0.5,(double)count)*(double)1/n);

        }
        System.out.println(String.format("%.10f", 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.0;
        ans+=Math.max(0.0,(double)(n-k)/n);

        for (int i=1; i<=Math.min(n,k); i++)
        {
            int tmp=i;
            int count=0;
            while(tmp<k)
            {
                tmp*=2;
                count++;
            }
            ans+=(Math.pow(0.5,(double)count)*(double)1/n);

        }
        System.out.println(String.format("%.10f", ans));


    } main {
        Scanner sc = new Scanner(System.in);
        int n= sc.nextInt();
        int k= sc.nextInt();
        double ans= 0.0;
        ans+=Math.max(0.0,(double)(n-k)/n);

        for (int i=1; i<=Math.min(n,k); i++)
        {
            int tmp=i;
            int count=0;
            while(tmp<k)
            {
                tmp*=2;
                count++;
            }
            ans+=(Math.pow(0.5,(double)count)*(double)1/n);

        }
        System.out.println(String.format("%.10f", 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.0; ans 0.0 ans+=Math.max(0.0,(double)(n-k)/n) ans Math.max(0.0,(double)(n-k)/n) Math.max Math 0.0 (double)(n-k)/n (double)(n-k) n k n for (int i=1; i<=Math.min(n,k); i++)
        {
            int tmp=i;
            int count=0;
            while(tmp<k)
            {
                tmp*=2;
                count++;
            }
            ans+=(Math.pow(0.5,(double)count)*(double)1/n);

        } int i=1; int i=1; i 1 i<=Math.min(n,k) i Math.min(n,k) Math.min Math n k i++ i++ i {
            int tmp=i;
            int count=0;
            while(tmp<k)
            {
                tmp*=2;
                count++;
            }
            ans+=(Math.pow(0.5,(double)count)*(double)1/n);

        } {
            int tmp=i;
            int count=0;
            while(tmp<k)
            {
                tmp*=2;
                count++;
            }
            ans+=(Math.pow(0.5,(double)count)*(double)1/n);

        } int tmp=i; tmp i int count=0; count 0 while(tmp<k)
            {
                tmp*=2;
                count++;
            } tmp<k tmp k {
                tmp*=2;
                count++;
            } tmp*=2 tmp 2 count++ count ans+=(Math.pow(0.5,(double)count)*(double)1/n) ans (Math.pow(0.5,(double)count)*(double)1/n) Math.pow(0.5,(double)count)*(double)1 Math.pow(0.5,(double)count) Math.pow Math 0.5 (double)count (double)1 n System.out.println(String.format("%.10f", ans)) System.out.println System.out System System.out String.format("%.10f", ans) String.format String "%.10f" ans String[] args args public 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.0;
        ans+=Math.max(0.0,(double)(n-k)/n);

        for (int i=1; i<=Math.min(n,k); i++)
        {
            int tmp=i;
            int count=0;
            while(tmp<k)
            {
                tmp*=2;
                count++;
            }
            ans+=(Math.pow(0.5,(double)count)*(double)1/n);

        }
        System.out.println(String.format("%.10f", ans));


    }
} public 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.0;
        ans+=Math.max(0.0,(double)(n-k)/n);

        for (int i=1; i<=Math.min(n,k); i++)
        {
            int tmp=i;
            int count=0;
            while(tmp<k)
            {
                tmp*=2;
                count++;
            }
            ans+=(Math.pow(0.5,(double)count)*(double)1/n);

        }
        System.out.println(String.format("%.10f", ans));


    }
} Main
import java.util.*;
import java.io.*;


public 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.0;
        ans+=Math.max(0.0,(double)(n-k)/n);

        for (int i=1; i<=Math.min(n,k); i++)
        {
            int tmp=i;
            int count=0;
            while(tmp<k)
            {
                tmp*=2;
                count++;
            }
            ans+=(Math.pow(0.5,(double)count)*(double)1/n);

        }
        System.out.println(String.format("%.10f", ans));


    }
}