import java.util.Scanner;

public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        sc.close();
        
        double pos = 0;
        for (int i = 1; i <= n; i++) {
            if (i >= k) {
                pos +=  ((double)1 / (double)n) * (double)(n - i + 1);
                break;
            } else {
                int times = 0;
                int diceNum = i;
                while (diceNum < k) {
                    times++;
                    diceNum = diceNum * 2;
                }
                pos += ((double)1 / (double)n) * (double)Math.pow(0.5, times);
            }
        } 
        System.out.println(pos);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        sc.close();
        
        double pos = 0;
        for (int i = 1; i <= n; i++) {
            if (i >= k) {
                pos +=  ((double)1 / (double)n) * (double)(n - i + 1);
                break;
            } else {
                int times = 0;
                int diceNum = i;
                while (diceNum < k) {
                    times++;
                    diceNum = diceNum * 2;
                }
                pos += ((double)1 / (double)n) * (double)Math.pow(0.5, times);
            }
        } 
        System.out.println(pos);
    }
} Main public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        sc.close();
        
        double pos = 0;
        for (int i = 1; i <= n; i++) {
            if (i >= k) {
                pos +=  ((double)1 / (double)n) * (double)(n - i + 1);
                break;
            } else {
                int times = 0;
                int diceNum = i;
                while (diceNum < k) {
                    times++;
                    diceNum = diceNum * 2;
                }
                pos += ((double)1 / (double)n) * (double)Math.pow(0.5, times);
            }
        } 
        System.out.println(pos);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        sc.close();
        
        double pos = 0;
        for (int i = 1; i <= n; i++) {
            if (i >= k) {
                pos +=  ((double)1 / (double)n) * (double)(n - i + 1);
                break;
            } else {
                int times = 0;
                int diceNum = i;
                while (diceNum < k) {
                    times++;
                    diceNum = diceNum * 2;
                }
                pos += ((double)1 / (double)n) * (double)Math.pow(0.5, times);
            }
        } 
        System.out.println(pos);
    } 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 sc.close() sc.close sc double pos = 0; pos 0 for (int i = 1; i <= n; i++) {
            if (i >= k) {
                pos +=  ((double)1 / (double)n) * (double)(n - i + 1);
                break;
            } else {
                int times = 0;
                int diceNum = i;
                while (diceNum < k) {
                    times++;
                    diceNum = diceNum * 2;
                }
                pos += ((double)1 / (double)n) * (double)Math.pow(0.5, times);
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            if (i >= k) {
                pos +=  ((double)1 / (double)n) * (double)(n - i + 1);
                break;
            } else {
                int times = 0;
                int diceNum = i;
                while (diceNum < k) {
                    times++;
                    diceNum = diceNum * 2;
                }
                pos += ((double)1 / (double)n) * (double)Math.pow(0.5, times);
            }
        } {
            if (i >= k) {
                pos +=  ((double)1 / (double)n) * (double)(n - i + 1);
                break;
            } else {
                int times = 0;
                int diceNum = i;
                while (diceNum < k) {
                    times++;
                    diceNum = diceNum * 2;
                }
                pos += ((double)1 / (double)n) * (double)Math.pow(0.5, times);
            }
        } if (i >= k) {
                pos +=  ((double)1 / (double)n) * (double)(n - i + 1);
                break;
            } else {
                int times = 0;
                int diceNum = i;
                while (diceNum < k) {
                    times++;
                    diceNum = diceNum * 2;
                }
                pos += ((double)1 / (double)n) * (double)Math.pow(0.5, times);
            } i >= k i k {
                pos +=  ((double)1 / (double)n) * (double)(n - i + 1);
                break;
            } pos +=  ((double)1 / (double)n) * (double)(n - i + 1) pos ((double)1 / (double)n) * (double)(n - i + 1) ((double)1 / (double)n) (double)1 (double)n (double)(n - i + 1) n - i n i 1 break; {
                int times = 0;
                int diceNum = i;
                while (diceNum < k) {
                    times++;
                    diceNum = diceNum * 2;
                }
                pos += ((double)1 / (double)n) * (double)Math.pow(0.5, times);
            } int times = 0; times 0 int diceNum = i; diceNum i while (diceNum < k) {
                    times++;
                    diceNum = diceNum * 2;
                } diceNum < k diceNum k {
                    times++;
                    diceNum = diceNum * 2;
                } times++ times diceNum = diceNum * 2 diceNum diceNum * 2 diceNum 2 pos += ((double)1 / (double)n) * (double)Math.pow(0.5, times) pos ((double)1 / (double)n) * (double)Math.pow(0.5, times) ((double)1 / (double)n) (double)1 (double)n (double)Math.pow(0.5, times) Math.pow Math 0.5 times System.out.println(pos) System.out.println System.out System System.out pos 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();
        sc.close();
        
        double pos = 0;
        for (int i = 1; i <= n; i++) {
            if (i >= k) {
                pos +=  ((double)1 / (double)n) * (double)(n - i + 1);
                break;
            } else {
                int times = 0;
                int diceNum = i;
                while (diceNum < k) {
                    times++;
                    diceNum = diceNum * 2;
                }
                pos += ((double)1 / (double)n) * (double)Math.pow(0.5, times);
            }
        } 
        System.out.println(pos);
    }
} public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        sc.close();
        
        double pos = 0;
        for (int i = 1; i <= n; i++) {
            if (i >= k) {
                pos +=  ((double)1 / (double)n) * (double)(n - i + 1);
                break;
            } else {
                int times = 0;
                int diceNum = i;
                while (diceNum < k) {
                    times++;
                    diceNum = diceNum * 2;
                }
                pos += ((double)1 / (double)n) * (double)Math.pow(0.5, times);
            }
        } 
        System.out.println(pos);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        sc.close();
        
        double pos = 0;
        for (int i = 1; i <= n; i++) {
            if (i >= k) {
                pos +=  ((double)1 / (double)n) * (double)(n - i + 1);
                break;
            } else {
                int times = 0;
                int diceNum = i;
                while (diceNum < k) {
                    times++;
                    diceNum = diceNum * 2;
                }
                pos += ((double)1 / (double)n) * (double)Math.pow(0.5, times);
            }
        } 
        System.out.println(pos);
    }
}
