import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        double p = 0;
        int a, c;
        for (int i = 1; i <= n; i++) {
        	a = i;
        	c = 0;
        	while (a < k) {
        		c++;
        		a *= 2;
        	}
        	p += Math.pow(0.5, c) / n;
        }
        System.out.println(p);
    }
    
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        double p = 0;
        int a, c;
        for (int i = 1; i <= n; i++) {
        	a = i;
        	c = 0;
        	while (a < k) {
        		c++;
        		a *= 2;
        	}
        	p += Math.pow(0.5, c) / n;
        }
        System.out.println(p);
    }
    
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        double p = 0;
        int a, c;
        for (int i = 1; i <= n; i++) {
        	a = i;
        	c = 0;
        	while (a < k) {
        		c++;
        		a *= 2;
        	}
        	p += Math.pow(0.5, c) / n;
        }
        System.out.println(p);
    } main {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        double p = 0;
        int a, c;
        for (int i = 1; i <= n; i++) {
        	a = i;
        	c = 0;
        	while (a < k) {
        		c++;
        		a *= 2;
        	}
        	p += Math.pow(0.5, c) / n;
        }
        System.out.println(p);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int k = in.nextInt(); k in.nextInt() in.nextInt in double p = 0; p 0 int a a c; c for (int i = 1; i <= n; i++) {
        	a = i;
        	c = 0;
        	while (a < k) {
        		c++;
        		a *= 2;
        	}
        	p += Math.pow(0.5, c) / n;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
        	a = i;
        	c = 0;
        	while (a < k) {
        		c++;
        		a *= 2;
        	}
        	p += Math.pow(0.5, c) / n;
        } {
        	a = i;
        	c = 0;
        	while (a < k) {
        		c++;
        		a *= 2;
        	}
        	p += Math.pow(0.5, c) / n;
        } a = i a i c = 0 c 0 while (a < k) {
        		c++;
        		a *= 2;
        	} a < k a k {
        		c++;
        		a *= 2;
        	} c++ c a *= 2 a 2 p += Math.pow(0.5, c) / n p Math.pow(0.5, c) / n Math.pow(0.5, c) Math.pow Math 0.5 c n System.out.println(p) System.out.println System.out System System.out p String[] args args public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        double p = 0;
        int a, c;
        for (int i = 1; i <= n; i++) {
        	a = i;
        	c = 0;
        	while (a < k) {
        		c++;
        		a *= 2;
        	}
        	p += Math.pow(0.5, c) / n;
        }
        System.out.println(p);
    }
    
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        double p = 0;
        int a, c;
        for (int i = 1; i <= n; i++) {
        	a = i;
        	c = 0;
        	while (a < k) {
        		c++;
        		a *= 2;
        	}
        	p += Math.pow(0.5, c) / n;
        }
        System.out.println(p);
    }
    
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        double p = 0;
        int a, c;
        for (int i = 1; i <= n; i++) {
        	a = i;
        	c = 0;
        	while (a < k) {
        		c++;
        		a *= 2;
        	}
        	p += Math.pow(0.5, c) / n;
        }
        System.out.println(p);
    }
    
}