import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] p = new int[(n > k) ? n : k];

        for (int i = k - 1; i > 0; i--) {
            if (i * 2 >= k) {
                p[i - 1] = 1;
            } else {
                p[i - 1] = p[(2 * i) - 1] + 1;
            }
        }

        double result = 0.0;
        for (int i = 0; i < n; i++) {
            result += (1 / (double) n) * (Math.pow(2, -p[i]));
        }

        System.out.println(result);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] p = new int[(n > k) ? n : k];

        for (int i = k - 1; i > 0; i--) {
            if (i * 2 >= k) {
                p[i - 1] = 1;
            } else {
                p[i - 1] = p[(2 * i) - 1] + 1;
            }
        }

        double result = 0.0;
        for (int i = 0; i < n; i++) {
            result += (1 / (double) n) * (Math.pow(2, -p[i]));
        }

        System.out.println(result);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] p = new int[(n > k) ? n : k];

        for (int i = k - 1; i > 0; i--) {
            if (i * 2 >= k) {
                p[i - 1] = 1;
            } else {
                p[i - 1] = p[(2 * i) - 1] + 1;
            }
        }

        double result = 0.0;
        for (int i = 0; i < n; i++) {
            result += (1 / (double) n) * (Math.pow(2, -p[i]));
        }

        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] p = new int[(n > k) ? n : k];

        for (int i = k - 1; i > 0; i--) {
            if (i * 2 >= k) {
                p[i - 1] = 1;
            } else {
                p[i - 1] = p[(2 * i) - 1] + 1;
            }
        }

        double result = 0.0;
        for (int i = 0; i < n; i++) {
            result += (1 / (double) n) * (Math.pow(2, -p[i]));
        }

        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int k = Integer.parseInt(sc.next()); k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] p = new int[(n > k) ? n : k]; p new int[(n > k) ? n : k] (n > k) ? n : k (n > k) n k n k for (int i = k - 1; i > 0; i--) {
            if (i * 2 >= k) {
                p[i - 1] = 1;
            } else {
                p[i - 1] = p[(2 * i) - 1] + 1;
            }
        } int i = k - 1; int i = k - 1; i k - 1 k 1 i > 0 i 0 i-- i-- i {
            if (i * 2 >= k) {
                p[i - 1] = 1;
            } else {
                p[i - 1] = p[(2 * i) - 1] + 1;
            }
        } {
            if (i * 2 >= k) {
                p[i - 1] = 1;
            } else {
                p[i - 1] = p[(2 * i) - 1] + 1;
            }
        } if (i * 2 >= k) {
                p[i - 1] = 1;
            } else {
                p[i - 1] = p[(2 * i) - 1] + 1;
            } i * 2 >= k i * 2 i 2 k {
                p[i - 1] = 1;
            } p[i - 1] = 1 p[i - 1] p i - 1 i 1 1 {
                p[i - 1] = p[(2 * i) - 1] + 1;
            } p[i - 1] = p[(2 * i) - 1] + 1 p[i - 1] p i - 1 i 1 p[(2 * i) - 1] + 1 p[(2 * i) - 1] p (2 * i) - 1 (2 * i) 2 i 1 1 double result = 0.0; result 0.0 for (int i = 0; i < n; i++) {
            result += (1 / (double) n) * (Math.pow(2, -p[i]));
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            result += (1 / (double) n) * (Math.pow(2, -p[i]));
        } {
            result += (1 / (double) n) * (Math.pow(2, -p[i]));
        } result += (1 / (double) n) * (Math.pow(2, -p[i])) result (1 / (double) n) * (Math.pow(2, -p[i])) (1 / (double) n) 1 (double) n (Math.pow(2, -p[i])) Math.pow Math 2 -p[i] p[i] p i System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] p = new int[(n > k) ? n : k];

        for (int i = k - 1; i > 0; i--) {
            if (i * 2 >= k) {
                p[i - 1] = 1;
            } else {
                p[i - 1] = p[(2 * i) - 1] + 1;
            }
        }

        double result = 0.0;
        for (int i = 0; i < n; i++) {
            result += (1 / (double) n) * (Math.pow(2, -p[i]));
        }

        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] p = new int[(n > k) ? n : k];

        for (int i = k - 1; i > 0; i--) {
            if (i * 2 >= k) {
                p[i - 1] = 1;
            } else {
                p[i - 1] = p[(2 * i) - 1] + 1;
            }
        }

        double result = 0.0;
        for (int i = 0; i < n; i++) {
            result += (1 / (double) n) * (Math.pow(2, -p[i]));
        }

        System.out.println(result);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] p = new int[(n > k) ? n : k];

        for (int i = k - 1; i > 0; i--) {
            if (i * 2 >= k) {
                p[i - 1] = 1;
            } else {
                p[i - 1] = p[(2 * i) - 1] + 1;
            }
        }

        double result = 0.0;
        for (int i = 0; i < n; i++) {
            result += (1 / (double) n) * (Math.pow(2, -p[i]));
        }

        System.out.println(result);
    }
}
