import java.util.Scanner;

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

        int n = sc.nextInt();
        int k = sc.nextInt();
        double p = 0, p_n;

        for (int i = 1; i <= n; i++) {
            int score = i;
            p_n = 1 / (double) n;
            while (true) {
                if (score >= k) {
                    break;
                }
                score *= 2;
                p_n *= 0.5;
            }
            p += p_n;
        }

        System.out.println(p);

        sc.close();
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int k = sc.nextInt();
        double p = 0, p_n;

        for (int i = 1; i <= n; i++) {
            int score = i;
            p_n = 1 / (double) n;
            while (true) {
                if (score >= k) {
                    break;
                }
                score *= 2;
                p_n *= 0.5;
            }
            p += p_n;
        }

        System.out.println(p);

        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int k = sc.nextInt();
        double p = 0, p_n;

        for (int i = 1; i <= n; i++) {
            int score = i;
            p_n = 1 / (double) n;
            while (true) {
                if (score >= k) {
                    break;
                }
                score *= 2;
                p_n *= 0.5;
            }
            p += p_n;
        }

        System.out.println(p);

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int k = sc.nextInt();
        double p = 0, p_n;

        for (int i = 1; i <= n; i++) {
            int score = i;
            p_n = 1 / (double) n;
            while (true) {
                if (score >= k) {
                    break;
                }
                score *= 2;
                p_n *= 0.5;
            }
            p += p_n;
        }

        System.out.println(p);

        sc.close();
    } 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 p = 0 p 0 p_n; p_n for (int i = 1; i <= n; i++) {
            int score = i;
            p_n = 1 / (double) n;
            while (true) {
                if (score >= k) {
                    break;
                }
                score *= 2;
                p_n *= 0.5;
            }
            p += p_n;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int score = i;
            p_n = 1 / (double) n;
            while (true) {
                if (score >= k) {
                    break;
                }
                score *= 2;
                p_n *= 0.5;
            }
            p += p_n;
        } {
            int score = i;
            p_n = 1 / (double) n;
            while (true) {
                if (score >= k) {
                    break;
                }
                score *= 2;
                p_n *= 0.5;
            }
            p += p_n;
        } int score = i; score i p_n = 1 / (double) n p_n 1 / (double) n 1 (double) n while (true) {
                if (score >= k) {
                    break;
                }
                score *= 2;
                p_n *= 0.5;
            } true {
                if (score >= k) {
                    break;
                }
                score *= 2;
                p_n *= 0.5;
            } if (score >= k) {
                    break;
                } score >= k score k {
                    break;
                } break; score *= 2 score 2 p_n *= 0.5 p_n 0.5 p += p_n p p_n System.out.println(p) System.out.println System.out System System.out p sc.close() sc.close sc String[] args args
import java.util.Scanner;

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

        int n = sc.nextInt();
        int k = sc.nextInt();
        double p = 0, p_n;

        for (int i = 1; i <= n; i++) {
            int score = i;
            p_n = 1 / (double) n;
            while (true) {
                if (score >= k) {
                    break;
                }
                score *= 2;
                p_n *= 0.5;
            }
            p += p_n;
        }

        System.out.println(p);

        sc.close();
    }
}